-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add display-mode variants for pwa #20199
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1206,6 +1206,13 @@ export function createVariants(theme: Theme): Variants { | |
| staticVariant('any-pointer-coarse', ['@media (any-pointer: coarse)']) | ||
| staticVariant('any-pointer-fine', ['@media (any-pointer: fine)']) | ||
|
|
||
| staticVariant('standalone', ['@media (display-mode: standalone)']) | ||
| staticVariant('minimal-ui', ['@media (display-mode: minimal-ui)']) | ||
| staticVariant('browser', ['@media (display-mode: browser)']) | ||
| staticVariant('fullscreen', ['@media (display-mode: fullscreen)']) | ||
| staticVariant('picture-in-picture', ['@media (display-mode: picture-in-picture)']) | ||
| staticVariant('window-controls-overlay', ['@media (display-mode: window-controls-overlay)']) | ||
|
Comment on lines
+1209
to
+1214
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Existing multi-value media features prefix variant names with the property: Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
|
|
||
| staticVariant('noscript', ['@media (scripting: none)']) | ||
|
|
||
| return variants | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fullscreenname will collide with a:fullscreenpseudo-class variantfullscreenalready exists as a widely-supported CSS pseudo-class (:fullscreenfrom the Fullscreen API). These two concepts are semantically different:@media (display-mode: fullscreen)detects a PWA installed in fullscreen mode, while:fullscreentargets any element that entered fullscreen viaelement.requestFullscreen(). If Tailwind later adds the:fullscreenpseudo-class variant—which is a natural addition—both would claim thefullscreen:prefix, causing a breaking conflict. The other display-mode variants (following thepointer-none/any-pointer-coarseprecedent) suggest adisplay-mode-fullscreenname would be unambiguous.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!