Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ The DataGrid supports the following CSS variables for customization:
.rdg {
/* Selection */
--rdg-selection-width: 2px;
--rdg-selection-color: hsl(207, 75%, 66%);
--rdg-selection-color: light-dark(hsl(207deg 80% 42%), hsl(207deg 75% 66%));

/* Typography */
--rdg-font-size: 14px;
Expand All @@ -169,8 +169,8 @@ The DataGrid supports the following CSS variables for customization:

/* Rows */
--rdg-row-hover-background-color: light-dark(hsl(0deg 0% 96%), hsl(0deg 0% 9%));
--rdg-row-selected-background-color: light-dark(hsl(207deg 76% 92%), hsl(207deg 76% 42%));
--rdg-row-selected-hover-background-color: light-dark(hsl(207deg 76% 88%), hsl(207deg 76% 38%));
--rdg-row-selected-background-color: light-dark(hsl(207deg 76% 92%), hsl(207deg 76% 26%));
--rdg-row-selected-hover-background-color: light-dark(hsl(207deg 76% 88%), hsl(207deg 76% 22%));

/* Borders */
--rdg-border-width: 1px;
Expand All @@ -179,7 +179,7 @@ The DataGrid supports the following CSS variables for customization:
--rdg-summary-border-color: light-dark(#aaa, #555);

/* Checkboxes */
--rdg-checkbox-focus-color: hsl(207deg 100% 69%);
--rdg-checkbox-focus-color: light-dark(hsl(207deg 80% 42%), hsl(207deg 100% 69%));

/* Frozen columns */
--rdg-frozen-column-shadow-color: light-dark(rgb(0 0 0 / 15%), rgb(0 0 0 / 40%));
Expand Down Expand Up @@ -209,7 +209,7 @@ The DataGrid accepts standard [`className`](#classname-string--undefined) and [`
columns={columns}
rows={rows}
className="my-grid custom-theme"
style={{ width: 800, height: 600 }}
style={{ inlineSize: 800, blockSize: 600 }}
/>
```

Expand Down
4 changes: 2 additions & 2 deletions src/HeaderCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const cellOverClassname = `rdg-cell-drag-over ${cellDraggingOrOver}`;
const dragImageClassname = css`
@layer rdg.HeaderCell {
border-radius: 4px;
width: fit-content;
outline: 2px solid hsl(207, 100%, 50%);
inline-size: fit-content;
outline: 2px solid hsl(207deg 100% 50%);
outline-offset: -2px;
}
`;
Expand Down
10 changes: 5 additions & 5 deletions src/style/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const root = css`

@layer rdg.Root {
--rdg-selection-width: 2px;
--rdg-selection-color: hsl(207, 75%, 66%);
--rdg-selection-color: light-dark(hsl(207deg 80% 42%), hsl(207deg 75% 66%));
--rdg-font-size: 14px;
--rdg-border-width: 1px;
--rdg-summary-border-width: calc(var(--rdg-border-width) * 2);
Expand All @@ -25,9 +25,9 @@ const root = css`
--rdg-header-background-color: light-dark(hsl(0deg 0% 97.5%), hsl(0deg 0% 10.5%));
--rdg-header-draggable-background-color: light-dark(hsl(0deg 0% 90.5%), hsl(0deg 0% 17.5%));
--rdg-row-hover-background-color: light-dark(hsl(0deg 0% 96%), hsl(0deg 0% 9%));
--rdg-row-selected-background-color: light-dark(hsl(207deg 76% 92%), hsl(207deg 76% 42%));
--rdg-row-selected-hover-background-color: light-dark(hsl(207deg 76% 88%), hsl(207deg 76% 38%));
--rdg-checkbox-focus-color: hsl(207deg 100% 69%);
--rdg-row-selected-background-color: light-dark(hsl(207deg 76% 92%), hsl(207deg 76% 26%));
--rdg-row-selected-hover-background-color: light-dark(hsl(207deg 76% 88%), hsl(207deg 76% 22%));
--rdg-checkbox-focus-color: light-dark(hsl(207deg 80% 42%), hsl(207deg 100% 69%));
--rdg-frozen-column-shadow-color: light-dark(rgb(0 0 0 / 15%), rgb(0 0 0 / 40%));

/* forced colors mode replaces non-system colors, which would hide the drag handle */
Expand Down Expand Up @@ -104,7 +104,7 @@ export const viewportDraggingClassname = `rdg-viewport-dragging ${viewportDraggi
const frozenColumnShadowClassname = css`
@layer rdg.FrozenColumnShadow {
position: sticky;
width: 10px;
inline-size: 10px;
pointer-events: none;
z-index: 1;
opacity: 1;
Expand Down
4 changes: 4 additions & 0 deletions test/browser/styles.css → test/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:root {
color-scheme: light dark;
}

.rdg {
block-size: 1080px;
scrollbar-width: none;
Expand Down
2 changes: 1 addition & 1 deletion test/visual/basicGrid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test('basic grid', async () => {
rows={rows}
topSummaryRows={topSummaryRows}
bottomSummaryRows={bottomSummaryRows}
style={{ height: 350 }}
style={{ blockSize: 350 }}
/>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,32 @@ const rows: readonly Row[] = [

const selectedRows: ReadonlySet<number> = new Set([1, 2]);

// Windows contrast themes are light or dark, so test both palettes
const palettes = [
{ colorScheme: 'light', prefix: 'forced-colors' },
{ colorScheme: 'dark', prefix: 'forced-colors-dark' }
// Windows contrast themes are light or dark too, so test both palettes in forced colors mode
const modes = [
{ colorScheme: 'light', forcedColors: 'none', prefix: 'light' },
{ colorScheme: 'dark', forcedColors: 'none', prefix: 'dark' },
{ colorScheme: 'light', forcedColors: 'active', prefix: 'forced-colors' },
{ colorScheme: 'dark', forcedColors: 'active', prefix: 'forced-colors-dark' }
] as const;

describe.each(palettes)('$colorScheme palette', ({ colorScheme, prefix }) => {
describe.each(modes)('$prefix', ({ colorScheme, forcedColors, prefix }) => {
beforeEach(async ({ skip, onTestFinished }) => {
// WebKit matches `(forced-colors: active)` when emulated, but does not force any colors,
// and Firefox ignores the emulated color scheme in forced colors mode
skip(server.browser === 'webkit' || (server.browser === 'firefox' && colorScheme === 'dark'));
skip(
forcedColors === 'active' &&
(server.browser === 'webkit' || (server.browser === 'firefox' && colorScheme === 'dark'))
);

await commands.emulateMedia({ forcedColors: 'active', colorScheme });
await commands.emulateMedia({ forcedColors, colorScheme });
onTestFinished(async () => {
// restore the context defaults, as `null` would make the page follow the OS instead
await commands.emulateMedia({ forcedColors: 'none', colorScheme: 'light' });
});

await page.render(
<DataGrid
aria-label="Forced colors"
aria-label="Color schemes"
getRowKey={getRowKey}
columns={columns}
rows={rows}
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.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
2 changes: 1 addition & 1 deletion test/visual/treeGrid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ test('tree grid', async () => {
groupBy={['country', 'year']}
expandedGroupIds={new Set(['USA', 'USA__2020'])}
onExpandedGroupIdsChange={() => {}}
style={{ height: 350 }}
style={{ blockSize: 350 }}
/>
);

Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export default defineConfig({
name: 'browser',
include: ['browser/**/*.test.*', ...(isCI ? ['visual/*.test.*'] : [])],
browser: { enabled: true },
setupFiles: ['test/browser/styles.css', 'test/setupBrowser.ts', 'test/failOnConsole.ts']
setupFiles: ['test/styles.css', 'test/setupBrowser.ts', 'test/failOnConsole.ts']
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion website/routes/Animation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const rangeClassname = css`
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
margin-block-end: 8px;
`;

const transitionClassname = css`
Expand Down
2 changes: 1 addition & 1 deletion website/routes/CommonFeatures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const columns: readonly Column<Row, SummaryRow>[] = [
&:modal {
display: flex;
flex-direction: column;
width: 300px;
inline-size: 300px;
gap: 16px;
padding: 16px;
}
Expand Down
2 changes: 1 addition & 1 deletion website/routes/CustomizableRenderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const selectCellClassname = css`

const sortPriorityClassname = css`
color: gray;
margin-left: 2px;
margin-inline-start: 2px;
`;

interface Row {
Expand Down
Loading