Giter Site home page Giter Site logo

Comments (4)

paulcollett avatar paulcollett commented on June 20, 2024

Hi @equinusocio, I'm curious to the reasoning behind this - is it because your project uses a "mobile first" breakpoint philosophy?

Also, how could you see this being implemented into Masonry (ie. what props / interface would this component have to support this)? Thanks!

from react-masonry-css.

equinusocio avatar equinusocio commented on June 20, 2024

Yes, I follow mobile-first approach with custom breakpoints. Right now I have to set the default columns to be the highest number of columns i need. Like this:

columns: {
    default: 6,
    980: 5,
    740: 4,
    480: 3,
    320: 1,
  }

Is a bit "controversial" when you work with mobile-first, where I would set the default number of columns to be the smallest one, on mobile:

columns: {
    1400: 6,
    980: 5,
    740: 4,
    480: 3,
    default: 1,
  }

Maybe a simple boolean prop like mobileFirst would be enought

from react-masonry-css.

EricWVGG avatar EricWVGG commented on June 20, 2024

"controversial"? Mobile-first has been recognized as the "right way" for like fifteen years.

The reasoning, incidentally, is that when you go desktop first, the browser has to summarize the styles from the default values first, then the next largest, then the next largest, down the line until you get to the "small" screen.

That's more computation than "start from the default values, then stop because every succeeding query is bigger than you." Given that phones are more power-constrained than larger ones, it's more power and CPU efficient.

from react-masonry-css.

equinusocio avatar equinusocio commented on June 20, 2024

"controversial"? Mobile-first has been recognized as the "right way" for like fifteen years.

The reasoning, incidentally, is that when you go desktop first, the browser has to summarize the styles from the default values first, then the next largest, then the next largest, down the line until you get to the "small" screen.

That's more computation than "start from the default values, then stop because every succeeding query is bigger than you." Given that phones are more power-constrained than larger ones, it's more power and CPU efficient.

That's why setting desktop first breakpoints on this lib is controversial. But it seems abandoned like many other libs.

from react-masonry-css.

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.