Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified extensions/odoo_theme/static/fonts/icomoon.eot
Binary file not shown.
2 changes: 1 addition & 1 deletion extensions/odoo_theme/static/fonts/icomoon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extensions/odoo_theme/static/fonts/icomoon.ttf
Binary file not shown.
Binary file modified extensions/odoo_theme/static/fonts/icomoon.woff
Binary file not shown.
Binary file modified extensions/odoo_theme/static/fonts/icomoon.woff2
Binary file not shown.
20 changes: 19 additions & 1 deletion extensions/odoo_theme/static/js/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,25 @@
// Make all external links open in a new tab by default.
content.querySelectorAll('a.external').forEach(externalLink => {
externalLink.setAttribute('target', '_blank');
})
});

let canAccessAllL1Toctrees = true; // Whether all direct children have a ref.
const toctreeWrapper = document.querySelector('.toctree-wrapper');
toctreeWrapper?.querySelectorAll('.toctree-l1').forEach(l1Toctree => {
// Flag L2 toctrees that have L3 children.
if (l1Toctree.querySelector('.toctree-l3')) {
l1Toctree.querySelectorAll('.toctree-l2').forEach (l2Toctree => {
l2Toctree.classList.add('o_toc_contains_l3');
});
}
if (l1Toctree.querySelector('a').getAttribute('href') === '#') {
canAccessAllL1Toctrees = false;
}
});
if (canAccessAllL1Toctrees) {
// Use the style of L2 toctrees on L1 toctrees.
toctreeWrapper?.classList.add('o_toc_l1_to_l2');
}
});

})();
2 changes: 1 addition & 1 deletion extensions/odoo_theme/static/scss/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ b, strong{
}

a {
font-weight: $font-weight-bold;
font-weight: var(--o-link-fontweight, #{$font-weight-bold});
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ $h6-font-size: $font-size-base !default;
$font-weight-lighter: 200;
$font-weight-light: 300;
$font-weight-normal: 400;
$font-weight-medium: 500;
$font-weight-bold: 600;
$font-weight-bolder: 700;

Expand Down
4 changes: 2 additions & 2 deletions extensions/odoo_theme/static/scss/bootstrap_scss/_reboot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ sup { top: -.5em; }
// Links

a {
color: $link-color;
color: var(--o-link-color, #{$link-color});
text-decoration: $link-decoration;

&:hover {
color: $link-hover-color;
color: var(--o-link-hover-color, #{$link-hover-color});
text-decoration: $link-hover-decoration;
}
}
Expand Down
46 changes: 32 additions & 14 deletions extensions/odoo_theme/static/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -585,28 +585,42 @@ main.container-fluid {
}

.toctree-wrapper {
%toctree-custom-link {
> a:not([href="#"]){
--o-link-color: #{$o-gray-color};
--o-link-hover-color: #{$primary};

&:after {
content: ' #{$i-link}';
@include o-inline-icon(auto, baseline, 0.7em, $font-weight-bold);
color: $primary;
}
}
}

> ul, .toctree-l1 > ul {
padding-left: 0;
list-style: none;
}

.toctree-l1 > a {
display: block;
margin-top: $o-padding-m;
margin-bottom: $o-margin-s;
padding-bottom: $o-padding-xs;
border-bottom: 1px solid $o-gray-border;
@include font-size($h2-font-size);
font-weight: 600;
}

.toctree-l1 {
&:not(.o_toc_l1_to_l2) .toctree-l1 {
@extend %toctree-custom-link;
margin-bottom: 2rem;

> a {
display: block;
margin-top: $o-padding-m;
margin-bottom: $o-margin-s;
padding-bottom: $o-padding-xs;
border-bottom: 1px solid $o-gray-border;
@include font-size($h2-font-size);
font-weight: $font-weight-bolder;
}
}

.toctree-l2 > a[href="#"] {
margin-top: 0.7rem;
display: inline-block;
.toctree-l2.o_toc_contains_l3 {
margin-top: map-get($spacers, 3);
@extend %toctree-custom-link;
}

a[href="#"] {
Expand All @@ -615,6 +629,10 @@ main.container-fluid {
pointer-events: none;
cursor: default;
}

.toctree-l3 > a {
--o-link-fontweight: #{$font-weight-medium};
}
}

article.doc-body {
Expand Down