-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 scripting
variants
#11929
base: next
Are you sure you want to change the base?
Add scripting
variants
#11929
Conversation
Hey thanks for this one! I do like to try and stay on the bleeding edge with what we support in Tailwind but since this isn’t even in Chromium yet I think I’d rather wait a bit longer before adding a first-class API for it and including it in the documentation. So going to close for now but let’s revisit when browser support improves a bit? |
Oh I should have pointed out I've just implemented this in Chrome. So it'll be in version 120. @adamwathan |
Absolutely fine if you'd still rather wait but yeah worth being aware as of November this should be in all 3 browsers :) |
Alright alright, will reopen 😅 Biggest blocker on all of these PRs for what it's worth is the immense documentation effort, but going to see if someone here can make time for it next week. |
That's absolutely fine, take as long as you need! |
Just as an fyi I chucked together a docs PR for the variant PRs tailwindlabs/tailwindcss.com#1674 No worries if you'd rather get someone to go through it all themselves just thought I'd give it a go in case it helped :) |
3add152
to
e99b0d6
Compare
In case if someone waiting this PR to be merged I've made temporary workaround based on custom media queries: theme: {
extend: {
screens: {
'noscript': { 'raw': '(scripting: none)' },
},
},
}, Usage: <div class="noscript:hidden">
Some JS dependant feature
</div>
<div class="noscript:block hidden">
no js detected sorry :(
</div> |
Alternatively https://github.com/lukewarlow/tailwind-mq includes it. |
Co-authored-by: Luke Warlow <luke@warlow.dev>
Hey! You might have noticed that I forced pushed to this branch. The reason is because the PR now uses The code is ported as-is, so no API changes of your feature happened while moving it to the new codebase. I also made sure to add you as a co-author because you still deserve all the credit 💪 |
https://caniuse.com/?search=scripting
|
This adds two variants for the
scripting
media query.noscript
for when JavaScript is disabled andscripting
for when it's enabled.