Skip to content

Commit 118d33f

Browse files
authored
feat(grid): update border related properties of the grid (#584)
1 parent 20fa5a0 commit 118d33f

6 files changed

Lines changed: 35 additions & 17 deletions

File tree

packages/theming/sass/themes/components/grid/_grid-summary-theme.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,18 @@
7878
$result-color: adaptive-contrast(var(--background-color));
7979
}
8080

81+
@if not($border-color) and $background-color and $result-color {
82+
$border-color: hsl(from color-mix(in srgb, var(--result-color) 16%, var(--background-color)) h s l / 0.38);
83+
}
84+
8185
@if not($border-color) and $background-color {
8286
$border-color: hsl(from adaptive-contrast(var(--background-color)) h s l / 0.2);
8387
}
8488

89+
@if not($pinned-border-color) and $background-color and $result-color {
90+
$pinned-border-color: color-mix(in srgb, var(--result-color) 20%, var(--background-color));
91+
}
92+
8593
@if not($pinned-border-color) and $background-color {
8694
$pinned-border-color: hsl(from adaptive-contrast(var(--background-color)) h s l / 0.26);
8795
}

packages/theming/sass/themes/components/grid/_grid-theme.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,7 @@
331331
}
332332

333333
@if not($header-border-color) and $header-text-color and $header-background {
334-
$header-border-color: hsl(
335-
from color-mix(in srgb, var(--header-text-color) 20%, var(--header-background)) h s l / 0.38
336-
);
334+
$header-border-color: color-mix(in srgb, var(--header-text-color) 20%, var(--header-background));
337335
}
338336

339337
@if not($sorted-header-icon-color) and $accent-color {

packages/theming/sass/themes/components/grid/_grid-toolbar-theme.scss

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,24 @@
9090
$item-text-color: var(--foreground);
9191
}
9292

93-
@if not($item-hover-background) and $background and $accent-color {
94-
$item-hover-background: color-mix(in srgb, var(--accent-color) 8%, var(--background));
93+
@if not($item-hover-background) and $dropdown-background and $accent-color {
94+
$item-hover-background: color-mix(in srgb, var(--accent-color) 8%, var(--dropdown-background));
95+
}
96+
97+
@if not($item-hover-background) and $dropdown-background {
98+
$item-hover-background: dynamic-shade(var(--dropdown-background));
9599
}
96100

97101
@if not($item-hover-text-color) and $item-text-color {
98102
$item-hover-text-color: var(--item-text-color);
99103
}
100104

101-
@if not($item-focus-background) and $background and $accent-color {
102-
$item-focus-background: color-mix(in srgb, var(--accent-color) 12%, var(--background));
105+
@if not($item-focus-background) and $dropdown-background and $accent-color {
106+
$item-focus-background: color-mix(in srgb, var(--accent-color) 12%, var(--dropdown-background));
107+
}
108+
109+
@if not($item-focus-background) and $dropdown-background {
110+
$item-focus-background: dynamic-shade(var(--dropdown-background), $offset: 8);
103111
}
104112

105113
@if not($item-focus-text-color) and $item-text-color {
@@ -110,10 +118,6 @@
110118
$border-color: color-mix(in srgb, var(--foreground) 20%, var(--background));
111119
}
112120

113-
@if not($title-text-color) and $background {
114-
$title-text-color: adaptive-contrast(var(--background));
115-
}
116-
117121
@if not($item-text-color) and $dropdown-background {
118122
$item-text-color: adaptive-contrast(var(--dropdown-background));
119123
}

packages/theming/sass/themes/schemas/components/dark/_grid-summary.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ $dark-material-grid-summary: extend(
6060
/// Generates a dark fluent grid-summary schema.
6161
/// @type Map
6262
/// @prop {Map} label-color [color: ('primary', 300)] - The summaries label color.
63+
/// @prop {Map} pinned-border-color [color: ('gray', 300, .24)] - The color of the pinned border.
6364
/// @requires $fluent-grid-summary
6465
$dark-fluent-grid-summary: extend(
6566
$fluent-grid-summary,
@@ -71,6 +72,14 @@ $dark-fluent-grid-summary: extend(
7172
300,
7273
),
7374
),
75+
76+
pinned-border-color: (
77+
color: (
78+
'gray',
79+
300,
80+
0.24,
81+
),
82+
),
7483
)
7584
);
7685

packages/theming/sass/themes/schemas/components/dark/_grid.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// @type Map
1212
/// @prop {Color} content-background [color: 'surface'] - The table body background color.
1313
/// @prop {Map} drop-area-background [color: ('gray', 100, .4)] - The drop area background color.
14-
/// @prop {Map} header-border-color [color: ('gray', 200, .24)] - The color used for header borders.
14+
/// @prop {Map} header-border-color [color: ('gray', 200)] - The color used for header borders.
1515
/// @prop {Map} header-background [color: ('gray', 100)] - The table header background color.
1616
/// @prop {Map} header-selected-background [color: ('secondary', 600)] - The table header background color when selected (ex. column selection).
1717
/// @prop {Map} header-selected-text-color [contrast-color: ('secondary', 600)] - The table header text color when selected (ex. column selection).
@@ -51,7 +51,6 @@ $base-dark-grid: (
5151
color: (
5252
'gray',
5353
200,
54-
0.24,
5554
),
5655
),
5756

@@ -275,6 +274,7 @@ $dark-material-grid: extend(
275274
/// @prop {Map} row-selected-hover-background [color: ('gray', 200)] - The selected row background color on hover.
276275
/// @prop {Map} body-column-selected-border-color [color: ('gray', 100)] - The border color used for the body column when in group-row state.
277276
/// @prop {Map} body-column-hover-selected-border-color [color: ('gray', 200)] - The border color used for the body column when in group-row + hover state.
277+
/// @prop {Map} pinned-border-color [color: ('gray', 300, .24)] - The color of the pinned border.
278278
/// @prop {Map} row-selected-hover-text-color [contrast-color: ('gray', 200)] - The selected row hover text color.
279279
/// @prop {Map} cell-selected-within-background [color: ('gray', 200)] - The background of the selected cell inside a selected row/column.
280280
/// @prop {Map} cell-selected-within-text-color [contrast-color: ('gray', 200)] - The color of the selected cell inside a selected row/column.

packages/theming/sass/themes/schemas/components/light/_grid.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/// @prop {Map} sortable-header-icon-hover-color [color: ('secondary', 500)] - The icon color on hover in grid header when the column is sortable.
1717
/// @prop {Number} header-border-width [1px] - The border width used for header borders.
1818
/// @prop {String} header-border-style [solid] - The border style used for header borders.
19-
/// @prop {Map} header-border-color [color: ('gray', 400, .38)] - The color used for header borders.
19+
/// @prop {Map} header-border-color [color: ('gray', 400)] - The color used for header borders.
2020
/// @prop {Map} ghost-header-text-color [color: ('gray', 700)] - The dragged header text color.
2121
/// @prop {Map} ghost-header-icon-color [color: ('gray', 600)] - The dragged header icon color.
2222
/// @prop {Map} ghost-header-background [color: ('gray', 50)] - The dragged header background color.
@@ -176,7 +176,6 @@ $light-grid: extend(
176176
color: (
177177
'gray',
178178
400,
179-
0.38,
180179
),
181180
),
182181

@@ -839,7 +838,7 @@ $material-grid: extend(
839838
/// @prop {Map} header-text-color [color: ('gray', 800)] - The table header text color.
840839
/// @prop {Map} header-selected-background [color: ('gray', 200)] - The table header background color when selected (ex. column selection).
841840
/// @prop {Map} header-selected-text-color [contrast-color: ('gray', 200)] - The table header text color when selected (ex. column selection).
842-
/// @prop {Map} header-border-color [color: ('gray', 100)] - The color used for header borders.
841+
/// @prop {Map} header-border-color [color: ('gray', 300)] - The color used for header borders.
843842
/// @prop {Map} row-selected-background [color: ('gray', 200)] - The selected row background color.
844843
/// @prop {Map} row-selected-hover-background [color: ('gray', 300)] - The selected row hover background.
845844
/// @prop {Map} body-column-selected-border-color [color: ('gray', 200)] - The border color used for the body column when in group-row state.
@@ -901,7 +900,7 @@ $fluent-grid: extend(
901900
header-border-color: (
902901
color: (
903902
'gray',
904-
100,
903+
300,
905904
),
906905
),
907906

0 commit comments

Comments
 (0)