[FIX] ws doc: copy button in columned version
[odoo/odoo.git] / doc / _themes / odoodoc / static / style.less
1 @import "bootstrap/less/bootstrap";
2 @import url(http://fonts.googleapis.com/css?family=Lato);
3
4 @icon-font-path: 'fonts/';
5 @brand-primary: #a24689;
6 @brand-dark: darken(@brand-primary, 6%);
7 @brand-light: lighten(@brand-primary, 10%);
8 @brand-text: saturate(lighten(@brand-primary, 46%), 5%);
9
10 @headings-font-family: Lato, Arial, sans-serif;
11
12 @navbar-margin-bottom: 0;
13
14 @navbar-default-bg: white;
15 @navbar-default-border: 0;
16
17 // indent level for various items list e.g. dl, fields lists, ...
18 @item-indent: 30px;
19
20 * {
21   box-sizing: border-box;
22 }
23 body {
24   overflow: auto;
25   position: relative;
26 }
27
28 .document-super:not(.stripe) {
29   .container();
30 }
31 .document-super.stripe {
32   .container-fluid();
33 }
34
35 .document {
36   .make-row();
37 }
38
39 .documentwrapper {
40   .make-md-column(9);
41 }
42 .sphinxsidebar {
43   .make-md-column(3);
44 }
45
46 .btn-outline {
47   color: @brand-primary;
48   background-color: transparent;
49   border-color: @brand-primary;
50   &:hover, &:focus, &:active {
51     color: #fff;
52     background-color: @brand-primary;
53     border-color: @brand-primary;
54   }
55 }
56
57
58 .btn-outline-inverse {
59   color: #fff;
60   background-color: transparent;
61   border-color: @brand-text;
62   &:hover, &:focus, &:active {
63     color: @brand-primary;
64     text-shadow: none;
65     background-color: #fff;
66     border-color: #fff;
67   }
68 }
69 /*
70  * Main navigation
71  */
72 .docs-nav {
73   .navbar-brand,
74   .navbar-nav > li > a {
75     position: relative;
76   }
77
78   .navbar-nav > li {
79     > a:hover:before, &.current a:before {
80       bottom: 10px;
81       opacity: 1;
82     }
83     > a:before {
84       display: block;
85       position: absolute;
86       bottom: 0;
87       left: 10px;
88       content: "";
89       right: 10px;
90       height: 3px;
91       background: @brand-primary;
92       opacity: 0;
93       .transition(all 0.3s ease-out);
94     }
95     &.dropdown {
96       > a:after {
97         content: " ";
98         display: inline-block;
99         width: 0;
100         height: 0;
101         margin-left: 5px;
102         vertical-align: middle;
103         border-top: 4px solid @gray-light;
104         border-right: 4px solid transparent;
105         border-left: 4px solid transparent;
106       }
107       .dropdown-menu > li.current > a.current {
108         background-color: @brand-primary;
109         color: white;
110       }
111     }
112   }
113   /* version switcher */
114   div.versions {
115     position: relative;
116     cursor: pointer;
117     font-size: 300%;
118     display: inline-block;
119
120     > a {
121       font-size: 40%;
122       margin: 0.2em;
123       color: #999;
124       font-family: Lato, Arial, sans-serif;
125       &:hover, &:focus {
126         text-decoration: none;
127       }
128     }
129   }
130 }
131
132 // FIXME: protocol-relative urls for remote but absolute for local (file://)?
133 .o_logo {
134   display: inline-block;
135   font-size: 300%;
136   .o_logo_main {
137     background-image: url(odoo_logo_rgb.png);
138     background-repeat: no-repeat;
139     background-position: center center;
140     background-size: contain;
141     color: rgba(255, 255, 255, 0);
142     text-decoration: none;
143   }
144   .o_logo_app {
145     text-decoration: none;
146     color: rgb(143, 143, 143);
147     font-family: Lato, Arial, sans-serif;
148     font-size: 50%;
149     margin: 0.2em;
150   }
151 }
152
153 /*
154  * Side navigation
155  *
156  * Scrollspy and affixed enhanced navigation to highlight sections and secondary
157  * sections of docs content.
158  */
159
160 /* By default it's not affixed in mobile views, so undo that */
161 .sphinxsidebarwrapper.affix {
162   position: static;
163 }
164 @media (min-width: @screen-sm-min) {
165   .sphinxsidebarwrapper {
166     padding-left: 20px;
167   }
168 }
169
170 /* Side navigation visibility changes */
171 .sphinxsidebarwrapper {
172   > .nav { // root (contains document categories), always show
173     .nav {
174       // hide sub-everything by default
175       display: none;
176     }
177
178     li.active > .nav,
179     li.current > .nav {
180       // sub-items of a current or active li are shown
181       display: block;
182     }
183   }
184 }
185
186 /* Side navigation graphical styling */
187 @nav-spacing: 20px;
188 @nav-spacing-increment: 5px;
189 @nav-hover-offset: 1px;
190 @nav-hover: @nav-spacing - @nav-hover-offset;
191 @nav-current-offset: 2px;
192 @nav-current: @nav-spacing - @nav-current-offset;
193
194 .sphinxsidebar {
195   z-index: 1;
196 }
197 .sphinxsidebarwrapper {
198   width: 100%;
199   font-size: 13px;
200   z-index: 1;
201
202   .hidden-xs();
203   .hidden-sm();
204   .hidden-print();
205
206   /* First level of nav */
207   > .nav {
208     margin-top: 20px;
209     margin-bottom: 20px;
210   }
211
212   .nav > li > a {
213     font-weight: bold;
214     padding-left: @nav-spacing;
215   }
216   .nav .nav > li > a {
217     font-size: 12px;
218     padding-left: @nav-spacing + @nav-spacing-increment;
219   }
220   .nav .nav .nav > li > a {
221     font-weight: normal;
222     padding-left: @nav-spacing + 2*@nav-spacing-increment;
223   }
224   .nav .nav .nav .nav > li > a {
225     font-size: 11px;
226     padding-left: @nav-spacing + 3*@nav-spacing-increment;
227   }
228
229   /* All levels of nav */
230   .nav {
231     > li > a {
232       display: block;
233       padding: 4px @nav-spacing;
234       color: #999;
235
236       &:hover, &:focus {
237         padding-left: @nav-hover;
238         color: @brand-primary;
239         text-decoration: none;
240         background-color: transparent;
241         border-left: @nav-hover-offset solid @brand-primary;
242       }
243     }
244
245     // before scrollspy is applied, need to use current for docs
246     > .current > a, > .current:hover > a, > .current:focus > a,
247     > .active > a, > .active:hover > a, > .active:focus > a {
248       padding-left: @nav-current;
249       font-weight: bold;
250       color: @brand-primary;
251       background-color: transparent;
252       border-left: @nav-current-offset solid @brand-primary;
253     }
254   }
255   .nav .nav {
256     > li > a:hover, > li > a:focus {
257       padding-left: @nav-hover + @nav-spacing-increment;
258     }
259     > .current > a, > .current:hover > a, > .current:focus > a,
260     > .active > a, > .active:hover > a, > .active:focus > a {
261       padding-left: @nav-current + @nav-spacing-increment;
262     }
263   }
264   .nav .nav .nav {
265     padding-bottom: 10px;
266
267     > li > a {
268       padding-top: 1px;
269       padding-bottom: 1px;
270     }
271
272     > li > a:hover, > li > a:focus {
273       padding-left: @nav-hover + 2 * @nav-spacing-increment;
274     }
275     > .active > a, > .active:hover > a, > .active:focus > a {
276       padding-left: @nav-current + 2 * @nav-spacing-increment;
277       font-weight: bold;
278     }
279   }
280   .nav .nav .nav .nav {
281     > li > a:hover, > li > a:focus {
282       padding-left: @nav-hover + 3 * @nav-spacing-increment;
283     }
284     > .active > a, > .active:hover > a, > .active:focus > a {
285       padding-left: @nav-current + 3 * @nav-spacing-increment;
286     }
287   }
288 }
289 /* github link for current document */
290 .sphinxsidebarwrapper > p {
291   margin: 5px 10px 10px;
292   a {
293     font-size: 13px;
294     &:hover {
295       text-decoration: none;
296     }
297
298     &.github {
299       padding-left: 15px;
300       position: relative;
301       &:before {
302         left: 0;
303         top: 1px;
304         content: '';
305         position: absolute;
306         width: 13px;
307         height: 13px;
308         background: url(github-link.png) left bottom / 13px no-repeat;
309       }
310       &:hover:before {
311         background-position: left top;
312       }
313     }
314   }
315 }
316
317 /* Show and affix the side nav when space allows it */
318 @media (min-width: @screen-md-min) {
319   .sphinxsidebarwrapper {
320     .nav .nav > .active > ul {
321       display: block;
322     }
323     /* Widen the fixed sidebar */
324     &.affix, &.affix-bottom {
325       width: 213px;
326     }
327     &.affix {
328       position: fixed; /* Undo the static from mobile first approach */
329       top: 20px;
330     }
331     &.affix-bottom {
332       position: absolute; /* Undo the static from mobile first approach */
333     }
334     &.affix-bottom > .nav, &.affix > .nav {
335       margin-top: 0;
336       margin-bottom: 0;
337     }
338   }
339 }
340 @media (min-width: @screen-lg-min) {
341   /* Widen the fixed sidebar again */
342   .sphinxsidebarwrapper.affix-bottom,
343   .sphinxsidebarwrapper.affix {
344     width: 263px;
345   }
346 }
347
348 /*
349  * Footer
350  *
351  * Separated section of content at the bottom of all pages, save the homepage.
352  */
353
354 .footer {
355   padding-top: 40px;
356   padding-bottom: 40px;
357   margin-top: 100px;
358   color: #777;
359   text-align: center;
360   border-top: 1px solid #e5e5e5;
361 }
362 .docs-footer-links {
363   padding-left: 0;
364   margin-top: 20px;
365   color: #999;
366 }
367 .docs-footer-links li {
368   display: inline;
369   padding: 0 2px;
370 }
371 .docs-footer-links li:first-child {
372   padding-left: 0;
373 }
374
375 @media (min-width: 768px) {
376   .footer p {
377     margin-bottom: 0;
378   }
379 }
380
381 // move [source] link to the right
382 .viewcode-link {
383   font-weight: normal;
384   float: right;
385   display: none;
386 }
387 dt:hover > a > .viewcode-link {
388   display: inline;
389 }
390
391 // either that or overwrite visit_attribution/depart_attribution
392 blockquote p.attribution:extend(blockquote footer) {}
393
394 div.section > h1 {
395   .page-header();
396   font-size: floor((@font-size-base * 3.05));
397 }
398
399 div.section > h2 {
400   .page-header();
401   font-size: @font-size-h1;
402   padding-top: 20px;
403   margin-top: 0;
404 }
405 // ~docs-section
406 .body > .section > .section {
407   margin-bottom: 60px;
408 }
409
410 .literal:extend(code) {}
411
412 .admonition {
413   padding: 20px;
414   margin: 20px 0;
415   border: 1px solid @gray-lighter;
416   border-left-width: 5px;
417   border-radius: 3px;
418
419   .admonition-title:after {
420     content: ": ";
421   }
422   > .admonition-title,
423   // only "aphorisms" should have the same size as the admonition category
424   &.aphorism > .admonition-title + p,
425   &.exercise > .admonition-title + p {
426     display: inline-block;
427     margin-top: 0;
428     margin-bottom: 5px;
429
430     font-family: @headings-font-family;
431     font-weight: @headings-font-weight;
432     line-height: @headings-line-height;
433     color: @headings-color;
434
435     font-size: @font-size-h4;
436   }
437
438   p:last-child {
439     margin-bottom: 0;
440   }
441
442   &.tip {
443     border-left-color: @brand-info;
444     > .admonition-title {
445       color: @brand-info;
446     }
447   }
448   &.warning {
449     border-left-color: @brand-warning;
450     > .admonition-title {
451       color: @brand-warning;
452     }
453   }
454   &.danger {
455     border-left-color: @brand-danger;
456     > .admonition-title {
457       color: @brand-danger;
458     }
459   }
460   &.exercise {
461     border-left-color: @gray-light;
462     > .admonition-title {
463       color: @gray;
464     }
465   }
466 }
467
468 /*
469  * Code snippets
470  *
471  * Generated via Pygments
472  */
473 .highlight pre {
474   padding: 4px;
475   font-size: 75%;
476   // don't break lines within words
477   word-break: normal;
478   word-wrap: normal;
479 }
480 .switchable .highlight.with-btn-clipboard pre {
481   // avoid copy button overlapping with even long lines
482   padding-right: 50px;
483 }
484
485 /*
486  * ZeroClipboard styles
487  */
488 .highlight {
489   position: relative;
490 }
491 .btn-clipboard {
492   position: absolute;
493   top: 0;
494   right: 0;
495   z-index: 3;
496   display: block;
497   padding: 5px 8px;
498   font-size: 12px;
499   color: #777;
500   cursor: pointer;
501   background-color: #fff;
502   border: 1px solid #e1e1e8;
503   border-radius: 0 4px 0 4px;
504
505   &:focus {
506     outline: none;
507   }
508
509   &.active {
510     background-color: #ffffad;
511     .transition(background-color .5s linear);
512   }
513 }
514
515 // rST styles
516 img.align-center {
517   display: block;
518   margin: 0 auto;
519 }
520
521 dd {
522   // Reinstate dd indent, looks horrible and illegible otherwise
523   margin-left: @item-indent;
524 }
525
526 // By default there's (browser) padding on ``ul`` so lists of >1 field are
527 // nicely separated from the section name (e.g. ``Parameters``) but single
528 // fields/items are stuck to it and look horrible. Make everything neatly-ish
529 // aligned. Other option: half and half so list bullets are aligned to text
530 // instead of text to text
531 td.field-body {
532   padding-left: @item-indent;
533   ul {
534     padding-left: @item-indent;
535   }
536   > ul {
537     padding-left: 0;
538   }
539 }
540
541 // naming collision, rST generates .container nodes with completely different
542 // semantics so go away
543 .section .container {
544     width: auto;
545     margin: 0;
546     padding: 0;
547 }
548
549 // lighten js namespace/class name
550 .descclassname {
551   opacity: 0.5;
552 }
553
554
555 .index-tree {
556   ul, li {
557     list-style: none;
558     padding: 0;
559     margin: 0;
560   }
561   > ul > li {
562     margin-bottom: 0.5em;
563     > a {
564       .h3();
565       text-align: center;
566     }
567     > ul {
568       display: -webkit-flex;
569       display: flex;
570       -webkit-flex-wrap: wrap;
571       flex-wrap: wrap;
572       > li {
573         width: 50%;
574         a {
575           .h4();
576           padding-left: 10%;
577           padding-right: 10%;
578         }
579       }
580     }
581     a {
582       display: block;
583       color: @link-color !important;
584       padding: 0.3em 0;
585       margin: 3px !important;
586       &:hover {
587         background-color: @gray-lighter;
588       }
589     }
590   }
591 }
592
593 @background-right: @gray-dark;
594 @color-right: @gray-lighter;
595 @color-right-code: lighten(#000, 80%);
596 @separator-right: @gray-light;
597 // STRIPE-STYLE PAGES
598 .stripe {
599   .section {
600     margin-bottom: 2em;
601   }
602
603   // === columning only on medium+ ===
604   @media (min-width: @screen-md-min) {
605     // column 1
606     .section > *,
607     .section > .force-left {
608       width: 49%;
609       float: left;
610       clear: left;
611     }
612     // column 2
613     .section > .force-right {
614       padding-left: 1em;
615       padding-right: 1em;
616     }
617     .section > .force-right,
618     .section > [class*=highlight] {
619       float: none;
620       clear: none;
621       margin-left: 50%;
622       width: 50%;
623       color: @color-right;
624       a {
625         color: lighten(@link-color, 30%);
626       }
627       code, .literal {
628         color: @code-bg;
629         background-color: @gray;
630       }
631       &:not(.highlight-json) .highlight {
632         border-bottom-color: @separator-right;
633       }
634       &.admonition {
635         margin-left: 51%;
636         width: 49%;
637         border-top-color: @separator-right;
638         border-bottom-color: @separator-right;
639         border-right-color: @separator-right;
640       }
641       pre {
642         // padding leads to overflow scrollbar in safari for no reason I understand,
643         // margin does not have that issue
644         padding: 0;
645         margin: 10px;
646
647         background: none;
648         border: none;
649       }
650       .highlight {
651         border-color: @gray;
652         border-style: solid;
653         border-width: 1px 0;
654         // solarized-ish from https://gist.github.com/qguv/7936275
655         color: @color-right-code;
656         background: none;
657         .lineno { color: #586e75 } /* Line Numbers */
658         .c { color: #586e75 } /* Comment */
659         .err { color: @color-right-code } /* Error */
660         .g { color: @color-right-code } /* Generic */
661         .k { color: #859900 } /* Keyword */
662         .l { color: @color-right-code } /* Literal */
663         .n { color: @color-right-code } /* Name */
664         .o { color: #859900 } /* Operator */
665         .x { color: #cb4b16 } /* Other */
666         .p { color: @color-right-code } /* Punctuation */
667         .cm { color: #586e75 } /* Comment.Multiline */
668         .cp { color: #859900 } /* Comment.Preproc */
669         .c1 { color: #586e75 } /* Comment.Single */
670         .cs { color: #859900 } /* Comment.Special */
671         .gd { color: #2aa198 } /* Generic.Deleted */
672         .ge { color: @color-right-code; font-style: italic } /* Generic.Emph */
673         .gr { color: #dc322f } /* Generic.Error */
674         .gh { color: #cb4b16 } /* Generic.Heading */
675         .gi { color: #859900 } /* Generic.Inserted */
676         .go { color: @color-right-code } /* Generic.Output */
677         .gp { color: @color-right-code } /* Generic.Prompt */
678         .gs { color: @color-right-code; font-weight: bold } /* Generic.Strong */
679         .gu { color: #cb4b16 } /* Generic.Subheading */
680         .gt { color: @color-right-code } /* Generic.Traceback */
681         .kc { color: #cb4b16 } /* Keyword.Constant */
682         .kd { color: #268bd2 } /* Keyword.Declaration */
683         .kn { color: #859900 } /* Keyword.Namespace */
684         .kp { color: #859900 } /* Keyword.Pseudo */
685         .kr { color: #268bd2 } /* Keyword.Reserved */
686         .kt { color: #dc322f } /* Keyword.Type */
687         .ld { color: @color-right-code } /* Literal.Date */
688         .m { color: #2aa198 } /* Literal.Number */
689         .s { color: #2aa198 } /* Literal.String */
690         .na { color: @color-right-code } /* Name.Attribute */
691         .nb { color: #B58900 } /* Name.Builtin */
692         .nc { color: #268bd2 } /* Name.Class */
693         .no { color: #cb4b16 } /* Name.Constant */
694         .nd { color: #268bd2 } /* Name.Decorator */
695         .ni { color: #cb4b16 } /* Name.Entity */
696         .ne { color: #cb4b16 } /* Name.Exception */
697         .nf { color: #268bd2 } /* Name.Function */
698         .nl { color: @color-right-code } /* Name.Label */
699         .nn { color: @color-right-code } /* Name.Namespace */
700         .nx { color: @color-right-code } /* Name.Other */
701         .py { color: @color-right-code } /* Name.Property */
702         .nt { color: #268bd2 } /* Name.Tag */
703         .nv { color: #268bd2 } /* Name.Variable */
704         .ow { color: #859900 } /* Operator.Word */
705         .w { color: @color-right-code } /* Text.Whitespace */
706         .mf { color: #2aa198 } /* Literal.Number.Float */
707         .mh { color: #2aa198 } /* Literal.Number.Hex */
708         .mi { color: #2aa198 } /* Literal.Number.Integer */
709         .mo { color: #2aa198 } /* Literal.Number.Oct */
710         .sb { color: #586e75 } /* Literal.String.Backtick */
711         .sc { color: #2aa198 } /* Literal.String.Char */
712         .sd { color: @color-right-code } /* Literal.String.Doc */
713         .s2 { color: #2aa198 } /* Literal.String.Double */
714         .se { color: #cb4b16 } /* Literal.String.Escape */
715         .sh { color: @color-right-code } /* Literal.String.Heredoc */
716         .si { color: #2aa198 } /* Literal.String.Interpol */
717         .sx { color: #2aa198 } /* Literal.String.Other */
718         .sr { color: #dc322f } /* Literal.String.Regex */
719         .s1 { color: #2aa198 } /* Literal.String.Single */
720         .ss { color: #2aa198 } /* Literal.String.Symbol */
721         .bp { color: #268bd2 } /* Name.Builtin.Pseudo */
722         .vc { color: #268bd2 } /* Name.Variable.Class */
723         .vg { color: #268bd2 } /* Name.Variable.Global */
724         .vi { color: #268bd2 } /* Name.Variable.Instance */
725         .il { color: #2aa198 } /* Literal.Number.Integer.Long */
726       }
727     }
728     // separator above H2
729     .body > .section > .section {
730       border-top: 1px solid @color-right;
731     }
732     .section > h1, .section > h2, .section > h3, .section > h4, .section > h5,
733     .section > h6 {
734       max-width: 50%;
735
736     }
737     .section > h1, .section > h2, .section > h3, .section > h4, .section > h5,
738     .section > h6, .section > .section {
739       position: relative;
740       width: auto;
741       float: none;
742       clear: both;
743     }
744
745     .documentwrapper {
746       overflow: auto;
747       // middle separator
748       &:before {
749         position: absolute;
750         top: 0;
751         bottom: 0;
752         left: 50%;
753         content: "";
754         width: 50%;
755         background: @background-right;
756       }
757     }
758
759     .highlight pre {
760       // but allow additional line-breaks between "words" to avoid overflow
761       white-space: pre-wrap;
762     }
763
764     .btn-clipboard {
765       background-color: transparent;
766       color: @color-right;
767       border-color: @separator-right;
768       border-top: none;
769       border-top-right-radius: 0;
770
771       &.active {
772         background-color: @gray;
773         .transition(background-color .5s linear);
774       }
775     }
776   }
777
778   .switcher {
779     color: white;
780     width: auto !important;
781     float: none !important;
782
783     position: absolute;
784     display: -webkit-flex;
785     display: flex;
786     -webkit-justify-content: flex-end;
787     justify-content: flex-end;
788
789     right: 0.5em;
790     list-style: none;
791     padding: 0;
792     margin: 0;
793     z-index: 5;
794     &.affix {
795       position: fixed;
796       top: 0;
797     }
798
799     li {
800       background-color: #0f131a;
801       padding: 0.4em 1em;
802       border: 1px solid #333;
803       border-left-width: 0;
804       cursor: pointer;
805       &:first-child {
806         border-left-width: 1px;
807         border-radius: 0 0 0 5px;
808       }
809       &:last-child {
810         border-radius: 0 0 5px 0;
811       }
812       &:hover {
813         background-color: #222;
814       }
815       &.active {
816         background-color: #333;
817       }
818     }
819   }
820
821   // === show/hide code snippets ===
822   [class*=only-],
823   .switchable > .highlight {
824     display: none;
825   }
826   // must be final rule of page
827   .only-python, .highlight-python > .highlight {
828     display: block;
829   }
830 }