Comments (8)
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.
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.
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
from react-styled-flexboxgrid.
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.
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.
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.
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.
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)
- Version 10 of node.js has been released HOT 1
- Row props overwriting one another. HOT 4
- Difference between container and breakpoints. HOT 1
- Unexpected use of '~' in Col.js HOT 1
- Support emotion
- first & last should be Col props
- An in-range update of webpack is breaking the build 🚨 HOT 2
- An in-range update of styled-components is breaking the build 🚨
- Order of attributes xs and sm matter? HOT 3
- Error in emotion HOT 1
- Cannot replace `em` or `rem` with `px` HOT 2
- 3.0 in npm? HOT 1
- yarn add package - FAILURE
- react-emotion has been replaced by @emotion/styled HOT 3
- Please add xl property like bootstrap has HOT 4
- width vs max-width HOT 2
- fluid and width usage HOT 2
- i guess lodash.isinteger package is redundant
- Is this lib DEAD?! HOT 2
- Package does not allow React 17 as a peer dependency HOT 1
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 react-styled-flexboxgrid.