Purpose
This task defines a consistent pattern for font-family variable names in Less files that have been started with WikimediaUI Base.
Vector, Minerva skins use this naming convention already, with a few inconsistencies: codesearch.
Changes
Renamed variable:
- @font-family-heading-main -> @font-family-heading
The rename has no effect: this variable is redeclared by its sole user: codesearch.
Renamed system font stack definitions, following the pattern of @font-family-system-sans (line 201):
- @font-family-serif -> @font-family-system-serif
- @font-family-monospace -> @font-family-system-monospace
The renames have no effect: the variables with the old name are defined with (defaulted to) the renamed variables. Users of these variables: -serif, -monospace..
Skins, extensions using these definitions can redefine @font-family-serif, etc. by extending or replacing @font-family-system-serif, etc.
Previously only replacing @font-family-serif was possible, extending it was not.
Result, summary
@font-family-system-sans // WikimediaUI Base sans-serif font stack @font-family-system-serif // WikimediaUI Base serif font stack @font-family-system-monospace // WikimediaUI Base monospace font stack // The 'system' part in these names signals these fonts are typically installed by the operating system. @font-family-sans // Skin's / extension's sans-serif font stack @font-family-serif // Skin's / extension's serif font stack @font-family-monospace // Skin's / extension's monospace font stack // These variables can be redefined by skins and extensions, extending upon the system stack, or replacing it. // The default values are the respective `-system-` font-stacks. @font-family-sans--fallback: sans-serif; @font-family-serif--fallback: serif; @font-family-monospace--fallback: monospace, monospace; // Monospace fix: http://code.iamkate.com/html-and-css/fixing-browsers-broken-monospace-font-handling/ @font-family-base // Font stack for content body @font-family-heading // Font stack for headings (h1-h6)
Documentation
The font stack definitions - each individual font - are commented with the system where it's expected to be available and the reason to include or exclude it.
Questions
- Any comments about the renames?
- Should the font stack definitions be moved into a separate file? What file name to choose?