feat(react-ui): opt-in layered CSS via ./layered-components.css and ./layered/styles/*#631
Open
ankit-thesys wants to merge 11 commits into
Open
feat(react-ui): opt-in layered CSS via ./layered-components.css and ./layered/styles/*#631ankit-thesys wants to merge 11 commits into
ankit-thesys wants to merge 11 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ults unlayered Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rop browserslist Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…efaults contract) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…able Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ingle import site Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tion Updated the API reference and installation guide to emphasize the importance of importing the layered variant from a single location to ensure proper cascade order. Added details on maintaining unlayered styles for individual components and adjusted the build script to include a CSS check for compliance with these guidelines.
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
Makes
@layer openuian opt-in instead of the default (revises #589/#621's distribution strategy before it ships in any release):./components.cssand./styles/*return to unlayered 0.11.x behavior — existing consumers see zero change on upgrade. Verified byte-equivalent to the pre-feat(react-ui): adopt CSS cascade layers (@layer openui) via build-side post-process #589 build pipeline../layered-components.cssand./layered/styles/*carry the same rules wrapped in@layer openuifor consumers who want plain-CSS overrides (and the Tailwind v4 recipe).openui-defaults.css/ ThemeProvider runtime injection stay unlayered in both modes (runtime theming contract).browserslistcascade-layers floor (now only the opt-in path needs it; documented in docs instead).:roottheme tokens).wrapInLayernow strips it — with unit tests (the package's first real test suite;--passWithNoTestsremoved).check-css-artifacts.jstoprepublishOnly: default-unlayered / layered-wrapped / BOM-free / defaults-unlayered invariants are now mechanically enforced (guard proven to catch an injected BOM).multi-agent-chat/vercel-ai-chatare consolidated to a single CSS import site (the fix(css): re-adopt@layer openui(#589) and make the docs honor cascade layers #621 Turbopack hazard).material-ui-chat/fastapi-backenddeliberately stay on the unlayered default.Why
Flipping the default would change override semantics for every existing consumer (unlayered resets suddenly beat component styles — the same silent visual regression that broke our docs site in #620) and would bundle that risk with the react-syntax-highlighter security fix in the next release. Opt-in keeps the next react-ui release a safe patch (0.11.9). Default flip is deferred to 1.0 with a migration window.
Verification
pnpm build+pnpm run check:css+pnpm run cigreencatalog:literals, version untouched at 0.11.8 (bump lands in the release PR chore(release): react-ui 0.12.0, lang-core 0.2.6, cli 0.0.8 #630)openui-chatexample smoke-built green under Next.js/Turbopack against the new export🤖 Generated with Claude Code