Code Monkey home page Code Monkey logo

Comments (8)

LoicMahieu avatar LoicMahieu commented on May 11, 2024 2

Hi
First, thanks for your feedback.
The motivation behind #13 has not been explain and it's a shame ;) I didn't handle it directly so I can't explain clearly why we did this. I wasn't confortable with the fact to go to pixels values too.

I will come back here next week with the explanation and we will discuss about it.

from react-styled-flexboxgrid.

mschipperheyn avatar mschipperheyn commented on May 11, 2024 1

Perhaps you could add the breakpoint unit type to the theme definition so that people can customize it, if they want that, but otherwise functionality is preserved

from react-styled-flexboxgrid.

tlvenn avatar tlvenn commented on May 11, 2024

As illustrated in the following article, em should be used in breakpoints to work properly cross-browser and support users changing their browsers font-size

https://zellwk.com/blog/media-query-units/

from react-styled-flexboxgrid.

zentuit avatar zentuit commented on May 11, 2024

If you read the comments in that article, you'll see evidence from folks that the author is incorrect in his conclusions - specifically the Safari not reporting px the same as the other browsers when zooming. If you look at the animated gif in his article, you'll see that the px test matches the other browsers' tests; its the em/rem tests that differ on Safari. Px based queries get consistent results across browsers when zooming.

I just tested this on Chrome and Safari and both Chrome and Safari's media query with px behave the same. You can try with http://codepen.io/blyne/pen/mPwmvX (I changed from the 400px/25em/25rem to 640px/40em/40rem)

from react-styled-flexboxgrid.

tlvenn avatar tlvenn commented on May 11, 2024

Good point @zentuit , i have overlooked the comments.

A media query using em or rem (e.g. max-width) is based on the size of the viewport.
The viewport isn't affected by the elements inside of it even if the elements are larger than the viewport.
CSS gives us control over the font sizes of the elements, but not the viewport.

I guess that would explain the switch from em to px ?

from react-styled-flexboxgrid.

mschipperheyn avatar mschipperheyn commented on May 11, 2024

Let's also not forget that this library is supposed to be a react implementation of flexboxgrid, which clearly goes the "em" way

from react-styled-flexboxgrid.

splars avatar splars commented on May 11, 2024

Thanks for creating this lib, I think it's really easy to use. Is there any plan to deal with this issue?

from react-styled-flexboxgrid.

LoicMahieu avatar LoicMahieu commented on May 11, 2024

Sorry to being back late.
@mschipperheyn @splars I agree with you, this library is supposed to be kind of port of flexboxgrid and I want to follow their implementation.

I reverted the commit in #35 and it is published v1.1.0

Thanks

from react-styled-flexboxgrid.

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.