-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
RFS (Responsive font size) implementation #23816
RFS (Responsive font size) implementation #23816
Conversation
@mdo: what do you think about this? |
Thanks for keeping this up to date. I'm slating this for sure for 4.1, but I'll see if we should put it into 4.0 depending on a few other things. |
Update: Minimum font-size is also increased to |
|
This is all voodoo to me, but one request: make sure that even if using |
@patrickhlauke, It's possible to add the Also, the font size is never purely related to viewport. |
There are several ways to implement this depending on what should be the default value for In the current implementation I've set Another approach is to use |
@MartijnCuppens, why not a |
@vladimirmartsul, that might be a good idea. This wouldn't cause a lot of changes by default while developers can still easily enable responsive font sizes if they want to. |
I discovered changing the padding of buttons and inputs from I'll try to implement RFS in a way that it wouldn't have any influence on the current Bootstrap at all when it's disabled. |
I've now disabled the responsive font sizing by default so that the css files are exactly the same (apart from property order). Responsive font sizing can be enabled with |
Hi @MartijnCuppens, thanks for another great PR. I think that responsive font sizing is a killer feature to have. My worried is that what this feature asks contributors might outweigh its value. Once we merge it we'll be asking contributors to include It'll be up to @mdo to decide if he wants this feature in Bootstrap or not. If we decide to add it I think we should either have a very strong linter or some kind of postCSS that automatically adds the artifact around the font size declarations. |
@andresgalante, at this moment there's also a I've also added the |
f7c0d38
to
eadf3c2
Compare
This is really slick. One of my pet peeves is that I always want fonts on my phone to be bigger, not smaller. I like the limits placed here on the sample site, they seem reasonable and I like that there's a variable for setting the minimum. Well done. |
a7250be
to
cc87c5e
Compare
3981f4a
to
fa1e091
Compare
fa1e091
to
3fdcb9b
Compare
0d0ed02
to
143f3b8
Compare
Never thought I would merge this myself, thanks a lot Bootstrap community ❤️ |
Just updated to I use this custom I am confused because I add this When I inspect it, it looks like outputting the SASS. |
Hi @weilinzung, Bootstrap now uses the |
Is there a compiled css on the cdn with rfs enabled? |
No, because there's no official build with the option enabled. |
@MartijnCuppens Maybe change the custom mixins to not using |
@MartijnCuppens Also, what is the official way to do responsive fonts then? Any new Dos? |
@weilinzung, |
@MartijnCuppens What if the sizes are not what I want that from the automatic rescaling on smaller devices? This is a really good feature, but also what about @mdo |
@weilinzung, we want to provide a solution that works out of the box without the need of further configuration. If you want you own implementation of the font sizes you can overwrite the mixin in your own custom configuration. I'm going to lock the conversation on this PR because it we're deviating from the subject of it. |
Fixes #23053
$enable-responsive-font-sizes
font-size
-properties are switched to the@include font-size()
-mixin. Stylelint prevents the usage offont-size
property.Demo with RFS enabled available here (this is not the default behaviour, but would be the behaviour if
$enable-responsive-font-sizes
wastrue
): https://project-rfs.github.io/TODO:
$input-height-sm
and$input-height-lg
> no