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 :read-only variant #4102

Merged
merged 9 commits into from May 11, 2021
Merged

Add :read-only variant #4102

merged 9 commits into from May 11, 2021

Conversation

ghost
Copy link

@ghost ghost commented Apr 18, 2021

Closes #3136

This PR implements the :read-only variant. It is not enabled by default for any utilities.

Detail

This variant uses the the :read-only CSS pseudo-class represents an element (such as input or textarea) that is not editable by the user.

Browser support is good.

FunnyScarf and others added 6 commits April 18, 2021 13:49
* Add background-origin utilities

* Update fixtures

* Update basic usage test

* Change sort order for background origin

* Move background origin after other background properties
@adamwathan adamwathan force-pushed the master branch 2 times, most recently from c681549 to 23b71a9 Compare April 23, 2021 18:29
@adamwathan
Copy link
Member

Hey sorry messed this up with some rebasing and force pushing but happy to get this added if you don't mind cleaning it up.

Only thing to figure out is where it belongs in this list:

https://github.com/tailwindlabs/tailwindcss/blob/master/stubs/defaultConfig.stub.js#L802-L817

That list determines which variants get precedence over which others, so for example focus will trump hover.

@ghost
Copy link
Author

ghost commented May 8, 2021

I've fixed all conflicts and merged code with current master.

Only thing to figure out is where it belongs in this list

I think that read-only should be placed after empty. In most cases you should be able to see 'hover' or 'focus' state on read-only inputs.

@adamwathan
Copy link
Member

Yeah sounds good, let's add it to that spot then 👍🏻

@ghost
Copy link
Author

ghost commented May 11, 2021

Done :)

@adamwathan adamwathan merged commit f89bf5f into tailwindlabs:master May 11, 2021
@ghost ghost deleted the add-readonly-variant branch May 24, 2021 18:40
@ScreamZ
Copy link

ScreamZ commented Aug 21, 2021

@FunnyScarf @adamwathan Thanks for it, I guess it would have been possible out-of-the-box with JIT compiler. In the meantime that's fine ;)

Just noticing, this is now missing at https://tailwindcss.com/docs/hover-focus-and-other-states nothing severe but I just wanted to notify it for any further patch (sorry no time to make a PR for this right now :()

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

Successfully merging this pull request may close these issues.

Read only variant
3 participants