fix: scope tailwind --tw-* reset to #slack_blocks_to_jsx#71
Open
StephenTangCook wants to merge 1 commit into
Open
fix: scope tailwind --tw-* reset to #slack_blocks_to_jsx#71StephenTangCook wants to merge 1 commit into
StephenTangCook wants to merge 1 commit into
Conversation
The reset that initializes Tailwind's transform/filter/ring/etc. custom properties was nested under `.slack_blocks_to_jsx.styles_enabled`, while the utility classes themselves are scoped to `#slack_blocks_to_jsx` (via `tailwind.config.js#important`). The mismatched scopes meant the `--tw-*` variables stayed unset for elements that received transform utilities, producing an invalid `transform: translate( , ) rotate( )…` declaration that browsers silently dropped — most visibly leaving select-dropdown chevrons un-centered. Move the reset out to the same `#slack_blocks_to_jsx` scope as the generated utilities so the variables are always initialized. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Fixes #66.
Summary
--tw-*custom-property reset were nested under.slack_blocks_to_jsx.styles_enabled, while the utility classes themselves are scoped to#slack_blocks_to_jsx(viatailwind.config.js'simportant: "#slack_blocks_to_jsx"). Because the reset and the utilities lived in different scopes, the variables could stay unset and the resultingtransform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) …declaration was invalid — browsers silently dropped it. Most visibly, select-dropdown chevrons (which rely on-translate-y-1/2) rendered near the top of the field instead of vertically centered.--tw-*reset out to the same#slack_blocks_to_jsxscope as the generated utilities so the variables are always initialized for any element a transform/filter/ring/etc. utility might land on. This is option (1) from the issue's "Suggested fix" section — the smaller, safer fix.Before / after (compiled
dist/style.css)Before:
After:
Test plan
pnpm run lint(tsc) — passes.pnpm run build:css— passes; verified the compileddist/style.cssnow scopes the--tw-*reset to#slack_blocks_to_jsxinstead of.slack_blocks_to_jsx.styles_enabled.-translate-y-1/2(e.g.,static_select,multi_static_select,users_select,email_input,number_input,date_picker,time_picker,url_input) and confirm the chevron / left-icon is vertically centered.🤖 Generated with Claude Code