[REF] web: cleanup legacy utils.scss

This commit does the following:
- remove the unused o-swap() SCSS function
- remove the unused mixin o-kanban-header-title and its related variable
- inline kanban specific mixins used only once (o-kanban-tag-color,
  o-kanban-dropdown, o-kanban-dropdown-open)

task-3439226

Part-of: odoo/odoo#132787
This commit is contained in:
Pierre Paridans
2023-08-23 14:43:49 +02:00
parent 2a59dd285e
commit f7de71f696
3 changed files with 14 additions and 37 deletions
@@ -223,13 +223,6 @@
@return $-map;
}
// Function to swap two values in a list
@function o-swap($list, $i, $j) {
$tmp: nth($list, $i);
$list: set-nth($list, $i, nth($list, $j));
@return set-nth($list, $j, $tmp);
}
// Function to get an element of a list with a default value in case the index
// is out-of-bounds; also return that value if the retrieved value is null.
@function o-safe-nth($list, $index, $default: null) {
@@ -245,15 +238,6 @@
}
// ------- Kanban grouped mixins -------
@mixin o-kanban-tag-color {
@for $size from 1 through length($o-colors) {
// Note: the first color is supposed to be invisible if there is a color
// field but it is used as a default color when there is no color field
&.o_tag_color_#{$size - 1} span {
background-color: nth($o-colors, $size);
}
}
}
@mixin o-kanban-record-color {
@for $size from 2 through length($o-colors) {
// Note: the first color is not defined as it is the 'no color' for kanban
@@ -265,13 +249,6 @@
}
}
}
@mixin o-kanban-header-title {
display: flex;
align-items: center;
height: $o-kanban-header-title-height;
line-height: 2.2;
color: $headings-color;
}
// ------- Kanban records mixins -------
@mixin o-kanban-record-title($font-size: $h5-font-size) {
@@ -281,16 +258,6 @@
margin-bottom: 0;
margin-top: 0;
}
@mixin o-kanban-dropdown($padding-base: $o-kanban-inside-vgutter) {
margin: 1px 1px 0 0;
padding: if(type-of($padding-base) == 'string', calc(#{$padding-base}/2) $padding-base, $padding-base/2 $padding-base);
vertical-align: top;
@include o-hover-text-color($body-color, $headings-color);
}
@mixin o-kanban-dropdown-open {
position: relative;
z-index: $zindex-dropdown + 1;
}
@mixin o-kanban-colorpicker {
max-width: 150px;
padding: 3px ($o-dropdown-hpadding - $o-kanban-inner-hmargin) 3px $o-dropdown-hpadding;
@@ -1,7 +1,6 @@
$o-kanban-background: $o-gray-100 !default;
$o-kanban-default-record-width: 320px !default;
$o-kanban-small-record-width: 300px !default;
$o-kanban-header-title-height: 50px !default;
$o-kanban-image-width: 64px !default;
$o-kanban-image-fill-width: 95px !default;
$o-kanban-inside-vgutter: $o-spacer * 0.5 !default;
@@ -298,10 +298,15 @@
}
.dropdown-toggle {
@include o-kanban-dropdown(var(--KanbanRecord-padding-h));
$padding-base: var(--KanbanRecord-padding-h);
margin: 1px 1px 0 0;
padding: if(type-of($padding-base) == 'string', calc(#{$padding-base}/2) $padding-base, $padding-base/2 $padding-base);
vertical-align: top;
@include o-hover-text-color($body-color, $headings-color);
}
&.show .dropdown-toggle {
@include o-kanban-dropdown-open;
position: relative;
z-index: $zindex-dropdown + 1;
}
.dropdown-menu {
margin-top: -1px;
@@ -336,7 +341,13 @@
.o_tag {
--Tag-max-width: MAX(200px, 100%);
--Tag-font-size: #{$o-font-size-base-smaller};
@include o-kanban-tag-color;
@for $size from 1 through length($o-colors) {
// Note: the first color is supposed to be invisible if there is a color
// field but it is used as a default color when there is no color field
&.o_tag_color_#{$size - 1} span {
background-color: nth($o-colors, $size);
}
}
}
}