Skip to content

Commit 97607f1

Browse files
authored
Ensure that arbitrary properties respect important configuration (#13353)
* ensure we respect important on arbitrary properties * update changelog * reword changelog entry
1 parent c033f10 commit 97607f1

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
- Reset letter spacing for form elements ([#13150](https://github.com/tailwindlabs/tailwindcss/pull/13150))
2121
- Fix missing `xx-large` and remove double `x-large` absolute size ([#13324](https://github.com/tailwindlabs/tailwindcss/pull/13324))
2222
- Don't error when encountering nested CSS unless trying to `@apply` a class that uses nesting ([#13325](https://github.com/tailwindlabs/tailwindcss/pull/13325))
23+
- Ensure that arbitrary properties respect `important` configuration ([#13353](https://github.com/tailwindlabs/tailwindcss/pull/13353))
2324

2425
## [3.4.1] - 2024-01-05
2526

src/lib/generateRules.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ function extractArbitraryProperty(classCandidate, context) {
516516

517517
return [
518518
[
519-
{ sort, layer: 'utilities' },
519+
{ sort, layer: 'utilities', options: { respectImportant: true } },
520520
() => ({
521521
[asClass(classCandidate)]: {
522522
[property]: normalized,

tests/important-selector.test.js

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ test('important selector', () => {
2121
<div class="rtl:active:text-center"></div>
2222
<div class="dark:before:underline"></div>
2323
<div class="hover:[&::file-selector-button]:rtl:dark:bg-black/100"></div>
24+
<div class="[color:red]"></div>
2425
`,
2526
},
2627
],
@@ -132,6 +133,9 @@ test('important selector', () => {
132133
.custom-util {
133134
button: no;
134135
}
136+
#app .\[color\:red\] {
137+
color: red;
138+
}
135139
#app :is(.group:hover .group-hover\:focus-within\:text-left:focus-within) {
136140
text-align: left;
137141
}

0 commit comments

Comments
 (0)