Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility: DataGrid - Fix contrast issues (part 1) #25430

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
010367e
dx-datagrid-nodata generic light/dark
markallenramirez Aug 24, 2023
ca336b1
dx-group-cell generic light/dark
markallenramirez Aug 24, 2023
c899e06
dx-datagrid-nodata material light
markallenramirez Aug 24, 2023
e7f28e7
focused row cell generic light/dark
markallenramirez Aug 25, 2023
e580ffd
focused row cell material light/dark
markallenramirez Aug 25, 2023
2fc45b4
removed row cell generic light/dark
markallenramirez Aug 25, 2023
c70832f
dx-group-panel-item material light/dark
markallenramirez Aug 25, 2023
493830f
dx-group-panel-item sort icon generic/material
markallenramirez Aug 25, 2023
614a65c
enable contrast test for grouping and no data
markallenramirez Aug 25, 2023
63525ab
enable test for focused row
markallenramirez Aug 25, 2023
1e2b647
enable test for removed row in batch mode
markallenramirez Aug 29, 2023
45ca129
update etalons
markallenramirez Aug 29, 2023
3f5336e
update qunit test
markallenramirez Aug 29, 2023
4e41f60
Revert "enable test for removed row in batch mode"
markallenramirez Aug 30, 2023
8a9c37a
exclude fluent test
markallenramirez Aug 31, 2023
9b50450
exclude fluent dark test
markallenramirez Aug 31, 2023
9903240
fix 150 char limit
markallenramirez Aug 31, 2023
f086803
focused row cell border generic light/dark
markallenramirez Sep 1, 2023
3e0d749
update etalons
markallenramirez Sep 1, 2023
628d4e6
Revert "focused row cell border generic light/dark"
markallenramirez Sep 6, 2023
a0f0c80
new focused row cell border generic light/dark
markallenramirez Sep 6, 2023
99779b3
Merge branch '23_2' into a11y_contrast_group/23_2
markallenramirez Sep 6, 2023
481c9e8
etalons
markallenramirez Sep 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
}

.dx-sort {
color: $datagrid-menu-icon-color;
color: $datagrid-columnchooser-item-color;
}
}

Expand Down
24 changes: 12 additions & 12 deletions packages/devextreme/scss/widgets/generic/gridBase/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,14 @@ $datagrid-text-stub-background-image-path: null !default;
$datagrid-selection-bg: #444 !default;
$datagrid-row-selected-border-color: $datagrid-border-color !default;
$datagrid-row-selected-color: $datagrid-base-color !default;
$datagrid-row-focused-color: $base-inverted-text-color !default;
$datagrid-row-focused-bg: mix($base-bg, $base-accent, 20%) !default;
$datagrid-row-focused-color: $base-text-color !default;
$datagrid-row-focused-bg: color.change($base-accent, $alpha: 0.2) !default;
$datagrid-hover-bg: $base-hover-bg !default;
$datagrid-row-hovered-color: $base-hover-color !default;
$datagrid-menu-icon-color: darken($base-icon-color, 33.7%) !default;
$datagrid-cell-modified-border-color: color.change($base-success, $alpha: 0.5) !default;
$datagrid-nodata-color: darken($datagrid-base-color, 40%) !default;
$datagrid-group-row-color: darken($datagrid-base-color, 38.5%) !default;
$datagrid-nodata-color: $datagrid-base-color !default;
$datagrid-group-row-color: lighten($datagrid-base-color, 6.7%) !default;
$datagrid-group-row-bg: lighten($datagrid-base-background-color, 3%) !default;
$datagrid-master-detail-cell-bg: lighten($datagrid-base-background-color, 2%) !default;
$datagrid-spin-icon-color: darken($base-icon-color, 38.5%) !default;
Expand All @@ -330,8 +330,8 @@ $datagrid-text-stub-background-image-path: null !default;
$datagrid-column-separator-bg: color.change($base-accent, $alpha: 0.5) !default;
$datagrid-text-stub-background-image-path: data-uri('images/widgets/generic/color-schemes/dark/grid/text-stub.png') !default;
$datagrid-cell-removed-border-color: $datagrid-border-color !default;
$datagrid-row-removed-bg: $datagrid-border-color !default;
$datagrid-cell-removed-text-color: $datagrid-columnchooser-item-color !default;
$datagrid-row-removed-bg: darken($datagrid-border-color, 6.67) !default;
$datagrid-cell-removed-text-color: color.change($base-text-color, $alpha: 0.7) !default;
}

@if $color == "darkmoon" {
Expand Down Expand Up @@ -475,14 +475,14 @@ $datagrid-text-stub-background-image-path: null !default;
$datagrid-selection-bg: #e6e6e6 !default;
$datagrid-row-selected-border-color: $datagrid-border-color !default;
$datagrid-row-selected-color: $datagrid-base-color !default;
$datagrid-row-focused-color: $base-inverted-text-color !default;
$datagrid-row-focused-bg: mix($base-bg, $base-accent, 20%) !default;
$datagrid-row-focused-color: $base-text-color !default;
$datagrid-row-focused-bg: color.change($base-accent, $alpha: 0.2) !default;
$datagrid-hover-bg: $base-hover-bg !default;
$datagrid-row-hovered-color: $base-hover-color !default;
$datagrid-menu-icon-color: lighten($base-icon-color, 33.7%) !default;
$datagrid-cell-modified-border-color: color.change($base-success, $alpha: 0.5) !default;
$datagrid-nodata-color: lighten($datagrid-base-color, 40%) !default;
$datagrid-group-row-color: lighten($datagrid-base-color, 38.5%) !default;
$datagrid-nodata-color: $datagrid-base-color !default;
$datagrid-group-row-color: darken($datagrid-base-color, 6.7%) !default;
$datagrid-group-row-bg: darken($datagrid-base-background-color, 3%) !default;
$datagrid-master-detail-cell-bg: darken($datagrid-base-background-color, 2%) !default;
$datagrid-spin-icon-color: lighten($base-icon-color, 38.5%) !default;
Expand All @@ -502,8 +502,8 @@ $datagrid-text-stub-background-image-path: null !default;
$datagrid-column-separator-bg: color.change($base-accent, $alpha: 0.5) !default;
$datagrid-text-stub-background-image-path: data-uri('images/widgets/generic/color-schemes/light/grid/text-stub.png') !default;
$datagrid-cell-removed-border-color: $datagrid-border-color !default;
$datagrid-row-removed-bg: $datagrid-border-color !default;
$datagrid-cell-removed-text-color: $datagrid-columnchooser-item-color !default;
$datagrid-row-removed-bg: lighten($datagrid-border-color, 6.67) !default;
$datagrid-cell-removed-text-color: color.change($base-text-color, $alpha: 0.7) !default;
}

@if $color == "softblue" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,8 @@ $grid-masterdetail-padding: 20px;
&:not(.dx-row-lines) {
& > td,
& > tr:first-child > td {
border-top: 1px solid $datagrid-focused-border-color;
border-bottom: 1px solid $datagrid-focused-border-color;
border-top: 1px solid $datagrid-row-focused-bg;
border-bottom: 1px solid $datagrid-row-focused-bg;
}
}
}
Expand Down Expand Up @@ -924,6 +924,7 @@ $grid-masterdetail-padding: 20px;
.dx-#{$widget-name}-nodata {
color: $datagrid-nodata-color;
font-size: $generic-grid-base-nodata-font-size;
opacity: 0.7;
}

.dx-#{$widget-name}-bottom-load-panel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
}

.dx-sort {
color: $datagrid-menu-icon-color;
color: $datagrid-columnchooser-item-color;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ $datagrid-row-selected-color: $datagrid-base-color !default;
* $name 65. Focused row text color
* $type color
*/
$datagrid-row-focused-color: $base-inverted-text-color !default;
$datagrid-row-focused-color: $base-text-color !default;

/**
* $name 70. Focused row background color
* $type color
*/
$datagrid-row-focused-bg: mix($base-bg, $base-accent, 20%) !default;
$datagrid-row-focused-bg: color.change($base-accent, $alpha: 0.2) !default;
$datagrid-hover-bg: $base-hover-bg !default;
$datagrid-row-hovered-color: $base-hover-color !default;

Expand All @@ -93,7 +93,7 @@ $datagrid-cell-removed-text-color: null !default;
* $type color
*/
$datagrid-row-invalid-faded-border-color: color.change($base-invalid-faded-border-color, $alpha: 0.32) !default;
$datagrid-nodata-color: lighten($datagrid-base-color, 40%) !default;
$datagrid-nodata-color: color.change($datagrid-base-color, $alpha: 0.54) !default;

/**
* $name 90. Group row text color
Expand Down Expand Up @@ -173,7 +173,7 @@ $datagrid-text-link-disabled-opacity: $base-disabled-opacity;
$datagrid-icon-link-disabled-opacity: $button-disabled-icon-opacity;

@if $mode == "light" {
$datagrid-columnchooser-item-color: color.change($datagrid-base-color, $alpha: 0.54) !default;
$datagrid-columnchooser-item-color: color.change($datagrid-base-color, $alpha: 0.6) !default;
$datagrid-block-separator-bg: darken($datagrid-base-background-color, 12%) !default;
$datagrid-drag-header-shadow-color: color.change($base-shadow-color, $alpha: 0.1) !default;
$datagrid-drag-header-second-shadow-color: color.change($base-shadow-color, $alpha: 0.2) !default;
Expand All @@ -188,7 +188,7 @@ $datagrid-icon-link-disabled-opacity: $button-disabled-icon-opacity;
}

@if $mode == "dark" {
$datagrid-columnchooser-item-color: color.change($datagrid-base-color, $alpha: 0.6) !default;
$datagrid-columnchooser-item-color: color.change($datagrid-base-color, $alpha: 0.72) !default;
$datagrid-block-separator-bg: lighten($datagrid-base-background-color, 12%) !default;
$datagrid-drag-header-shadow-color: color.change($base-shadow-color, $alpha: 0.3) !default;
$datagrid-drag-header-second-shadow-color: color.change($base-shadow-color, $alpha: 0.4) !default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -968,11 +968,6 @@ $grid-masterdetail-padding: 16px;
color: $datagrid-link-color;
}

& > td,
& > tr:last-child > td {
border-bottom: 2px solid $datagrid-focused-border-color;
}

&:not(.dx-row-lines) {
& > td,
& > tr:first-child > td {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ const DATA_GRID_SELECTOR = '#container';
};

test(`Grid without data in ${theme}`, async (t) => {
if (theme === Themes.fluentBlue) { return; }
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);

await t
.expect(dataGrid.isReady())
.ok();

await a11yCheck(t);
await a11yCheck(t, a11yCheckConfig, DATA_GRID_SELECTOR);
}).before(async () => {
await changeTheme(theme);

Expand Down Expand Up @@ -158,13 +159,14 @@ const DATA_GRID_SELECTOR = '#container';
});

test(`Grouping and Summary in ${theme}`, async (t) => {
if (theme === Themes.fluentBlue || theme === Themes.fluentBlueDark) { return; }
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);

await t
.expect(dataGrid.isReady())
.ok();

await a11yCheck(t);
await a11yCheck(t, a11yCheckConfig, DATA_GRID_SELECTOR);
}).before(async () => {
await changeTheme(theme);

Expand Down Expand Up @@ -502,6 +504,7 @@ const DATA_GRID_SELECTOR = '#container';
});

test(`Focused row in ${theme}`, async (t) => {
if (theme === Themes.fluentBlue || theme === Themes.fluentBlueDark) { return; }
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);

// assert
Expand All @@ -511,7 +514,7 @@ const DATA_GRID_SELECTOR = '#container';
.expect(dataGrid.getDataRow(1).isFocusedRow)
.ok();

await a11yCheck(t);
await a11yCheck(t, a11yCheckConfig, DATA_GRID_SELECTOR);
}).before(async () => {
await changeTheme(theme);

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fixture.disablePageReloads`Integration_DataGrid`
test(`The rows in the fixed column are not aligned when the grid is encapsulated inside a <td> element, useNative: ${useNative} (T1071725)`, async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

await testScreenshot(t, takeScreenshot, `Grid with scrollable wrapped in td el, useNative=${useNative}.png`, { element: '#container' });
await testScreenshot(t, takeScreenshot, `Grid with scrollable wrapped in td,useNative=${useNative}.png`, { element: '#container' });

await t
.expect(compareResults.isValid())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ QUnit.module('Initialization', baseModuleConfig, () => {

const cellBackgroundColor = 'rgba(0, 0, 0, 0)';
const $groupedRow = $(dataGrid.getRowElement(0)[0]);
assert.equal(window.getComputedStyle($groupedRow[0]).backgroundColor, 'rgb(92, 149, 197)', 'focused grouped row has correct background color in rtl mode');
assert.equal(window.getComputedStyle($groupedRow[0]).backgroundColor, 'rgba(51, 122, 183, 0.2)', 'focused grouped row has correct background color in rtl mode');
assert.equal(window.getComputedStyle($groupedRow.find('td')[0]).backgroundColor, cellBackgroundColor, 'cell in focused row has no background color');
assert.equal(window.getComputedStyle($groupedRow.find('td')[1]).backgroundColor, cellBackgroundColor, 'cell in focused row has no background color');
});
Expand Down
Loading