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

Add accent-color utilities #5387

Merged
merged 2 commits into from
Sep 8, 2021
Merged

Conversation

lukewarlow
Copy link
Contributor

This PR adds utilities for the accent-color property.

Example usage:

<input type="checkbox" class="accent-red-500">

@lukewarlow
Copy link
Contributor Author

lukewarlow commented Sep 4, 2021

As this only has support in 2/3 browser engines, I understand this may not be merged soon.

Here's the accent-color utilities in plugin form: https://github.com/lukewarlow/tailwind-accent-color

@lukewarlow
Copy link
Contributor Author

The test is failing locally but the css output doesn't make much sense to me, seeing as this is basically a direct copy of the caret color plugin.

image

@lukewarlow lukewarlow changed the title Add accent-color utilities Add accent-color utilities Sep 4, 2021
return function ({ matchUtilities, theme, variants }) {
matchUtilities(
{
caret: (value) => {
Copy link
Member

Choose a reason for hiding this comment

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

This right here is why the tests are failing, you are telling Tailwind to match classes starting with the word "caret" when it should be "accent" 👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦 That'd certainly do it. Fixed now.

@@ -172,6 +172,7 @@ module.exports = {
none: 'none',
},
caretColor: (theme) => theme('colors'),
accentColor: (theme) => theme('colors'),
Copy link
Member

Choose a reason for hiding this comment

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

Should probably include auto as a value here in addition to all of the colors:

https://developer.mozilla.org/en-US/docs/Web/CSS/accent-color#values

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

@adamwathan adamwathan merged commit 51f71af into tailwindlabs:master Sep 8, 2021
@adamwathan
Copy link
Member

Thanks @lukewarlow!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants