-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Upgrade: Migrate JS theme configuration keys with dot and slash in the property name #14736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @philipp-spiess and the rest of your teammates on |
06b6d11 to
19e512d
Compare
adamwathan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just be using CSS.escape or whatever on all JS stuff when converting it to CSS? There’s tons of other characters someone could be using in their JS config that need to be escaped when converted to CSS as well, like percentage signs for example.
19e512d to
ddcebfb
Compare
fb06b4c to
99072ca
Compare
ddcebfb to
e9c9f7e
Compare
99072ca to
f99717b
Compare
e9c9f7e to
47f75e8
Compare
Merge activity
|
…grade_migrate_js_theme_configuration_keys_with_dot_and_slash_in_the_property_name
| let property = keyPathToCssProperty([key[0]]) | ||
| if (property !== null) { | ||
| css += ` --${escape(property)}-*: initial;\n` | ||
| } | ||
| } | ||
|
|
||
| css += ` --${keyPathToCssProperty(key)}: ${value};\n` | ||
| let property = keyPathToCssProperty(key) | ||
| if (property !== null) { | ||
| css += ` --${escape(property)}: ${value};\n` | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…e property name (#14736) This PR fixes an issue where JS configuration theme properties with dots or slashes in them would not migrate correctly. E.g.: ```ts import { type Config } from 'tailwindcss' module.exports = { theme: { width: { 1.5: '0.375rem', '1/2': '50%', } } } ``` This should convert to: ```css @theme { --width-1_5: 0.375rem; --width-1\/2: 50%; } ``` _Note: We will likely change the `--width-1_5` key to `--width-1\.5` in a follow-up PR._ --------- Co-authored-by: Robin Malfait <[email protected]> Co-authored-by: Adam Wathan <[email protected]> Co-authored-by: Adam Wathan <[email protected]>
|
Merged into |


This PR fixes an issue where JS configuration theme properties with dots or slashes in them would not migrate correctly. E.g.:
This should convert to:
Note: We will likely change the
--width-1_5key to--width-1\.5in a follow-up PR.