CSS Layers#2611
Draft
mfal wants to merge 1 commit into
Draft
Conversation
Contributor
Coverage Report for ./packages/components/
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Contributor
🚀 Preview DeploymentPreview environments are ready:
Images:
|
bfadd6a to
6461d76
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces CSS Cascade Layers for Flow styles and makes theme overrides more explicit and controllable.
Flow CSS is now emitted with a stable layer structure:
The theme-related CSS is isolated in
flow.theme, while component styles live inflow.components. This allows applications to override Flow styles and theme tokens in a predictable later layer without fighting specificity.Changes
flow.baseflow.themeflow.componentsflow.themedata-flow-theme="light"anddata-flow-theme="dark"@mittwald/flow-react-components/scoped-theme.cssall.cssby defaultWhy
Apps need a reliable way to override Flow CSS and theme decisions. CSS layers give us a cleaner override model than increasing selector specificity.
Scoped theme support also lets apps force a subtree into light or dark theme independently of
data-theme,system, orprefers-color-scheme.Usage
For scoped light/dark areas:
Verification
corepack pnpm --filter @mittwald/flow-react-components buildcorepack pnpm --filter @mittwald/flow-react-components test:compilecorepack pnpm --filter @mittwald/flow-react-components test:unit -- dev/vite/cssLayerPlugin.test.tscorepack pnpm exec stylelint packages/components/src/styles/index.scss packages/components/src/styles/globals.scss packages/components/src/styles/theme-color-scheme.scssCloses #2559