Feature: Responsive styles whitelist mobile
See original GitHub issueIs your feature request related to a problem? Please describe. I wish I could just whitelist mobile instead of blacklisting the rest of the devices while I use the responsive prop.
Describe the solution you’d like If we would explicitly pass just one argument to the array of responsive styles it would mean that we want to apply this value only to the smallest breakpoint, eg: we got 3 breakpoints [mobile, tablet, PC] and we want to display hamburger menu only for mobile, instead of doing
display: ["block", "none", "none"]
we could do:
display: ["block"]
in the CSS media queries, the equivalent would be using:
@media only screen and (max-width: <mobile>)
Let me know what you think 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Responsive web design basics
Take a look at our complete course on Responsive Web Design—Learn Design. The use of mobile devices to surf the web continues to...
Read more >Implementing Application Feature Content Using Remote URLs
Use a whitelist if you allow a remote URL application feature to access container services and you want to restrict the list of...
Read more >What's New in Bootstrap 5 - SitePoint
It allows developers to easily use beautiful styles and components and create responsive websites. Using Bootstrap can save developers time, ...
Read more >Responsive design - Learn web development | MDN
It encompasses a number of CSS and HTML features and techniques and is ... A layout with two columns squashed into a mobile...
Read more >styled-system - npm
Responsive, theme-based style props for building design systems with ... All core function props accept arrays as values for mobile-first responsive styles.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Generally speaking the responsive array is meant to be “mobile first” (see https://styled-system.com/guides/array-props for some background). You might find the
@theme-ui/match-media
package to be a better fit for conditionally showing and hiding elements based on viewport width. I’d be open for more hooks-based APIs to explore your use-case, but I don’t think it would be a good idea to overload the responsive array values withmax-width
media queriesClosing since we’re not planning to implement.