Skip to content

Commit 5febc6d

Browse files
didimmovasimeonoff
andauthored
feat(grid): add initial logic for grid theme builder (#548)
* feat(grid): add initial logic for grid theme builder * feat(grid): fix text properties of row * feat(grid/chip): fix grid header text-color and use provided text-color for chip in all states * feat(themes): add latest property conditions * feat(themes): add new grid properties and new conditions to input/scrollabr/select * feat(themes): add additional conditions for dropdown/input/grid themes * feat(checkbox): create new filled-disabled property and new conditions for themes * feat(input): set condition for disabled bottom line color * feat(grid): add filtering-dialog-background property * chore(checkbox): revert changing checkbox schema in this PR * chore(checkbox): revert checkbox updates (moved to another PR) * chore(grid): delete old conditional logic for grid theme * chore(grid): revert removing old conditions * fix(button-group): add condition for disabled-selected-icon-color * fix(grid): rows using the same color --------- Co-authored-by: Simeon Simeonoff <sim.simeonoff@gmail.com>
1 parent cd97739 commit 5febc6d

9 files changed

Lines changed: 645 additions & 4 deletions

File tree

sass/themes/components/button-group/_button-group-theme.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,18 @@
128128
$theme: digest-schema($button-group-schema);
129129
$border: rem(1px, 16px) solid map.get($theme, 'item-selected-border-color');
130130

131+
@if not($item-hover-text-color) and $item-text-color {
132+
$item-hover-text-color: dynamic-shade(var(--item-text-color));
133+
}
134+
135+
@if not($item-selected-hover-text-color) and $item-selected-text-color {
136+
$item-selected-hover-text-color: dynamic-shade(var(--item-selected-text-color));
137+
}
138+
139+
@if not($disabled-text-color) and $item-text-color {
140+
$disabled-text-color: hsl(from var(--item-text-color) h s l / 0.6);
141+
}
142+
131143
// background colors
132144
@if not($item-hover-background) and $item-background {
133145
$item-hover-background: dynamic-shade(var(--item-background));
@@ -239,6 +251,10 @@
239251
$disabled-selected-text-color: var(--disabled-text-color);
240252
}
241253

254+
@if not($disabled-selected-icon-color) and $disabled-selected-text-color {
255+
$disabled-selected-icon-color: var(--disabled-selected-text-color);
256+
}
257+
242258
@if not($idle-shadow-color) and $item-background {
243259
$idle-shadow-color: hsl(from var(--item-background) h s l / 0.5);
244260
}

sass/themes/components/chip/_chip-theme.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,30 @@
118118
$theme: digest-schema($chip-schema);
119119
$variant: map.get($theme, '_meta', 'theme');
120120

121+
// have unified text-color for all states if text-color is provided
122+
123+
@if not($hover-text-color) and $text-color {
124+
$hover-text-color: var(--text-color);
125+
}
126+
127+
@if not($focus-text-color) and $text-color {
128+
$focus-text-color: var(--text-color);
129+
}
130+
131+
@if not($selected-text-color) and $text-color {
132+
$selected-text-color: var(--text-color);
133+
}
134+
135+
@if not($hover-selected-text-color) and $selected-text-color {
136+
$hover-selected-text-color: var(--selected-text-color);
137+
}
138+
139+
@if not($focus-selected-text-color) and $selected-text-color {
140+
$focus-selected-text-color: var(--selected-text-color);
141+
}
142+
143+
// rest of the styles are derived from background
144+
121145
@if not($text-color) and $background {
122146
$text-color: adaptive-contrast(var(--background));
123147
}

sass/themes/components/drop-down/_drop-down-theme.scss

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,28 @@
103103
$theme: digest-schema($drop-down-schema);
104104
$variant: map.get($theme, '_meta', 'theme');
105105

106+
@if $item-text-color {
107+
@if not($focused-item-text-color) {
108+
$focused-item-text-color: var(--item-text-color);
109+
}
110+
111+
@if not($selected-item-text-color) {
112+
$selected-item-text-color: var(--item-text-color);
113+
}
114+
115+
@if not($selected-hover-item-text-color) {
116+
$selected-hover-item-text-color: var(--item-text-color);
117+
}
118+
119+
@if not($selected-focus-item-text-color) {
120+
$selected-focus-item-text-color: var(--item-text-color);
121+
}
122+
123+
@if not($disabled-item-text-color) {
124+
$disabled-item-text-color: hsl(from var(--item-text-color) h s l / 0.4);
125+
}
126+
}
127+
106128
@if not($item-text-color) and $background-color {
107129
$item-text-color: adaptive-contrast(var(--background-color));
108130
}
@@ -163,10 +185,6 @@
163185
$selected-focus-item-text-color: adaptive-contrast(var(--selected-focus-item-background));
164186
}
165187

166-
@if not($selected-focus-item-text-color) and $selected-focus-item-background {
167-
$selected-focus-item-text-color: adaptive-contrast(var(--selected-focus-item-background));
168-
}
169-
170188
@if $variant == 'indigo' {
171189
@if not($focused-item-border-color) and $selected-item-background {
172190
$focused-item-border-color: var(--selected-item-background);

0 commit comments

Comments
 (0)