font size change

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Noelb
Regular
Posts: 33
Joined: Wed Jul 27, 2011 7:16 am

font size change

Post by Noelb » Wed Nov 08, 2017 2:22 am

Hey all,

Is there a way to global alter the default article text font size?
Preferably without editing a template? I think this would be a good option in configuration
(using default template)

- or I could really be going blind and have missed it ;)

Thanks

User avatar
Don Chambers
Regular
Posts: 3586
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: font size change

Post by Don Chambers » Wed Nov 08, 2017 7:05 am

Font size is determined by the theme you are using. You can alter this by modifying the theme, or providing a user stylesheet that alters the font.

User avatar
yellowled
Regular
Posts: 6906
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: font size change

Post by yellowled » Wed Nov 08, 2017 9:37 pm

Noelb wrote:Is there a way to global alter the default article text font size?
Yes, by using something called CSS (there is no way anyone could ever explain CSS in a forum post). The easiest and most fail-safe way to do that is by adding a new file called user.css to your theme's directory (/templates/<YOUR_THEME>/). That file will not be deleted or overwritten in case of an update.
Noelb wrote:I think this would be a good option in configuration
No. font-size will always be a theme-related value, it does not make sense to set that in the blog configuration. Setting it via CSS is very easy and much more flexible than a blog (or theme) option could ever be.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

Noelb
Regular
Posts: 33
Joined: Wed Jul 27, 2011 7:16 am

Re: font size change

Post by Noelb » Thu Nov 09, 2017 2:51 pm

yellowled wrote:
Noelb wrote:Is there a way to global alter the default article text font size?
Yes, by using something called CSS (there is no way anyone could ever explain CSS in a forum post). The easiest and most fail-safe way to do that is by adding a new file called user.css to your theme's directory (/templates/<YOUR_THEME>/). That file will not be deleted or overwritten in case of an update.
Noelb wrote:I think this would be a good option in configuration
No. font-size will always be a theme-related value, it does not make sense to set that in the blog configuration. Setting it via CSS is very easy and much more flexible than a blog (or theme) option could ever be.

YL
sending it in CSS is asking for it to be squashed on updates, no?
perhaps then the themes configuration should have this setting


(sorry for delay I am still not getting emails from the board on followups)

User avatar
yellowled
Regular
Posts: 6906
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: font size change

Post by yellowled » Mon Nov 13, 2017 10:43 pm

Noelb wrote:sending it in CSS is asking for it to be squashed on updates, no?
Not if you override the theme's font-size in a user.css as described above. Because the user.css file is not part of the s9y core, it will not get overwritten in an update.

So for example if your theme sets a font-size of 16px on the body element in its style.css, you can create a /templates/<YOUR_THEME>/user.css and in there write

Code: Select all

body {
    font-size: 20px;
}
Due to something that's called "the CSS cascade" (basically, the user.css gets read after the style.css), that will override the theme's setting.

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

Noelb
Regular
Posts: 33
Joined: Wed Jul 27, 2011 7:16 am

Re: font size change

Post by Noelb » Tue Nov 14, 2017 2:06 pm

yellowled wrote:
Noelb wrote:sending it in CSS is asking for it to be squashed on updates, no?
Not if you override the theme's font-size in a user.css as described above. Because the user.css file is not part of the s9y core, it will not get overwritten in an update.

So for example if your theme sets a font-size of 16px on the body element in its style.css, you can create a /templates/<YOUR_THEME>/user.css and in there write

Code: Select all

body {
    font-size: 20px;
}
Due to something that's called "the CSS cascade" (basically, the user.css gets read after the style.css), that will override the theme's setting.

YL
Thanks, creating this and setting it to 18px seems to be good :)

Post Reply