9 Settings
9.1 Breakpoints RWD
Description
Colette provide a collection of breakpoints and media queries, available in a $breakpoints
hash.
We handle 3 default primary breakpoints and related media queries:
$breakpoints-main ?= {
'sm': "screen and (min-width: 420px)"
'md': "screen and (min-width: 768px)"
'lg': "screen and (min-width: 960px)"
}
We can also define secondary breakpoints within the $breakpoints-tweak
collection (which is empty by default).
Colette allows you to:
- change primary breakpoints by updating the
$breakpoints-main
within your stylesheet, - and/or define additional breakpoints by filling the
$breakpoints-tweak
.
Both collections are merged within $breakpoints
.
Usage example
/* stylus file */
@media $breakpoints.lg
// styles
will compile to
/* CSS file */
@media screen and (min-width: 960px)
/* styles */
9.2 Colors
Description
Every colors in this Colettes are variables. Each of these stylus variables are then associated with a css variable. Prefer using a css variable and overwrite the stylus variable if necessary.
9.2.1.1 Dark equivalent
Description
The values $color-foreground-*-dark
are in fact generated. The original value is inverted and lightened at 41%:
$color-foreground-*-dark ?= lighten(invert($color-foreground-*), 41)
The values $color-background-*-dark
are also generated. The original value is darkened at 79%:
$color-background-*-dark ?= darken($color-background-*, 79)
9.2.5 Theme colors
Description
The color palette is based upon 20 Minutes editorial color chart:
- each editorial section has a related color
- we use section names as aliases to define color variables and classes names
- this colors should respect at least a 4.5 (
$contrast
) ratio relatively to white - if ratio is insufficient some modules add a text-shadow or swith to a darker color
9.2.5.1 Dark equivalent
Description
All these colors are set with the same color as $color-theme-default-dark
. It's however possible to set a color fo each theme by adding the suffix -dark
on it.
For exemple, $color-theme-sport
will have it's equivalent value $color-theme-sport-dark
9.3 Fonts
Description
All fonts in the project are set within variables.
Parameters
$fontstack-base ?= 'Helvetica Neue', Helvetica, Arial, sans-serif
: default font / body text
$fontstack-headings ?= 'Open Sans WebFont', 'Arial', 'Helvetica Neue', Helvetica, sans-serif
: headings
$fontstack-secondary ?= 'Open Sans WebFont', 'Helvetica Neue', Helvetica, sans-serif
: call to action, pagers… etc.
9.3.1 Fontfaces
Description
$fontface
is an hash import from $fontface-file
path of a json.
9.3.2 Font loading strategy
Parameters
$fontload ?= optional
: value for font-display
property.
$fontload-js ?= true
: true if you choose js solution integrated to Colette
$fontload-class ?= 'webfont'
: className added to <html>
when fonts are loaded
9.4 Grid
Description
Gutter width is used for vertical rhythm.
Parameters
$grid-columns ?= 12
: number of columns
$grid-gutter ?= 12px
: gutter width is converted to rem
unit
9.5 List
Parameters
$list-columns ?= 4
: number max of columns in list
9.6 Media Placeholder
Description
SVG basic settings
Default svg value for the logo:
$mediaPlaceholder: '../../svg/logo.svg'
Default svg style for the logo:
$mediaPlaceholder-style: '
path
fill rgba(255, 255, 255, .5)
'
9.7 Z-Index
Description
Colette provides 3 default z-index
$zIndex ?= {
base: 1
overlay: 10
layout: 20
modals: 30
}
Usage example
/* stylus file */
.foo
z-index: zIndex.layout + 4
will compile to:
/* CSS file */
.foo
z-index: 24