Skip to content

Remove remaining global styles ahead of Vite 8 upgrade#2006

Merged
axelboc merged 1 commit into
mainfrom
global-css
Apr 9, 2026
Merged

Remove remaining global styles ahead of Vite 8 upgrade#2006
axelboc merged 1 commit into
mainfrom
global-css

Conversation

@axelboc

@axelboc axelboc commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

I hit a style ordering issue again with the shared global styles when upgrading to Vite 8. I think it's because the CSS pipeline now uses Lightning CSS instead of esbuild.

So I'm getting rid of those global styles once and for all.

With react-reflex replaced with react-resizable-panels in #1987, we had very few global styles left (just .btnClean, .fallback and a couple of others), so it was just a matter of moving/duplicating the styles in the relevant packages.

It's just a few duplicated lines but it allows us to remove a whole lot of complexity, notably the whole build:css pipeline in @h5web/lib and the global-styles.css files. We still need build:css in @h5web/app to output a single CSS file for consumers to import, but that's pretty much it.

| `--h5w-tooltip-guide--color` | `gray` | Color of tooltip guide |
| `--h5w-tooltip-guide--width` | `1.5` | Width of tooltip guide |
| `--h5w-tooltip-guide--opacity` | `0.5` | Opacity of tooltip guide |
| `--h5w-info--color` | `royalblue` | Color of information messages (e.g. "Too big to display" in _Scalar_ vis) |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adding this --h5w-info--color CSS variable for Scalar vis, as it's now in located in the library but was still using the --secondary-dark variable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renamed from styles.ts for clarity. I've reworded the comment too.

Comment thread packages/app/package.json
},
"scripts": {
"build": "vite build && pnpm \"/^build:/\"",
"build:css": "vite build --config vite.styles.config.js && concat dist/temp/styles.css dist/app.css -o dist/styles.css && rimraf dist/app.css dist/temp",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm changing the output directory of vite.styles.config.js to dist-css to avoid having to delete it at the end.

formats: ['es'],
fileName: 'index',
cssFileName: 'lib',
cssFileName: 'styles',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is now the filename referenced directly in package.json. No extra steps 🎉

@axelboc axelboc merged commit aef3a68 into main Apr 9, 2026
13 checks passed
@axelboc axelboc deleted the global-css branch April 9, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant