Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter Bootstrap - Use serif fonts

I'm using Twitter Bootstrap for a site design and I would like all of the display fonts to use serif (rather than the default sans-serif) font faces. Is there some way to do this without having to recompile via LESS? I would really like to avoid learning LESS for something this basic.

like image 857
Judson Avatar asked Jul 06 '12 11:07

Judson


People also ask

How do I use different fonts in bootstrap?

Importing Your Web Font After you extract the zip file you generated above (or if you already have a webfont), right click the Fonts group in Bootstrap Studio and choose Import Webfont . In the file browser, navigate to the webfont and select the css file in the folder.

What is bootstrap default font-family?

Bootstrap 4 Default Settings The default font-family is "Helvetica Neue", Helvetica, Arial, sans-serif.

What does it mean to use the native font stack?

Native font stackThis font-family is applied to the <body> and automatically inherited globally throughout Bootstrap. To switch the global font-family , update $font-family-base and recompile Bootstrap.

How do you use font-family?

Start with the font you want, and always end with a generic family, to let the browser pick a similar font in the generic family, if no other fonts are available. Note: Separate each value with a comma. Note: If a font name contains white-space, it must be quoted.


2 Answers

If you don't mind changing the bootstrap.css, do a find & replace on:

"Helvetica Neue", Helvetica, Arial, sans-serif;

replace with:

Georgia, "Times New Roman", Times, serif;

If you don't want to do that, add this code to your custom CSS to override Bootstrap's.

body,
input,
button,
select,
textarea,
.navbar-search .search-query {
  font-family: Georgia, "Times New Roman", Times, serif;
}
like image 86
Terry Avatar answered Sep 20 '22 17:09

Terry


You have to change the LESS variable @baseFontFamily, it's default value is @sansFontFamily you juste have to set it to @serifFontFamily.
If you don't want to use LESS you can still change those variables in the Customize menu in the docs.

like image 24
Calvein Avatar answered Sep 17 '22 17:09

Calvein