documentation/extensions/odoo_theme/static/style.scss
2021-03-08 18:21:24 +01:00

871 lines
24 KiB
SCSS

@import "scss/_sphinx_basic";
@import "scss/_variables";
@import "scss/bootstrap_overridden";
@import "scss/bootstrap_scss/bootstrap";
@import "scss/_mixins";
@import "scss/_typography";
@import "scss/_iconfont";
div[aria-label="related navigation"] {
display: none;
}
body {
a:not(:hover), a.o_logo {
text-decoration: none !important;
}
dd {
margin-left: 1rem;
}
}
.hidden {
visibility: hidden !important;
display: none !important;
opacity: 0 !important;
}
//------------------------------------------------------------------------------
// Header with logo, searchbar and switchers
//------------------------------------------------------------------------------
header.o_main_header{
display: flex;
align-items: center;
height: $o-header-height;
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: $o-header-white;
z-index: 10;
@include media-breakpoint-up(lg) {
padding-right: 3rem;
}
.o_logo_wrapper {
padding: 0 1rem;
> .o_logo {
img {
margin-bottom: -2px;
vertical-align: baseline;
}
span {
@include font-size($font-size-base);
color: $o-violet;
}
}
@include media-breakpoint-up(xl) {
width: $o-side-nav-width;
}
@include media-breakpoint-up(lg) {
padding-left: 3rem;
margin-right: 3rem;
}
}
.o_search {
position: relative;
width: 90%;
max-width: 500px;
.btn{
@include o-position-absolute($top: 50%, $right: 1rem);
@include transform (translateY(-50%)) ;
padding: 0;
font-size: 1.2rem;
color: $gray;
}
}
.highlight-link {
margin-bottom: 0;
display: flex;
align-items: center;
a {
padding: 0 1rem;
@include font-size($font-size-secondary);
}
}
.o_languages {
width: 120px;
}
}
//------------------------------------------------------------------------------
// Left side nav toctree
//------------------------------------------------------------------------------
.o_side_nav {
width: $o-side-nav-width;
height: calc(100vh - #{$o-header-height});
overflow-y: auto;
position: fixed;
top:$o-header-height;
left:-100%;
@include media-breakpoint-up(lg) {
left:0;
}
@include o-transition($duration:.3s);
padding-top: 2rem;
padding-left: 3rem;
background-color: lighten($o-violet-dark, 70%) ;
z-index: 10;
@include font-size($font-size-secondary);
color: $o-violet-dark;
.toctree-l1 {
padding-top: .5rem;
padding-bottom: .5rem;
}
.toctree-l1 > ul {
padding-left: 1.5rem;
}
ul {
li.o_active_toc_entry{
&:not(.toctree-l1) > .o_toc_entry_wrapper {
i[class^="i-"]:not(.collapsed) {
@include transform(rotate(90deg));
}
}
> .o_toc_entry_wrapper {
i[class^="i-"]:not(.collapsed), a.reference {
font-weight: $fw_bold;
opacity: 1;
}
}
}
.o_deepest_active_toc_entry {
background-color: $gray-lightest;
}
> .toctree-l1 {
&[class*="o_menu_"] > .o_toc_entry_wrapper > i {
opacity: .75;
&:before {
@include inline-icomoon($i-doc-apps, 0 1rem 0 0);
color: $o-violet-dark;
margin-right: 0.5rem;
}
}
&.o_menu_applications > .o_toc_entry_wrapper > i:before{
content:'#{$i-doc-apps}';
}
&.o_menu_administration > .o_toc_entry_wrapper > i:before{
content:'#{$i-doc-admin}';
}
&.o_menu_developer > .o_toc_entry_wrapper > i:before{
content:'#{$i-doc-dev}';
}
&.o_menu_services > .o_toc_entry_wrapper > i:before{
content:'#{$i-doc-services}';
}
&.o_menu_contributing > .o_toc_entry_wrapper > i:before{
content:'#{$i-doc-contribute}';
}
}
}
scrollbar-width: thin;
scrollbar-color: $o-violet-darker transparent;
&::-webkit-scrollbar {
width: 5px;
}
&::-webkit-scrollbar-track {
background: $white;
}
&::-webkit-scrollbar-thumb {
background-color: $o-violet-darker ;
border-radius: 0;
}
}
.o_side_nav, .o_page_toc_nav {
ul { // all uls in toc
list-style: none;
padding-left: 1rem;
li {
padding-left: .2rem;
> a.reference {
padding-left: 1.2rem;
}
a {
display: inline-block;
padding: .5rem 0;
color: inherit;
opacity: .75;
&.current, &:hover {
opacity: 1;
}
}
&:not(.toctree-l1) {
.o_toc_entry_wrapper {
&:not(.o_page_toc_title) {
display: flex;
align-items: baseline;
}
> i[class^="i-"] {
display: inline-block;
margin-right: .2rem;
@include o-transition(rotate, .3s);
font-weight: $fw_bold;
color: inherit;
&[aria-expanded="true"] {
@include transform(rotate(90deg));
}
}
}
}
.o_active_toc_entry {
> a , > .o_toc_entry_wrapper a{
font-weight: $fw_bold;
opacity: 1;
}
}
}
}
> ul { //is first ul in toc
padding-left: 0;
}
}
//------------------------------------------------------------------------------
// On this page local toctree
//------------------------------------------------------------------------------
aside.o_page_toc {
display: none;
@include font-size($font-size-secondary);
@include media-breakpoint-up(lg) {
display: block;
position: -webkit-sticky;
position: sticky;
top: $o-header-height;
right: 0;
width: $o-on-page-width;
height: 100%;
max-height: calc(100vh - #{$o-header-height});
padding: 3rem 3rem 3rem 0;
overflow-y: auto;
}
h3 {
text-transform: uppercase;
font-weight: $fw_bold;
color: $gray-darker;
padding-left: .5rem;
margin-bottom: .5rem;
}
a {
font-weight: $fw_regular;
color: $gray-darkest;
}
.o_page_toc_title {
display:none;
+ ul {
padding-left: 0;
}
}
.o_active_toc_entry > a {
font-weight: $fw_bold;
}
}
//------------------------------------------------------------------------------
// Main page content
//------------------------------------------------------------------------------
#wrap {
margin-top: $o-header-height;
display: flex;
justify-content: space-between;
padding: 0 1rem;
@include media-breakpoint-up(lg) {
padding: 0;
code {
display: inline-block;
color: inherit;
background: $doc_code-bg;
padding: 0 .3rem;
margin: 0.1rem;
border: 1px solid $gray-light;
overflow-wrap: anywhere;
}
}
main {
position: relative;
padding-top: 3rem;
@include media-breakpoint-up(lg) {
left: $o-side-nav-width;
width: calc(100vw - #{$o-side-nav-width} - #{$o-on-page-width});
padding: 3rem;
}
&.index, &.doc-toc, &.has_code_col {
@include media-breakpoint-up(lg) {
width: calc(100vw - #{$o-side-nav-width} );
}
}
// Homepage
&.index {
h2[class*="o_title_"] {
color: $o-violet-dark;
font-weight: $fw_bold;
margin-bottom: 1rem;
&:before {
@include inline-icomoon($i-o-services , 0 1rem 0 0);
display: block;
@include font-size(50px);
margin: 0 auto 20px;
}
&.o_title_start:before {
content: '#{$i-o-services}';
}
&.o_title_install:before {
content: '#{$i-install}';
}
&.o_title_basic:before {
content: '#{$i-basics}';
}
&.o_title_tutorial:before {
content: '#{$i-elearning_1}';
}
&.o_title_advanced:before {
content: '#{$i-advanced}';
}
}
ul {
padding: 1rem;
> li {
position: relative;
padding-bottom: 1rem;
a {
display: block;
font-weight: $fw_bold;
padding-bottom: .5rem;
}
}
}
}
// "in between" pages (Applications / Contributing)
&.doc-toc {
.toctree-wrapper {
margin-top: 1.5rem;
> ul {
display: flex;
flex-wrap: wrap;
> li.toctree-l1 {
@include media-breakpoint-up(lg) {
width: 33.3%;
}
padding-bottom: 3rem;
padding-right: 3rem;
}
}
ul {
list-style: none;
padding-left:0;
}
}
.toctree-l1 > a {
display: block;
color: $gray-darker;
@include font-size($h2-font-size);
padding-bottom: .5rem;
border-bottom: 1px solid $gray-light;
margin-bottom: 1rem;
}
}
&.has_code_col {
article.doc-body {
padding-left: 1rem;
padding-right: 1rem;
> *{
max-width: 100%;
}
section {
position: relative;
display:block;
float: left;
width: 100%;
}
@include media-breakpoint-up(lg) {
width: 100%;
padding-right: 0;
&:before {
@include code-col();
}
.o_git_link {
top: .5rem;
right: calc(43% + 1rem);
}
section {
> * {
width: 54.633333%;
/* max-width: 600px; */
float: left;
clear: left;
}
> h1 {
max-width: calc(54% - 120px);
}
> h1, > h2, > h3, > h4, > h5, > h6 {
float: none;
clear: none;
}
.doc-aside {
width: 43%;
float: none;
clear: none;
margin-left: 57%;
padding: 1rem;
blockquote {
font-weight: $fw_semibold;
font-style: italic;
}
pre {
font-size: 12px;
}
}
.content-switcher {
.nav-tabs .nav-link.active {
background-color: #f8f8f8;
border-color: #dee2e6 #dee2e6 #f8f8f8;
font-weight: $fw_semibold;
}
.tab-content {
display:flex;
background: $doc_code-bg;
border: 1px $gray-300 solid;
border-top: 0;
div[class^="highlight"] {
border: 0;
margin: 0;
}
}
}
}
}
}
+ aside.o_page_toc{
display: none;
}
}
article.doc-body {
position: relative;
.o_git_link {
@include font-size($font-size-secondary);
@include o-position-absolute($top: calc(#{$o-header-height} + 1rem), $right: 1rem);
i {
margin-right: .2rem;
}
}
.command {
font-family: var(--bs-font-monospace);
}
.field-list {
@include font-size($font-size-secondary);
padding: .5rem;
border: 1px solid $gray-light;
ul {
list-style: none;
}
}
}
/* dt {
&:before {
@include scroll-padding()
}
} */
// Search items highlighted
dt:target, span.highlighted {
background-color: lighten($warning, 15%);
}
section {
// This fixes the scroll position // BUT creates issues when buttons or links from the previous section are behind it
// padding-top: $o-header-height;
// margin-top: -$o-header-height; */
// adding a :before works better;
&:before {
@include scroll-padding()
}
> h1 {
color: $o-violet-dark;
font-weight: $fw_bold;
max-width: calc(100% - 120px);
+ *:not(h2) {
margin-top: 1rem;
}
}
> h2 {
font-family: $font-family-serif;
color: $gray-darker;
margin-top: .5rem;
margin-bottom: 1.5rem;
padding-bottom: .3rem;
border-bottom: 1px solid $gray-light;
}
> h3 {
color: $gray-darkest;
font-weight: $fw_bold;
}
> h4, > h5, > h6 {
font-weight: $fw_semibold;
}
img:not([alt="green"]):not([alt="orange"]):not([alt="red"]) {
border: 1px solid $gray-lighter;
background: $white;
padding: .5rem;
}
img:not([alt="green"]):not([alt="orange"]):not([alt="red"]), iframe {
margin-bottom: 1rem;
}
p > img {
border: none;
padding: 0;
margin-bottom: 0;
}
.figure {
.caption, .caption-text {
font-weight: $fw_semibold;
color: $gray;
}
.caption, .caption-text, .legend, .legend p{
font-style: italic;
margin: 0 auto;
}
&:not([class^="col"]) .legend {
max-width: 60%;
}
}
a.headerlink {
text-decoration: none;
visibility: hidden !important;
&:after {
content: '#{$i-link}';
font-family: $icomoon-font-family !important;
@include font-size($font-size-base);
vertical-align: middle;
margin: 0 1rem 0 0;
visibility: hidden;
color: $gray-light;
opacity: 0;
@include o-transition(all, .1s)
}
}
h1, h2, h3, h4, h5, h6, dt, caption, p.caption, div.code-block-caption {
&:hover > a.headerlink:after{
// This makes permalinks only visible on hover.
visibility: visible;
opacity: 1;
}
}
}
}
div[class^="highlight"] {
// This styles the consoles like read-the-doc's consoles
overflow-x: auto;
border: 1px solid $gray-light;
margin: 1px 0 24px 0;
max-width: 90vw;
div[class^="highlight"] {
padding: 0px;
border: none;
margin: 0;
}
pre {
white-space: pre;
margin: 0;
padding: 1rem;
display: block;
overflow: auto;
}
}
// fixes on pages
.guilabel, .menuselection {
font-weight: $fw_semibold;
}
.dfn{
@include font-size($font-size-secondary);
line-height: 1;
color: $o-violet;
font-weight: $fw_semibold;
&:before {
content:'?';
display: inline-block;
width: 15px;
height: 15px;
background-color: $o-violet;
border: 1px solid $o-violet;
border-radius: 20px;
text-align: center;
color: $white;
font-weight: $fw_extrabold;
margin: 0 .2rem;
}
}
.pq-patch em {
display: block;
border-radius: 4px 4px 0 0;
background: $gray-lighter;
padding: .2rem 1rem;
@include font-size($font-size-secondary);
font-weight: 600;
}
.container .container:not([class^="col"]) {
padding: 0;
margin: 0;
}
ul, ol {
text-align: left;
}
// restyle numbers on lists
ol {
/* list-style: none;
counter-reset: a;
> li {
position: relative;
counter-increment: a;
&:before {
content: counter(a) '.';
font-weight: $fw_semibold;
@include o-position-absolute(auto, auto, auto, -1.8rem);
}
} */
ol {
list-style: lower-alpha;
> li:before {
content: none;
}
}
}
//------------------------------------------------------------------------------
// Alerts
//------------------------------------------------------------------------------
// alert-info
// alert-warning
// alert-danger
// alert-go_to
// alert-exercise
// alert-success // removed : never used in doc
.alert {
position: relative;
display: block;
border-radius: 0;
border-width: 0 0 0 3px;
@include font-size($font-size-secondary);
code {
background-color: $white !important;
}
> p , > ul{
margin-bottom: .5rem;
}
> *:last-child {
margin-bottom: 0;
}
> h3, > .alert-title {
line-height: 1em;
margin: 0 0 10px 0;
@include font-size($font-size-base);
font-weight: $fw_bold;
&:before {
@include inline-icomoon($i-info, 0 .2rem 0 0, baseline, $font-size-base, inherit);
@include media-breakpoint-down(md) {
display:none;
}
}
}
&.alert-info, &[class^="admonition"] {
border-color: tint-color($brand-info, 30%);
background-color: tint-color($brand-info, 85%);
color: shade-color($brand-info, 35%);
> .alert-title, > h3 {
color: $brand-info;
&:before {
content: '#{$i-info}';
}
}
}
&.alert-note {
border-color: shade-color($info, 30%);
background-color: $gray-lightest;
color: shade-color($info, 55%);
> .alert-title, > h3 {
color: shade-color($info, 45%);
&:before {
content: '#{$i-note}';
}
}
}
&.alert-tip, &.tip {
border-color: shade-color($color-alpha, 10%);
background-color: $gray-lightest;
color: shade-color($color-alpha, 55%);
> .alert-title, > h3 {
color: shade-color($color-alpha, 40%);
&:before {
content: '#{$i-lightbulb}';
@include font-size(1.2rem);
}
}
}
&.alert-warning, &.warning {
border-color: $brand-warning;
> .alert-title, > h3 {
color: shade-color($brand-warning, 10%);
&:before {
content: '#{$i-warning}';
}
}
}
&.alert-danger {
border-color: $danger;
> .alert-title, > h3 {
color: darken($brand-danger,20%);
&:before {
content: '#{$i-danger}';
}
}
}
&.alert-exercise {
border-color: tint-color($doc_exercise, 30%);
background-color: tint-color($doc_exercise, 80%);
color: shade-color($doc_exercise, 35%);
> .alert-title, > h3 {
color: shade-color($doc_exercise, 35%);
}
> .alert-title:before, > h3:before {
content: '#{$i-exercise}';
}
}
&.alert-go_to {
display: inline-block;
border-color: $o-violet;
background-color: $gray-lightest;
width: calc(50% - 1rem);
a {
color: $o-violet-dark;
}
> .alert-title, > h3 {
color: $o-violet-dark;
}
> .alert-title:before, > h3:before {
content: '#{$i-arrow-right}';
}
}
}
}
}
//------------------------------------------------------------------------------
// Footer
//------------------------------------------------------------------------------
footer {
> div {
padding: 3rem;
@include media-breakpoint-up(lg) {
padding-left: calc(#{$o-side-nav-width} + 3rem)
}
}
.o_get_help {
background: $gray-100;
h5 {
color: $secondary;
font-size: 20px;
font-weight: $fw_bold;
margin-bottom: 1.5rem;
}
}
}