Skip to content
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

Preserve case of css variables added by plugins #6888

Merged
merged 1 commit into from Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Nothing yet!
### Fixed

- Preserve case of css variables added by plugins ([#6888](https://github.com/tailwindlabs/tailwindcss/pull/6888))

## [3.0.10] - 2022-01-04

Expand Down
25 changes: 13 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -79,7 +79,7 @@
"is-glob": "^4.0.3",
"normalize-path": "^3.0.0",
"object-hash": "^2.2.0",
"postcss-js": "^3.0.3",
"postcss-js": "^4.0.0",
"postcss-load-config": "^3.1.0",
"postcss-nested": "5.0.6",
"postcss-selector-parser": "^6.0.7",
Expand Down
19 changes: 19 additions & 0 deletions tests/custom-plugins.test.js
Expand Up @@ -1892,3 +1892,22 @@ test('animation values are joined when retrieved using the theme function', () =
`)
})
})

test('custom properties are not converted to kebab-case when added to base layer', () => {
let config = {
content: [],
plugins: [
function ({ addBase }) {
addBase({
':root': {
'--colors-primaryThing-500': '0, 0, 255',
},
})
},
],
}

return run('@tailwind base', config).then((result) => {
expect(result.css).toContain(`--colors-primaryThing-500: 0, 0, 255;`)
})
})
14 changes: 14 additions & 0 deletions tests/parseObjectStyles.test.js
Expand Up @@ -300,3 +300,17 @@ test('it can parse an array of styles', () => {
}
`)
})

test('custom properties preserve their case', () => {
const result = parseObjectStyles({
':root': {
'--colors-aColor-500': '0',
},
})

expect(css(result)).toMatchCss(`
:root {
--colors-aColor-500: 0;
}
`)
})