fix(desktop): compile fade-edge.css into the Tailwind stylesheet so layer order holds
Summary
- Import
fade-edge.cssfrom the Tailwind entry stylesheets instead of from the two overflow-fade components, so no JS-imported stylesheet declares a cascade layer. - Fixes the current canary (
2.0.8-canary.20261112120717, built from e9dc091801), where Tailwind's base layer beats almost every utility class.
Why / Context
Vite 8 (#9582) emits CSS imported by a shared chunk as its own file and links it ahead of the entry stylesheet. fade-edge.css wraps its rules in @layer utilities and was imported from JS, so in the canary's index.html the first stylesheet was a 1.4 KB chunk containing only that file. That made utilities the first declared layer, which is the lowest priority, and the main Tailwind sheet then declared properties, theme, base, components after it.
#7873 fixed the same failure by importing globals.css first, which only held while all CSS landed in one entry file. Stable 2.0.8 still has a single index-*.css; today's canary is the first successful canary build with the Vite 8 renderer.
How It Works
Tailwind fixes layer order inside the stylesheet it compiles. fade-edge.css now goes through that stylesheet:
packages/ui/src/globals.css(web and marketing)apps/desktop/src/renderer/globals.cssapps/docs/src/app/global.css
The import "../fade-edge.css" lines in OverflowFadeContainer and OverflowFadeText are removed. It was the only JS-imported stylesheet in the repo with an @layer block.
Testing
- Unpacked the installed canary and stable 2.0.8 app bundles and compared
index.htmland the CSS layer declarations to find the cause. electron-vite buildon this branch:index.htmlno longer links a layered stylesheet ahead of the main one, and the fade rules are inside the main Tailwind sheet afterproperties, theme, base, components, utilities.biome checkon the changed files.- Not done: launching the built app, and building web, marketing or docs.
Follow-ups
- Nothing stops a later JS-imported CSS file from declaring
@layeragain. A small test that fails on that would close it.
Summary by cubic
Fixes the overflow fade styles being overridden by Tailwind's base layer in the 2.0.8-canary.20261112120717 canary build.
Moves fade-edge.css imports from the two OverflowFade components into the Tailwind entry stylesheets: packages/ui/src/globals.css, apps/desktop/src/renderer/globals.css, and apps/docs/src/app/global.css. With Vite 8, JS-imported CSS from a shared chunk is emitted as a separate file linked ahead of the entry sheet; since fade-edge.css declared @layer utilities, utilities became the first (lowest-priority) layer, letting base styles override the utilities. The change leaves no JS-imported stylesheet declaring a cascade layer.
Summary by CodeRabbit
- Style
- Overflow-fade edge styling is now applied consistently across the desktop app, documentation site, and UI components.
- Fade effects for overflowing content retain their existing behavior while sharing a common stylesheet.