ea53cd95e8526c2ae0736fe69d333228510296d4
[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
476   font-size: 75%;
477   // don't break lines within words
478   word-break: normal;
479   word-wrap: normal;
480 }
481 .switchable .highlight.with-btn-clipboard pre {
482   // avoid copy button overlapping with even long lines
483   padding-right: 50px;
484 }
485
486 /*
487  * ZeroClipboard styles
488  */
489 .highlight {
490   position: relative;
491 }
492 .btn-clipboard {
493   position: absolute;
494   top: 0;
495   right: 0;
496   z-index: 3;
497   display: block;
498   padding: 5px 8px;
499   font-size: 12px;
500   color: #777;
501   cursor: pointer;
502   background-color: #fff;
503   border: 1px solid #e1e1e8;
504   border-radius: 0 4px 0 4px;
505
506   &:focus {
507     outline: none;
508   }
509
510   &.active {
511     background-color: #ffffad;
512     .transition(background-color .5s linear);
513   }
514 }
515
516 // rST styles
517 img.align-center {
518   display: block;
519   margin: 0 auto;
520 }
521
522 dd {
523   // Reinstate dd indent, looks horrible and illegible otherwise
524   margin-left: @item-indent;
525 }
526
527 // By default there's (browser) padding on ``ul`` so lists of >1 field are
528 // nicely separated from the section name (e.g. ``Parameters``) but single
529 // fields/items are stuck to it and look horrible. Make everything neatly-ish
530 // aligned. Other option: half and half so list bullets are aligned to text
531 // instead of text to text
532 td.field-body {
533   padding-left: @item-indent;
534   ul {
535     padding-left: @item-indent;
536   }
537   > ul {
538     padding-left: 0;
539   }
540 }
541
542 // naming collision, rST generates .container nodes with completely different
543 // semantics so go away
544 .section .container {
545     width: auto;
546     margin: 0;
547     padding: 0;
548 }
549
550 // lighten js namespace/class name
551 .descclassname {
552   opacity: 0.5;
553 }
554
555
556 .index-tree {
557   ul, li {
558     list-style: none;
559     padding: 0;
560     margin: 0;
561   }
562   > ul > li {
563     margin-bottom: 0.5em;
564     > a {
565       .h3();
566       text-align: center;
567     }
568     > ul {
569       display: -webkit-flex;
570       display: flex;
571       -webkit-flex-wrap: wrap;
572       flex-wrap: wrap;
573       > li {
574         width: 50%;
575         a {
576           .h4();
577           padding-left: 10%;
578           padding-right: 10%;
579         }
580       }
581     }
582     a {
583       display: block;
584       color: @link-color !important;
585       padding: 0.3em 0;
586       margin: 3px !important;
587       &:hover {
588         background-color: @gray-lighter;
589       }
590     }
591   }
592 }
593 // STRIPE-STYLE PAGES
594 .stripe {
595   .section {
596     margin-bottom: 2em;
597   }
598
599   // === columning only on medium+ ===
600   @media (min-width: @screen-md-min) {
601     // column 1
602     .section > *,
603     .section > .force-left {
604       width: 49%;
605       float: left;
606       clear: left;
607     }
608     // column 2
609     .section > .force-right,
610     .section > [class*=highlight] {
611       float: none;
612       clear: none;
613       margin-left: 51%;
614     }
615     // fullwidth elements
616     .section > h1, .section > h2, .section > h3, .section > h4, .section > h5,
617     .section > h6 {
618       background-color: fadeout(@body-bg, 30%);
619     }
620     .section > h1, .section > h2, .section > h3, .section > h4, .section > h5,
621     .section > h6, .section > .section {
622       position: relative;
623       width: auto;
624       float: none;
625       clear: both;
626     }
627
628     .bodywrapper {
629       position: relative;
630       // middle separator
631       &:before {
632         position: absolute;
633         top: 0;
634         bottom: 0;
635         left: 50%;
636         content: "";
637         width: 0;
638         border-left: 1px solid @gray-light;
639       }
640     }
641
642     .highlight pre {
643       // but allow additional line-breaks between "words" to avoid overflow
644       white-space: pre-wrap;
645     }
646   }
647
648   .switcher {
649     color: white;
650     width: auto !important;
651     float: none !important;
652
653     position: fixed;
654     display: -webkit-flex;
655     display: flex;
656     -webkit-justify-content: flex-end;
657     justify-content: flex-end;
658
659     right: 0.5em;
660     list-style: none;
661     padding: 0;
662     margin: 0;
663     z-index: 5;
664
665     li {
666       background-color: #0f131a;
667       padding: 0.4em 1em;
668       border: 1px solid #333;
669       border-left-width: 0;
670       cursor: pointer;
671       &:first-child {
672         border-left-width: 1px;
673         border-radius: 5px 0 0 5px;
674       }
675       &:last-child {
676         border-radius: 0 5px 5px 0;
677       }
678       &:hover {
679         background-color: #222;
680       }
681       &.active {
682         background-color: #333;
683       }
684     }
685   }
686
687   // === show/hide code snippets ===
688   [class*=only-],
689   .switchable > .highlight {
690     display: none;
691   }
692   // must be final rule of page
693   .only-python, .highlight-python > .highlight {
694     display: block;
695   }
696 }