Support any arbitrary value for accentColor

This commit is contained in:
Adam Wathan 2021-09-07 21:12:57 -04:00
parent 51f71af62c
commit a5425abd86
3 changed files with 9 additions and 1 deletions

View file

@ -12,7 +12,7 @@ export default function () {
{
values: flattenColorPalette(theme('accentColor')),
variants: variants('accentColor'),
type: 'color',
type: ['color', 'any'],
}
)
}

View file

@ -333,6 +333,12 @@
.placeholder-opacity-\[var\(--placeholder-opacity\)\]::placeholder {
--tw-placeholder-opacity: var(--placeholder-opacity);
}
.accent-\[\#bada55\] {
accent-color: #bada55;
}
.accent-\[var\(--accent-color\)\] {
accent-color: var(--accent-color);
}
.opacity-\[var\(--opacity\)\] {
opacity: var(--opacity);
}

View file

@ -117,6 +117,8 @@
<div class="delay-[var(--delay)]"></div>
<div class="content-['hello']"></div>
<div class="content-[attr(content-before)]"></div>
<div class="accent-[#bada55]"></div>
<div class="accent-[var(--accent-color)]"></div>
<!-- Balancing issues, this is not checking the validity of the actual value, but purely syntax-wise -->
<div class="w-[do-not-generate-this]w-[it-is-invalid-syntax]"></div><!-- INVALID -->