Don’t unconditionally convert config keys to kebab-case
#19337
+81
−13
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 #18114
Closes #18115
This PR changes JS config handling such that we always preserve casing for theme keys (when possible).
Now there are two exceptions to this rule:
All of our internal plugins look for kebab-case keys. So, for example, take the path
backgroundColor.red.500. This must translate to--background-color-red-500. But if you had something likebackgroundColor.lightBlueit would be perfectly fine for that to translate to--background-color-lightBlueinternally (and thus the utility be written asbg-lightBlue.These keys are converted to "nested" key syntax internally and typtically represent CSS property names.
For example:
The
lineHeightkey here must be converted toline-heightbecause it represents a CSS property name. The theme key that represents this value is--text-xs--line-height. The same situation applies for thefontVariationSettingswhere the theme key is--font-sans--font-variation-settings.