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

Ensure that arbitrary properties respect important configuration #13353

Merged
merged 3 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Reset letter spacing for form elements ([#13150](https://github.com/tailwindlabs/tailwindcss/pull/13150))
- Fix missing `xx-large` and remove double `x-large` absolute size ([#13324](https://github.com/tailwindlabs/tailwindcss/pull/13324))
- Don't error when encountering nested CSS unless trying to `@apply` a class that uses nesting ([#13325](https://github.com/tailwindlabs/tailwindcss/pull/13325))
- Ensure that arbitrary properties respect the important configuration ([#13353](https://github.com/tailwindlabs/tailwindcss/pull/13353))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd tweak this very slightly to:

Ensure that arbitrary properties respect important configuration

No "the", make important a code tag 👍


## [3.4.1] - 2024-01-05

Expand Down
2 changes: 1 addition & 1 deletion src/lib/generateRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ function extractArbitraryProperty(classCandidate, context) {

return [
[
{ sort, layer: 'utilities' },
{ sort, layer: 'utilities', options: { respectImportant: true } },
() => ({
[asClass(classCandidate)]: {
[property]: normalized,
Expand Down
4 changes: 4 additions & 0 deletions tests/important-selector.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test('important selector', () => {
<div class="rtl:active:text-center"></div>
<div class="dark:before:underline"></div>
<div class="hover:[&::file-selector-button]:rtl:dark:bg-black/100"></div>
<div class="[color:red]"></div>
`,
},
],
Expand Down Expand Up @@ -132,6 +133,9 @@ test('important selector', () => {
.custom-util {
button: no;
}
#app .\[color\:red\] {
color: red;
}
#app :is(.group:hover .group-hover\:focus-within\:text-left:focus-within) {
text-align: left;
}
Expand Down
Loading