P5.3 — Component override contract, styles.scope(), and classname snapshot tooling#119
Merged
Merged
Conversation
…pshot tooling Formalize the two-tier override model in docs, add styles.scope() for nested theme conflicts via @scope, and ship snapshot-classnames CLI plus an opt-in ESLint rule guarding removed semantic class names in publishable packages. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Move classname snapshot scanning out of the core typestyles package so runtime deps stay limited to csstype, and expose `typestyles snapshot` via a generic CLI entry point for future commands. Co-authored-by: Cursor <cursoragent@cursor.com>
Include layer in scope rule keys to avoid sheet collisions, add a removed-variant ESLint fixture test, and document project-level diagnostics plus static-scan limits. Co-authored-by: Cursor <cursoragent@cursor.com>
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
styles.scope({ root, to?, layer? }, className, overrides)for proximity-correct nested theme overrides via CSS@scope, reusing existingserializeStyle,applyLayerToRules, andinsertRules.typestyles snapshot-classnames --writeand the opt-in@typestyles/no-removed-public-classnameESLint rule to guard semver-breaking semantic class renames in publishable packages.@scopeas escape hatches) and the public semantic class name contract across theming, components, and publishing docs.Test plan
pnpm --filter typestyles test(includesscope.test.tsandsnapshot-classnames.test.ts)pnpm --filter @typestyles/eslint-plugin test(includesno-removed-public-classnamerule fixtures)pnpm --filter typestyles build(bundle size budget still passes)node packages/typestyles/dist/cli/snapshot-classnames.js --root examples/design-systemlists scoped semantic class namesMade with Cursor