Skip to content

Commit d006754

Browse files
Switch to esbuild minifier for CSS (Comcast#3827)
* Switch to `esbuild` minfier for CSS * Add a note on rollowdown * Add a `Theming` section * Update README.md Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com> --------- Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
1 parent 8842595 commit d006754

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The DataGrid component is designed to handle large datasets efficiently while of
2626
- Great performance thanks to virtualization: columns and rows outside the viewport are not rendered
2727
- Strictly typed with TypeScript
2828
- [Keyboard accessibility](https://adazzle.github.io/react-data-grid/#/CommonFeatures)
29-
- Light and dark mode support out of the box. The light or dark themes can be enforced using the `rdg-light` or `rdg-dark` classes.
29+
- Light and dark mode support out of the box.
3030
- [Frozen columns](https://adazzle.github.io/react-data-grid/#/CommonFeatures): Freeze columns to keep them visible during horizontal scrolling.
3131
- [Column resizing](https://adazzle.github.io/react-data-grid/#/CommonFeatures)
3232
- [Multi-column sorting](https://adazzle.github.io/react-data-grid/#/CommonFeatures)
@@ -53,6 +53,16 @@ The DataGrid component is designed to handle large datasets efficiently while of
5353
- [Changelog](CHANGELOG.md)
5454
- [Contributing](CONTRIBUTING.md)
5555

56+
> **Important** <br />
57+
> `rolldown-vite` by default uses `lightningcss` to minify css which has a [bug minifying light-dark syntax](https://github.com/parcel-bundler/lightningcss/issues/873). You can switch to `esbuild` as a workaround
58+
59+
```ts
60+
build: {
61+
....,
62+
cssMinify: 'esbuild'
63+
}
64+
```
65+
5666
## Installation
5767

5868
Install `react-data-grid` using your favorite package manager:
@@ -110,6 +120,10 @@ function App() {
110120
}
111121
```
112122

123+
## Theming
124+
125+
Set `--rdg-color-scheme: light/dark` at the `:root` to control the color theme. The light or dark themes can be enforced using the `rdg-light` or `rdg-dark` classes.
126+
113127
## API Reference
114128

115129
### Components

vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ export default defineConfig(({ command, isPreview }) => ({
5050
build: {
5151
modulePreload: { polyfill: false },
5252
sourcemap: true,
53-
reportCompressedSize: false
53+
reportCompressedSize: false,
54+
// https://github.com/parcel-bundler/lightningcss/issues/873
55+
cssMinify: 'esbuild'
5456
},
5557
plugins: [
5658
(!isTest || isPreview) &&

0 commit comments

Comments
 (0)