Comments (4)
RichardM [4 minutes ago]
but it also doesn't let us enforce a strict material spec as we become more compliant to spec.
could you please explain this? (edited)
@richTheCreator answering here to keep a permanent record of conversation for public benefit.
By allowing the end user to declare their own breakpoints we have to support a much wider set of features. Right now there is no guarantee the end user will use our keys, for example. So columns and rows have to accept props for whatever keys the user defines for their breakpoints. It also means we limit our ability to implement components in strict compliance with material design because the end user can mutate the media queries. So if material spec says a button should have a specific gutter at a specific resolution we can put those defaults in but we introduce the ability for a poor user (developer) experience when they go to customize the breakpoints.
I think i'm in favor of tightening the scope of the theme and what we really allow users to change.
from styled-material-components.
Thanks for the explanation @brad-decker. Makes sense! Excited to see how this would lower the overhead for responsiveness out of the box.
from styled-material-components.
Regarding screenSizeConsumer, I am a fan of the idea of using material compliant breakpoints for all three of the reasons @brad-decker mentioned. I totally support enforcing material standards, and I think that the more powerful API that this allows us to expose is a huge win. Also great to make the grid more performant by being able to do a pure CSS implementation.
Regarding withScreenSize and our current responsive strategy, I did an audit of our usage of withScreenSize. Definitely possible that I'm missing some use cases, but it seems like our use cases across our org's code fall into two broad categories:
Applying mobile styles intended for mobile screen size and/or conditionally displaying elements
For mobile styles, Those are a light lift to reword as media queries
For conditionally displaying elements on mobile screens, those can use this pattern instead, using display
in combination with media queries
I like @brad-decker's idea of exposing material compliant breakpoints on SMC in some way. I think mobile
, tablet
, and desktop
media queries or as a styles mixin could be a cool way to do that.
Functionality that is platform specific, not screen size specific
Since these are intended to relate to platform and not screen size, it seems like these could be well served by a withPlatform
enhancer separate from withScreenSize. We could break out the platform.js logic into its own HOC.
see here for examples of these patterns
from styled-material-components.
👍
from styled-material-components.
Related Issues (20)
- iOS 11 Text field cursor jumping issue in all modals
- Update box shadow of Card component
- styles for rows or individual cells HOT 2
- TypeScript support HOT 1
- Add list of currently supported / not supported material components to the readme HOT 1
- Cannot read 'property' of undefined HOT 1
- Eliminate Background Scrolling on Fullscreen dialog Component HOT 2
- [TextField] Accept onkeyDown prop
- TabIndex in Menu
- Dialog component misspelled
- Bottomsheet animation is not currently working as intended and style updates
- On mobile devices where width is 320px or less, the side nav drawer is taking up the whole screen
- Allow onClick handler for Card component
- Fix switches onHover state
- Button ripples not rendering correctly HOT 1
- SMC Regressions in master branch HOT 15
- Menu renders an incorrect location
- Allow Dialog to close on outside click
- Button Menu: Edge (17): menu not opening to available space
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from styled-material-components.