New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: rem vs. em #492
Comments
This is only my answer, @dam or @GarthDB might know better. It's because of the BEM (block element modifier) pattern that Topcoat uses as a CSS pattern.
Chances are you are going to need that small component someplace else in the future, either way it's an extra 5-6 lines of CSS with the benefit of having a static component that won't change if you move it around. |
Its sounds like a different philosophy than the original css one about inheritance from parents etc. |
Also the only issue you might get with em is when some parent container has different font size than you expect. This shouldn't be hard to find/fix. Its a kind of making component more robust in size by sacrificing flexibility. |
Which is also kind of not web/css philosophy. |
probably there is a way to make it configurable. Using em for sizes, but setting font-size on every component explicitly using variable. This way 1. every component has robust size, 2. one can adjust size by just setting font-size on the component container, or even change the variable font-size value to "inherit" |
Oleg, The goal of the default theme is for the components to be the same regardless of the styles applied to the parent. It is safer and less complicated for a larger user base, but your right, there are times you want something different, in those cases you should alter the theme to fit your project's needs. |
We went through the options and have discussed the benefits of both. After weighing the options we decided on rems for exactly the reasons @piatra mentioned. By using rems we have a more universal usable component set by default. I would encourage a custom theme for anything different. On Mon, Apr 7, 2014 at 6:00 AM, Oleg Slobodskoi notifications@github.com
|
thanks. |
Hi
Just a question, why are you using rem and not em.
From my understanding: rem is relative to font size of html element, em is relative to font size of parent element.
Example:
If you build a button widget, sometimes you want to have it smaller in some particular view, not everywhere, but you can't do this using font size on the container in the particular view if rem is used, also you won't change the font size of html, so I need to specify sizes directly on button elements.
The text was updated successfully, but these errors were encountered: