Giter VIP home page Giter VIP logo

Comments (4)

brad-decker avatar brad-decker commented on July 17, 2024 1

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.

richTheCreator avatar richTheCreator commented on July 17, 2024

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.

AriLFrankel avatar AriLFrankel commented on July 17, 2024

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.

iamdavid0091 avatar iamdavid0091 commented on July 17, 2024

👍

from styled-material-components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.