Skip to content

Commit

Permalink
[IMP] web: increase base font-size to 14px
Browse files Browse the repository at this point in the history
task-2818586
task-3280695

Part-of: odoo#116641
  • Loading branch information
stefanorigano authored and pparidans committed May 12, 2023
1 parent 6b8daa8 commit 2b32d14
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 8 deletions.
1 change: 1 addition & 0 deletions addons/web/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@
'web._assets_helpers': [
'web/static/lib/bootstrap/scss/_functions.scss',
'web/static/lib/bootstrap/scss/_mixins.scss',
'web/static/src/scss/functions.scss',
'web/static/src/scss/mixins_forwardport.scss',
'web/static/src/scss/bs_mixins_overrides.scss',
'web/static/src/legacy/scss/utils.scss',
Expand Down
Binary file modified addons/web/static/lib/odoo_ui_icons/fonts/odoo_ui_icons.woff
Binary file not shown.
Binary file modified addons/web/static/lib/odoo_ui_icons/fonts/odoo_ui_icons.woff2
Binary file not shown.
1 change: 1 addition & 0 deletions addons/web/static/lib/odoo_ui_icons/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@
.oi-text-wrap:before { content: '\e815'; }
.oi-view-cohort:before { content: '\e816'; }
.oi-view-list:before { content: '\e817'; }
.oi-gif-picker:before { content: '\e82e'; }
2 changes: 1 addition & 1 deletion addons/web/static/src/legacy/scss/utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
}

// ------- Kanban records mixins -------
@mixin o-kanban-record-title($font-size) {
@mixin o-kanban-record-title($font-size: 1em) {
color: $headings-color;
font-size: $font-size;
font-weight: 500;
Expand Down
3 changes: 3 additions & 0 deletions addons/web/static/src/scss/bootstrap_overridden.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ $font-weight-bolder: 700 !default;
$font-family-sans-serif: $o-font-family-sans-serif !default;

$font-size-base: $o-font-size-base !default;
$font-size-sm: $o-font-size-base-small !default;
$small-font-size: $font-size-sm !default;

$line-height-base: $o-line-height-base !default;

$h1-font-size: $font-size-base * 2.0 !default;
Expand Down
32 changes: 32 additions & 0 deletions addons/web/static/src/scss/functions.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
///============================================================================
/// Odoo SCSS Functions
///
/// Regroup functions that can be used at any stage of the compilation process.
///============================================================================


/// Remove the unit of a length
/// ---------------------------------------------------------------------------
/// @param {Number} $-value
/// Number to remove unit from
/// @return {$-value}
/// Unitless number
@function o-strip-unit($-value) {
@if type-of($-value) == 'number' and not unitless($-value) {
@return $-value / ($-value * 0 + 1);
}

@return $-value;
}

/// Converts px to rem.
/// ---------------------------------------------------------------------------
/// @param {number or px value} $-px-value
/// The value to convert.
/// @param {number or px value } $-base
/// The base font-size
/// @return {number}
/// `$-px-value` converted in rem units
@function o-to-rem($-px-value, $-base: 16) {
@return (o-strip-unit($-px-value) / o-strip-unit($-base)) * 1rem;
}
8 changes: 5 additions & 3 deletions addons/web/static/src/scss/primary_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
$o-webclient-color-scheme: bright !default;

// Font sizes
$o-root-font-size: 12px !default;
$o-font-size-base: 13rem * (1px / $o-root-font-size) !default;
$o-font-size-base-touch: 15px !default;
$o-root-font-size: 1rem !default;
$o-font-size-base: o-to-rem(14px) !default;
$o-font-size-base-touch: o-to-rem(16px) !default;
$o-font-size-base-small: o-to-rem(13px) !default;
$o-font-size-base-smaller: o-to-rem(12px) !default;
$o-line-height-base: 1.5 !default; // This is BS default

// Global sans-serif fonts stack, defined here as we need to process
Expand Down
5 changes: 5 additions & 0 deletions addons/web/static/src/scss/utilities_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,8 @@ $utilities: map-merge(
}
}
}

// Define a smaller font-size
.smaller {
font-size: $o-font-size-base-smaller;
}
2 changes: 1 addition & 1 deletion addons/web/static/src/views/kanban/kanban_controller.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
}

.o_kanban_record_title {
@include o-kanban-record-title($font-size: 13px);
@include o-kanban-record-title();
overflow-wrap: break-word;
word-wrap: break-word;
}
Expand Down
2 changes: 1 addition & 1 deletion addons/web/static/src/views/list/list_renderer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
}

.o_list_record_selector {
width: 40px;
width: 40px !important; // Force to 40px regardless by the font-size
}

.o_list_record_remove, .o_handle_cell {
Expand Down
4 changes: 2 additions & 2 deletions addons/website/static/src/scss/website.ui.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $-mini-nav-size: 40px;
.o_frontend_to_backend_nav {
@include o-position-absolute(0, auto, auto, 0);
z-index: $zindex-modal;
font-size: $o-font-size-base * ($o-root-font-size / 16px);
font-size: $o-font-size-base;

&::before {
content: "";
Expand Down Expand Up @@ -40,7 +40,7 @@ $-mini-nav-size: 40px;
}

.o_frontend_to_backend_apps_menu {
font-size: $o-font-size-base * ($o-root-font-size / 14px);
font-size: $o-font-size-base;
max-height: 70vh;
overflow: auto;
}
Expand Down

0 comments on commit 2b32d14

Please sign in to comment.