[SOLVED!] Use "em" for font sizer
Posted
#7058
(In Topic #1922)

Standard member

The font sizer affects font sizes. I wanted to change my fonts from how they were to using "em" for even better responsability to differnt resolutions and screen sizes. Of course the better might be using rem, but that requires a little more work and I think em works just fine. Anyways.....
I went into the font sizer tpl file and noticed that it just gives numbers but no way to indicate the unit being used. I thought maybe it would reference a different css file or line, but have yet to find it.
So great ones, how can I change the font sizer to use ems instead. I'd like to go for something like 0.5 em, 1 em, and maybe 1.25 or 1.5 em. Not sure yet until I play around with it. Or will I have to somehow disable it?
Thanks in advance.
Last edit: by mythus
Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!
"Those who want help should first be willing to give help."
Posted

Standard member

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!
"Those who want help should first be willing to give help."
Posted

Site director

Code
function set_font_size(size)
{
var old_size=read_cookie('font_size');
var old_sizer=document.getElementById('font_size_'+old_size);
if (old_sizer) old_sizer.className=old_sizer.className.replace(/ selected/g,'');
document.body.style.fontSize=size+'px';
set_cookie('font_size',size,120);
var new_sizer=document.getElementById('font_size_'+size);
if (new_sizer) new_sizer.className+=' selected';
}
(No need to reply unless you wanted to, I just wanted to check this myself too)
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Posted

Standard member

Code
.font_sizer_small {
font-size: 0.5em;
}
.font_sizer_medium {
font-size: 1em;
}
.font_sizer_large {
font-size: 1.5em;
}
That makes me wonder if it did anything at all, or only changed the little font sizer icons instead of actually doing what I set out to do. Hmm lol.
Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!
"Those who want help should first be willing to give help."
Posted

Site director

Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
1 guest and 0 members have just viewed this.