London Borough of Croydon Bootstrap 4 theme
Templates, design patterns and usage
Introduction
Why use Bootstrap 4?
Bootstrap 4 is a open source HTML and CSS framework. By customising Bootstrap's components we can create our own front end theme, documenting our markup practices and creating working web patterns along the way.
Cross platform compatability
All components in this theme have been configured using HTML5, Bootstrap CSS and pure Javascript. They do not require a JQuery Library or any Bootstrap JQuery to function.
Why pure CSS and 'vanilla' Javascript?
Global theme components that usually require JQuery to function have had their Bootstrap JQuery classes removed, and their functions replaced with a custom 'vanilla' Javascript equivalent:
- Main navigation mobile menu toggle
- Main navigation dropdown menu
- Expandable content
- Accordion menu
- Cookie alert bar and cookie creation
By using this 'vanilla' approach the global components will not be affected should Bootstrap JQuery , AngularJS or other coding languages be integrated into the theme.
Fonts and Fallbacks
The Croydon Council brand font Fiendstar Bold is used for display headlines and a handful of other elements, creating a unique identity:
Fiendstar Bold
- Site logo
- Headings (H1 - H6)
- Headings (H1 - H6)
- Main navigation links
- Button text
- Form labels
Embedded using @font-face
Source Sans Pro
- Copy
- As a fallback for Fiendstar
- Choose from weights: 400, 600, 700, 900
- Headings and form labels
- Button text
Embedded using Google Web Fonts
Defining fallbacks
Fiendstar Bold and fallbacks
font-family: "Fiendstar W01 Bold", 'Source Sans Pro', Arial,
Helvetica,
sans-serif;
font-weight: bold; /* For fallbacks only */
Source Sans Pro and fallbacks
font-family: 'Source Sans Pro', Arial, Helvetica, sans-serif;
font-weight: 300; /* 400, 700, or 900* /
Page master headlines
The page title (required) and descriptive paragraph (optional) should be placed inside a <header> tag and use the .key-under class:
Page title <h1>
Describe what the user can do or find on this page <p>
Use only once per page inside <main> > <header>
Page content sections
Where pages require multiple sections, content should be grouped in <section> tags. Sections have custom styles applied in the theme to visually break up the layout, as well as carrying their HTML5 semantic meaning.
Each content section typically starts with a <h2> heading and can contain nested sections to group sub content:
First level section heading <h2>
Paragraph in the first level section
Second level section heading <h3>
Paragraph in the second level sub section
Headings
Sizing and usage for <h1> to <h6> heading tags:
Page title <h1>
Use only once per page in the <main> > <header>
Section heading <h2>
Use for clearly defined sections inside <main> and for headings in the sidebar
Sub section heading <h3>
Use for sub sections of <h2>
Sub section heading <h4>
Use for sub sections of<h3>
Sub section heading <h5>
Use for sub sections of <h4>
Sub section heading <h6>
Use for sub sections of <h5>