-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Theming - switched from ?inline to ?raw css imports (#1600)
It seems that Enterprise does not handle css ?inline css imports in node_modules the same way it does in src. Namely, the raw content gets imported as an empty string instead of the raw content. - Converted ?inline imports to ?raw. These seem to handle the raw content as expected even if in node_modules - Added a sass minification step to @deephaven/components. Vite seems to minify ?inline imports but does not do so with raw - Added a try / catch to MonacoUtils to avoid non-hex theme variables from crashing the entire app fixes #1599 BREAKING CHANGE: Theme css imports were switched from `?inline` to `?raw`. Not likely that we have any consumers yet, but this would impact webpack config.
- Loading branch information
Showing
7 changed files
with
81 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,42 @@ | ||
import themeLightPalette from './theme-light-palette.css?inline'; | ||
import themeLightPalette from './theme-light-palette.css?raw'; | ||
|
||
/** | ||
* DH theme variables are imported via Vite `?raw` query which provides the | ||
* text content of the variable files as a string. The exported theme is just a | ||
* concatenation of the contents of all of these imports. | ||
* | ||
* Note that ?raw / ?inline imports are natively supported by Vite, but consumers | ||
* of @deephaven/components using Webpack will need to add a rule to their module | ||
* config. | ||
* e.g. | ||
* module: { | ||
* rules: [ | ||
* { | ||
* resourceQuery: /inline/, | ||
* type: 'asset/source', | ||
* }, | ||
* ], | ||
* } | ||
* | ||
* e.g. | ||
* | ||
* :root { | ||
* --dh-color-from-light-palette: #fff; | ||
* --dh-color-from-light-palette2: #ccc; | ||
* } | ||
* :root { | ||
* --dh-color-from-light-semantic: #000; | ||
* } | ||
* :root { | ||
* --dh-color-from-light-semantic-editor: #000; | ||
* } | ||
* :root { | ||
* --dh-color-from-light-semantic-grid: #000; | ||
* } | ||
* :root { | ||
* --dh-color-from-light-components: #000; | ||
* } | ||
*/ | ||
export const themeLight = themeLightPalette; | ||
|
||
export default themeLight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters