bootstrap and bootScore use SCSS variables — as we know. Grouping fonts is done by variables. And we can define two groups. This is sufficient if we want to use only two font families. But if we want to use extra fonts — for example, a special google font in our menus -, we need to do things differently:
To group fonts, the file bootstrap/_variables.scss
provides the variables $font-family-base
, $font-family-sans-serif
, $font-family-monospace
and $font-family-code
. A variable $font-family-serif
does not exist. If we overwrite family-base in our _bscore_variables.scss
file, we redefine the default. If we want to use a deviant font for our headings, we have to redefine the variables $headings-font-family
and $display-font-family
. This is sufficient if we want to use only two font families. Here is a way to use more groups:
Solution
- Define the variable
$menu-font-family: 'PT Sans', sans-serif, !default;
in your child theme filescss/_bscore_variables.scs
- Add the following lines to your child theme file
scss/_bsscore-custom.scs
:
#bootscore-navbar{
font-family: $menu-font-family;
}
.footerSubMenu {
font-family: $menu-font-family;
}
- Assign the new class to the widgets
Footer 1
toFooter 4
containing a menu list via<ul class="footerSubMenu">
.
Background
Again, briefly, about the need to do that:
Menus usually look better with sans-serif fonts. If we have already assigned a sans-serif font to the $font-family-base
variable, everything is fine. But if we have assigned a serif font and want to have a deviant font for our selectors, we must select a sans-serif font for the headlines and for the menus. bootScore has embedded the main menu into a div with the ID bootscore-navbar
. We can reuse that. But for the submenus in the footer area, we must define a corresponding class and assign it to the lists manually.
And how does this …
… support our migration to bootScore? Well, when the web designer has completed her work on good illustrations, she can relax and integrate tags and clouds into her site, improve her overview page and design her own landing page. Whether the resulting fullness really benefits her own reader, whether it can become slimmer and how, whether more discreet references and specific fonts also increase the readability, all this she should nevertheless consider while implementing these features. This post supports these steps towards a personalized bootScore site.