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

fix: Theming - switched from ?inline to ?raw css imports #1600

Merged
merged 6 commits into from
Oct 27, 2023

Conversation

bmingles
Copy link
Contributor

@bmingles bmingles commented Oct 27, 2023

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.

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (b065f1c) 46.74% compared to head (153cee8) 46.74%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1600      +/-   ##
==========================================
- Coverage   46.74%   46.74%   -0.01%     
==========================================
  Files         583      583              
  Lines       36256    36265       +9     
  Branches     9072     9072              
==========================================
+ Hits        16947    16951       +4     
- Misses      19257    19262       +5     
  Partials       52       52              
Flag Coverage Δ
unit 46.74% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
packages/components/src/theme/theme-dark/index.ts 100.00% <ø> (ø)
packages/components/src/theme/theme-light/index.ts 100.00% <ø> (ø)
packages/console/src/monaco/MonacoUtils.ts 55.93% <0.00%> (-1.46%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

mofojed
mofojed previously approved these changes Oct 27, 2023
Comment on lines +21 to +38
* 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;
* }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure where this example came from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just an example of concatenation of themes (modified from the comment in the dark one). Once light theme is actually implemented there will be multiple imports

@bmingles bmingles merged commit f6d0874 into deephaven:main Oct 27, 2023
5 checks passed
@bmingles bmingles deleted the 1599-fix-theming-inline-css branch October 27, 2023 20:57
@github-actions github-actions bot locked and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Theming ?inline css imports not consumable in Enterprise
3 participants