Files
design-themes/theme_nano/static/src/scss/bootstrap_overridden.scss
T
qsm-odoo c95aa445fa [IMP] theme_*: ease defining only one font family to use in a theme
Before this commit, if a theme wanted to define a main font for their
theme and let the "headings", "navbar" and "buttons" ones use the same
they had to add this in their map:

```
'font': XXX,
'headings-font': null,
'navbar-font': null,
'button-font': null,
```

Indeed, without setting the "null" values, those font would use YYY
which is the first font defined in the theme config, which might be
different from XXX. And if forcing XXX 4 times, like most themes do at
the moment, if the user wanted to change them all, he had to change the
4 ones instead of the main one.

Now, only the 'font' value use the first font defined in the theme
config if not explicitly set. So forcing the null values is not
necessary, it will be the default behavior.
The advantage is thus also functional, as most theme forced all their 4
fonts so changing the main one did not change the others.

task-2993054

closes odoo/design-themes#593

X-original-commit: fc64bce81e
Related: odoo/odoo#101068
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-09-26 11:36:44 +02:00

94 lines
3.4 KiB
SCSS

//------------------------------------------------------------------------------//
// TODO ideally this should be done in primary variables if it was possible.
//------------------------------------------------------------------------------//
// Headings
@if nth($o-theme-headings-font, 1) == 'Roboto' {
$o-theme-headings-font-weight: 500;
}
@if nth($o-theme-headings-font, 1) == 'Dosis' {
$o-theme-headings-font-weight: 400;
}
@else if nth($o-theme-headings-font, 1) == 'Lato' {
$o-theme-headings-font-weight: 300;
}
@else if nth($o-theme-headings-font, 1) == 'Advent Pro' {
$o-theme-headings-font-weight: 600;
}
// Body
@if o-website-value('font') == 'Roboto' {
$o-theme-font-weight-bold: 500;
}
@if o-website-value('font') == 'Dosis' {
$o-theme-font-weight-bold: 500;
}
@else if o-website-value('font') == 'Lato' {
$o-theme-font-weight-light: 300;
$o-theme-font-weight-bold: 600;
}
@else if o-website-value('font') == 'Advent Pro' {
$o-theme-font-weight-bold: 600;
}
@else if o-website-value('font') == 'Oswald' {
$o-theme-font-weight-light: 200;
$o-theme-font-weight-normal: 300;
$o-theme-font-weight-bold: 400;
}
@else if o-website-value('font') == 'Open Sans' {
$o-theme-font-weight-bold: 600;
}
@else if o-website-value('font') == 'Montserrat Alternates' {
$o-theme-font-weight-bold: 600;
}
// Buttons
@if nth($o-theme-buttons-font, 1) == 'Roboto' {
$o-theme-btn-font-weight: 500;
}
@else if nth($o-theme-buttons-font, 1) == 'Advent Pro' {
$o-theme-btn-font-weight: 600;
}
@else if nth($o-theme-buttons-font, 1) == 'Oswald' {
$o-theme-btn-font-weight: 200;
}
@else if nth($o-theme-buttons-font, 1) == 'Open Sans' {
$o-theme-btn-font-weight: 600;
}
@else if nth($o-theme-buttons-font, 1) == 'Montserrat Alternates' {
$o-theme-btn-font-weight: 600;
}
//------------------------------------------------------------------------------//
// Bootstrap
//------------------------------------------------------------------------------//
// Typography
//
// Font, line-height, and color for body text, headings, and more.
$font-size-lg: o-website-value('font-size-base') * $o-theme-font-size-lg-multiplier !default;
$font-size-sm: o-website-value('font-size-base') * $o-theme-font-size-sm-multiplier !default;
$font-weight-light: $o-theme-font-weight-light !default;
$font-weight-normal: $o-theme-font-weight-normal !default;
$font-weight-bold: $o-theme-font-weight-bold !default;
$headings-font-weight: $o-theme-headings-font-weight !default;
// Buttons + Forms
//
// Shared variables that are reassigned to `$input-` and `$btn-` specific variables.
$input-btn-focus-width: 0 !default;
$input-focus-border-color: o-color('primary') !default;
$btn-font-weight: 400 !default;
$btn-box-shadow: none !default;
$input-color: o-color('o-cc1-text') !default;
$input-placeholder-color: o-color('500') !default;
// Cards
$card-border-width: 0 !default;