Skip to content
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

Add pxtorem #91

Merged
merged 6 commits into from
Sep 3, 2017
Merged

Add pxtorem #91

merged 6 commits into from
Sep 3, 2017

Conversation

xcatliu
Copy link
Member

@xcatliu xcatliu commented Sep 1, 2017

No description provided.

@ghost
Copy link

ghost commented Sep 1, 2017

It seems font size is seted to 18px in desk? Why?

@xcatliu
Copy link
Member Author

xcatliu commented Sep 2, 2017

@zmrenwu
I'm still thinking about the need to set different font-size in mobile and desktop. And whether we need to use rem.

@xcatliu
Copy link
Member Author

xcatliu commented Sep 2, 2017

The pros to use rem is to easily change all size via root font-size, it's widely used in mobile webpages, like http://taobao.com
If we don't need to change size along with viewport size, then we don't have to use rem.

@ghost
Copy link

ghost commented Sep 2, 2017

@xcatliu Bootstrap4 beta only set font-size to 1rem for body. I think the browser would set root font size, typically 16px for desk, 12px for mobile though I doesn't do a survey to ensure it. But altering px to rem is pretty nice.

Further more, bootstrap4 beta has a lot of useful utilities to help layout easily, such as m or p for margin and padding setting and so on. Any idea of adding such plugins?

And, it seems flex plugin of mobi.css miss some flex box features, such as justify content between or align items themself in a flex box.

@xcatliu
Copy link
Member Author

xcatliu commented Sep 3, 2017

@zmrenwu You're right, I‘ve read the usage of rem again. We shouldn't set the font-size to html. It should be set by user-side.

For example, in chrome we have a setting option which can change the font-size of webpage. It'll not affect our page if the html element is set to a fixed px value.

So the right choice is leave html style empty, and set other font-size with rem

Utilities plugin is considered a third-party plugin. It'll not be included in the official Mobi.css bundle.

The flexbox plugin could be a lot better. Thanks for you advice, I'm considering add this feature

@xcatliu xcatliu merged commit 050127f into master Sep 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant