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

Missing DEFAULT option for ringOffsetWidth and ringOffsetColor #2911

Closed
rafaberaldo opened this issue Nov 26, 2020 · 3 comments · Fixed by #2951
Closed

Missing DEFAULT option for ringOffsetWidth and ringOffsetColor #2911

rafaberaldo opened this issue Nov 26, 2020 · 3 comments · Fixed by #2951

Comments

@rafaberaldo
Copy link

Describe the problem:

Trying to set a default ring with offset doesn't work.

Link to a minimal reproduction:

https://play.tailwindcss.com/hNYXW0Qzj9

@simonswiss
Copy link
Contributor

simonswiss commented Nov 26, 2020

Hey! 👋

There is no offset specified in your Play example, only the ring itself (defaulting to 3px).

The actual "default" for ring-offset is no offset. We make the assumption that there should be no offset, unless explicitly specified. The default color for ring offset is white. 👍

If you add a ring-offset-2 for example, the ring will be offset by 2 pixels, as expected:

https://play.tailwindcss.com/W4SSmpZj4h

@rafaberaldo
Copy link
Author

rafaberaldo commented Nov 26, 2020

I'm aware of that, is it normal to use 4 classes for a ring? I thought we could setup defaults for the 4 elements of ring and use a single focus:ring class, otherwise the classes are gonna be huge, e.g. focus:ring-2 focus:ring-green-500 focus:ring-offset-2 focus:ring-offset-gray-800.

Nothing that can't be solved with @apply, just thought it would be a nice thing to have.

@adamwathan
Copy link
Member

This is a valid request, will play with this more at some point soon and see if it makes sense to make it work this way 👍🏻 Thanks for bringing it up!

RobinMalfait added a commit that referenced this issue Nov 30, 2020
adamwathan pushed a commit that referenced this issue Dec 2, 2020
* add ring defaults

Fixes #2911

* add tests for the ringWidth utility

+ defaults

* update changelog
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 a pull request may close this issue.

3 participants