|
37 | 37 | /// @param {Color} $row-selected-background [null] - The selected row background color.
|
38 | 38 | /// @param {Color} $row-selected-hover-background [null] - The selected row hover background color.
|
39 | 39 | /// @param {Color} $row-selected-text-color [null] - The selected row text color.
|
| 40 | +/// @param {Color} $row-selected-hover-text-color [null] - The selected row hover text color. |
40 | 41 | /// @param {Color} $row-hover-background [null] - The hover row background color.
|
41 | 42 | /// @param {Color} $row-hover-text-color [null] - The hover row text color.
|
42 | 43 | /// @param {Color} $row-border-color [null] - The row bottom border color.
|
|
52 | 53 | /// @param {Color} $cell-edited-value-color [null] - The text color of a cell that has been edited.
|
53 | 54 | /// @param {Color} $cell-new-color [null] - The text color of a new, unedited cell. Used when adding new row in a grid.
|
54 | 55 | /// @param {Color} $cell-disabled-color [null] - The text color of a disabled cell.
|
| 56 | +/// @param {Color} $cell-selected-within-background [null] - The background of the selected cell inside a selected row/column. |
| 57 | +/// @param {Color} $cell-selected-within-text-color [null] - The color of the selected cell inside a selected row/column. |
55 | 58 | ///
|
56 | 59 | /// @param {Color} $edit-mode-color [null] - The color applied around the row when in editing mode.
|
57 | 60 | /// @param {Color} $edited-row-indicator [null] - The color applied to the edited row indicator line.
|
|
108 | 111 | /// @param {color} $row-drag-color [null] - The row drag handle color.
|
109 | 112 | /// @param {Color} $grid-border-color [null] - The color of the grid border.
|
110 | 113 | /// @param {border-radius} $drop-area-border-radius [null] - The border radius used for column drop area.
|
111 |
| -/// |
112 | 114 | /// @requires $default-palette
|
113 | 115 | /// @requires $light-schema
|
114 | 116 | /// @requires apply-palette
|
|
149 | 151 | $row-selected-background: null,
|
150 | 152 | $row-selected-hover-background: null,
|
151 | 153 | $row-selected-text-color: null,
|
| 154 | + $row-selected-hover-text-color: null, |
152 | 155 | $row-hover-background: null,
|
153 | 156 | $row-hover-text-color: null,
|
154 | 157 | $row-border-color: null,
|
|
220 | 223 | $drop-area-border-radius: null,
|
221 | 224 | $grid-border-color: null,
|
222 | 225 | $sortable-header-icon-hover-color: null,
|
| 226 | +
|
| 227 | + $cell-selected-within-background: null, |
| 228 | + $cell-selected-within-text-color: null, |
223 | 229 | ) {
|
224 | 230 | $name: 'igx-grid';
|
225 | 231 | $grid-schema: ();
|
|
236 | 242 | if($drop-area-border-radius, $drop-area-border-radius, map-get($grid-schema, 'drop-area-border-radius')), 0, 16px
|
237 | 243 | );
|
238 | 244 |
|
239 |
| - |
240 | 245 | $tree-selected-filtered-row-text-color: rgba(text-contrast(map-get($theme, 'row-selected-background')), .5);
|
241 | 246 | $tree-selected-filtered-cell-text-color: rgba(text-contrast(map-get($theme, 'cell-selected-background')), .5);
|
242 | 247 |
|
243 |
| - $rs-bg: if( |
244 |
| - $row-selected-background, |
245 |
| - $row-selected-background, |
246 |
| - igx-color-from-var( |
247 |
| - map-get($theme, 'row-selected-background'), $palette |
248 |
| - ) |
249 |
| - ); |
250 |
| - |
251 |
| - $row-selected-cell-background: null; |
252 |
| - |
253 |
| - @if type-of($rs-bg) == 'color' { |
254 |
| - @if luminance($rs-bg) < .5 { |
255 |
| - $row-selected-cell-background: lighten-color($rs-bg, 8%); |
256 |
| - } @else { |
257 |
| - $row-selected-cell-background: darken-color($rs-bg, 8%); |
258 |
| - } |
| 248 | + @if not($cell-selected-within-text-color) and $cell-selected-within-background { |
| 249 | + $cell-selected-within-text-color: text-contrast($cell-selected-within-background); |
259 | 250 | }
|
260 | 251 |
|
261 | 252 | @if not($ghost-header-icon-color) and $ghost-header-background {
|
|
333 | 324 | }
|
334 | 325 |
|
335 | 326 | @if not($row-selected-text-color) and $row-selected-background {
|
336 |
| - $row-selected-text-color: $row-selected-background; |
| 327 | + $row-selected-text-color: text-contrast($row-selected-background); |
337 | 328 | }
|
338 | 329 |
|
339 |
| - @if not($row-selected-text-color) and $row-selected-hover-background { |
340 |
| - $row-selected-text-color: $row-selected-hover-background; |
| 330 | + @if not($row-selected-hover-text-color) and $row-selected-hover-background { |
| 331 | + $row-selected-hover-text-color: text-contrast($row-selected-hover-background); |
341 | 332 | }
|
342 | 333 |
|
343 | 334 | @if not($row-border-color) and $content-background {
|
|
410 | 401 | $drop-area-background: text-contrast($grouparea-background);
|
411 | 402 | }
|
412 | 403 |
|
413 |
| - |
414 |
| - |
415 | 404 | @if not($drop-area-on-drop-background) and $drop-area-background {
|
416 | 405 | $drop-area-on-drop-background: $drop-area-background;
|
417 | 406 | }
|
|
494 | 483 | row-selected-background: $row-selected-background,
|
495 | 484 | row-selected-hover-background: $row-selected-hover-background,
|
496 | 485 | row-selected-text-color: $row-selected-text-color,
|
| 486 | + row-selected-hover-text-color: $row-selected-hover-text-color, |
497 | 487 | row-hover-background: $row-hover-background,
|
498 | 488 | row-hover-text-color: $row-hover-text-color,
|
499 | 489 | row-border-color: $row-border-color,
|
|
561 | 551 | body-summaries-text-color: $body-summaries-text-color,
|
562 | 552 | root-summaries-background: $root-summaries-background,
|
563 | 553 | root-summaries-text-color: $root-summaries-text-color,
|
564 |
| - row-selected-cell-background: $row-selected-cell-background, |
565 | 554 |
|
566 | 555 | row-highlight: $row-highlight,
|
567 | 556 | grid-shadow: $grid-shadow,
|
|
571 | 560 | drop-area-border-radius: $drop-area-border-radius,
|
572 | 561 | sortable-header-icon-hover-color: $sortable-header-icon-hover-color,
|
573 | 562 | grid-border-color: $grid-border-color,
|
| 563 | + |
| 564 | + cell-selected-within-background: $cell-selected-within-background, |
| 565 | + cell-selected-within-text-color: $cell-selected-within-text-color, |
574 | 566 | ));
|
575 | 567 | }
|
576 | 568 |
|
|
1026 | 1018 | color: --var($theme, 'row-hover-text-color');
|
1027 | 1019 |
|
1028 | 1020 | %grid-cell--column-selected {
|
| 1021 | + color: --var($theme, 'row-selected-hover-text-color'); |
1029 | 1022 | background: --var($theme, 'row-selected-hover-background');
|
1030 | 1023 | }
|
1031 | 1024 |
|
1032 | 1025 | %grid-cell--cross-selected {
|
1033 |
| - color: --var($theme, 'row-selected-text-color'); |
1034 |
| - background: --var($theme, 'row-selected-cell-background'); |
| 1026 | + color: --var($theme, 'cell-selected-within-text-color'); |
| 1027 | + background: --var($theme, 'cell-selected-within-background'); |
1035 | 1028 | }
|
1036 | 1029 | }
|
1037 | 1030 |
|
|
1101 | 1094 |
|
1102 | 1095 | %grid-cell--selected,
|
1103 | 1096 | %grid-cell--pinned-selected {
|
1104 |
| - background: --var($theme, 'row-selected-cell-background'); |
| 1097 | + color: --var($theme, 'cell-selected-within-text-color'); |
| 1098 | + background: --var($theme, 'cell-selected-within-background'); |
1105 | 1099 | }
|
1106 | 1100 |
|
1107 | 1101 | &:hover {
|
1108 | 1102 | background: --var($theme, 'row-selected-hover-background');
|
1109 |
| - color: --var($theme, 'row-selected-text-color'); |
| 1103 | + color: --var($theme, 'row-selected-hover-text-color'); |
1110 | 1104 |
|
1111 | 1105 | %grid-cell--column-selected {
|
1112 |
| - color: --var($theme, 'row-selected-text-color'); |
| 1106 | + color: --var($theme, 'row-selected-hover-text-color'); |
1113 | 1107 | background: --var($theme, 'row-selected-hover-background');
|
1114 | 1108 | }
|
1115 | 1109 | }
|
|
1373 | 1367 | }
|
1374 | 1368 |
|
1375 | 1369 | %grid-cell--cross-selected {
|
1376 |
| - color: --var($theme, 'row-selected-text-color'); |
1377 |
| - background: --var($theme, 'row-selected-cell-background'); |
| 1370 | + color: --var($theme, 'cell-selected-within-text-color'); |
| 1371 | + background: --var($theme, 'cell-selected-within-background'); |
1378 | 1372 | }
|
1379 | 1373 |
|
1380 | 1374 | %igx-grid__td--new {
|
|
0 commit comments