Repository navigation
fix: stop hashing the CSS class names - #30
Merged
Merged
Conversation
The postcss plugin ran with modules: true, so the bundled stylesheet shipped names like .squirrel-select_select__option__JQTYe while the TypeScript adds the plain select__option. src/index.ts imports the SCSS for its side effect only and never reads the class map, so the two sides could never line up: the injected stylesheet matched nothing and every consumer had to write the whole thing themselves. The names are namespaced with sqs- already and are documented in the README as the public styling API, so hashing them was never wanted here. Verified against the built bundle: it now carries .sqs-dropdown__wrapper, .select, .select__trigger, .select__options, .select__option, .selected and .open, which is what DropdownCreation and constantsAndHelpers assign. Closes #5
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.
Closes #5.
postcss({ modules: true })hashed the SCSS class names, so the bundledstylesheet shipped
while the TypeScript adds the plain
sqs-dropdown__wrapper,select__trigger,select__option.src/index.tsimports the SCSS for itsside effect only and never reads the class map, so the two could never line
up — the injected stylesheet matched nothing and every consumer had to
write the whole thing themselves.
The names are already namespaced with
sqs-and the README documents themas the public styling API, so hashing them was never wanted here.
Verification
Built bundle before:
after:
which matches what
DropdownCreation.tsandconstantsAndHelpers.tsassign. No hashed names remain in the output.
eslint,tsc --noEmitandrollupall run clean.Not changed here:
different-from-default-optionandselect__disabledare applied by the TypeScript but have never existed in the stylesheet —
they are styling hooks for consumers, not a hashing problem.