Skip to content

Commit a5425ab

Browse files
committed
Support any arbitrary value for accentColor
1 parent 51f71af commit a5425ab

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/plugins/accentColor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function () {
1212
{
1313
values: flattenColorPalette(theme('accentColor')),
1414
variants: variants('accentColor'),
15-
type: 'color',
15+
type: ['color', 'any'],
1616
}
1717
)
1818
}

tests/arbitrary-values.test.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,12 @@
333333
.placeholder-opacity-\[var\(--placeholder-opacity\)\]::placeholder {
334334
--tw-placeholder-opacity: var(--placeholder-opacity);
335335
}
336+
.accent-\[\#bada55\] {
337+
accent-color: #bada55;
338+
}
339+
.accent-\[var\(--accent-color\)\] {
340+
accent-color: var(--accent-color);
341+
}
336342
.opacity-\[var\(--opacity\)\] {
337343
opacity: var(--opacity);
338344
}

tests/arbitrary-values.test.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@
117117
<div class="delay-[var(--delay)]"></div>
118118
<div class="content-['hello']"></div>
119119
<div class="content-[attr(content-before)]"></div>
120+
<div class="accent-[#bada55]"></div>
121+
<div class="accent-[var(--accent-color)]"></div>
120122

121123
<!-- Balancing issues, this is not checking the validity of the actual value, but purely syntax-wise -->
122124
<div class="w-[do-not-generate-this]w-[it-is-invalid-syntax]"></div><!-- INVALID -->

0 commit comments

Comments
 (0)