Variables

CSS VariablesCustomizablehsla

Spectre.css is designed with consistent design language. You can use your variables to create your new or match an existing design. All Sass variables defined in the src/variables folder include the !default flag. You can redefine the variables to override the values.

Almost all Sass variables have equivalent CSS variables defined in the same naming pattern as Sass variables to persist consistency but with an additional customizable prefix. They are used in styles instead of Sass variables if possible.

Good to know:
  • Styles are using CSS variables, except in some cases.
  • Sass variables are used mostly only to initialize equivalent CSS variables.
  • CSS variable names are being set in the same Sass variable naming pattern for consistency.
  • CSS variables are set with an additional customizable prefix.
  • There are Sass variables that don't have CSS variables, but they are used in the creation of their names.
  • Spectre.css has the first approach to the Dark and light theme.
  • CSS color variables are created from the property values of the dark and light themes.
  • Hex color has four CSS variables with an additional CSS variable for adjusting color base lightness.
  • There are common Sass variable colors for both dark and light themes.
  • When changing the values of the base CSS colors, the derived CSS colors change on the fly.
  • Colors are being inserted by the color() function in the hsla form.
  • CSS variable name suffix of the color hue, saturation, lightness, and alpha are customizable.
  • Derived color variables are only used in the background classes and they exist for backward compatibility.

Variables - Hex colors

Spectre.css colors are specified under Sass variables, some of them with hex values, the rest depends on them through the use of darken() and lighten(). The following table contains colors defined with the specific hex.

These are the common colors used in the dark and light theme except the $dark-color and $light-color. If the $primary-color is changed then it changes in both dark and light theme. To change the $primary-color only for the dark or light theme update the map value of the $theme-dark or $theme-light.

Sass variable Default value Dark theme Light theme Hex
$accent-color #9932CC
$code-color #d73e48
$dark-color #303742
$error-color #e85600
$light-color #FFFFFF
$highlight-color #ffe9b3
$info-color #d9edf7
$primary-color #5755d9
$success-color #32b643
$warning-color #ffb700

Learn how to customize hex colors.

Customize

Variables - Derived colors

Derived colors are the hex colors with modified lightness or darkness by the lighten() or darken() function, or directly assigned hex colors. The following table contains derived colors from hex colors.

These colors are only used in the background color variants creation for checking the lightness of the specific CSS variable color, to set the color style with the light color. They are here for backward compatibility.

Sass variable Default value Hex
$bg-color lighten($dark-color, 75%) #f7f8f9
$bg-color-dark darken($bg-color, 3%) #eef0f3
$bg-color-light $light-color #ffffff
$body-bg-color $bg-color-light #ffffff
$body-font-color lighten($dark-color, 5%) #3b4351
$border-color lighten($dark-color, 65%) #dadee4
$border-color-dark darken($border-color, 10%) #bcc3ce
$border-color-light lighten($border-color, 8%) #f1f3f5
$disabled-color $bg-color-dark #eef0f3
$gray-color lighten($dark-color, 55%) #bcc3ce
$gray-color-dark darken($gray-color, 30%) #66758c
$gray-color-light lighten($gray-color, 20%) #f7f8f9
$link-color $primary-color #5755d9
$link-color-dark darken($link-color, 10%) #302ecd
$link-color-light lighten($link-color, 10%) #807fe2
$primary-color-dark darken($primary-color, 3%) #4b48d6
$primary-color-light lighten($primary-color, 3%) #6362dc
$secondary-color lighten($primary-color, 37.5%) #f1f1fc
$secondary-color-dark darken($secondary-color, 3%) #e5e5f9
$secondary-color-light lighten($secondary-color, 3%) #fefeff

Learn how to customize derived colors.

Customize

Variables - Name

The important thing is to know how the CSS variable names are being built, and what Sass variables are used to do that for further customization.

Variables - Main

There are main Sass variables for the entire project without equivalents in CSS variables, but they are used in the creation of their names. The following table contains all of them.

Sass variable CSS variable Default value
Prefix
CSS variable's name prefix
$var-prefix
s
Hue
CSS variable's name suffix indicating hue of hsla
$var-hue
h
Saturation
CSS variable's name suffix indicating saturation of hsla
$var-saturation
s
Lightness
CSS variable's name suffix indicating lightness of hsla
$var-lightness
l
Alpha
CSS variable's name suffix indicating alpha for both hsla and rgba
$var-alpha
a
Variables - Variable prefix

The customizable prefix mentioned above is the $var-prefix variable and it's the prefix of all CSS variable names. The variable is located in the src/variables/_core.scss file and its default value is s.

// src/variables/_core.scss
// Global CSS variable names prefix.
$var-prefix: 's' !default;

General CSS variable name structure is defined as follows.

--#{$var-prefix}-#{$name}: #{$value}

Learn how to customize CSS variable names with $var-prefix.

Customize

Variables - Class prefix

The Sass variable $class-prefix is the prefix of main CSS classes replacing in a some minimal way custom prefixes for all classes with the gulp. The variable is located in the src/variables/_core.scss file and its default value is an empty string.

// src/variables/_core.scss
// Class names prefix.
$class-prefix: '';

Primary CSS class name structure is defined as follows.

.#{$class-prefix}classname {
  ...
}

For example, the name of the class from cards is defined as follows.

.#{$class-prefix}card { ... }
// Which results in 
.card { ... }

Learn how to customize CSS primary class names with $class-prefix.

Customize

Variables - Color name

Hex colors and derived aren't used in the styles, instead, the color() function is used, which returns the hsla() function with four predefined CSS variables. It means, each hex and derived color has its representation in four CSS variables, but there is also an additional CSS lightness variable with the default suffix in the name l-l for base lightness adjustment.

Hex color has the CSS variable values obtained from itself by using Sass hue, saturation, lightness and alpha functions, and derived are being obtained by css-var function using the CSS variable color name or color code.

Both, CSS variables of the hex and derived colors are set by the set-color() mixin, with the ability to adjust the lightness or alpha, and each CSS variable name contains the customizable prefix, and variable name with the suffix h indicates hue, s saturation, l lightness, and a alpha.

Color name is just Sass variable color without the dollar $ and it's used as the parameter in the color() function to return hsla() function with a proper CSS variables. For example:

@use 'node_modules/@angular-package/spectre.css/src/functions/color/color.function' as *;

.example {
  color: color('primary-color');
  background: color('gray-color-dark');
}

It's possible to use the color code, which is just a color name without the color word. For example.

@use 'node_modules/@angular-package/spectre.css/src/functions/color/color.function' as *;

.example {
  color: color('primary');
  background: color('gray-dark');
}
Variables - Color name hue

The first parameter of the hsla() function is the hue, and the Sass variable $var-hue value is the suffix of the CSS variable name that represents it. The variable is located in the src/variables/_core.scss file and its default value is h.

// src/variables/_core.scss
$var-hue: 'h' !default;

The hue CSS variable name structure is defined as follows.

--#{$var-prefix}-#{$name}-#{$var-hue}: #{$value};

For example, with defaults hue CSS variable name of the primary-color is set as follows.

--s-primary-color-h: 240.9090909091deg;

Learn how to customize CSS variable name hue with the $var-hue.

Customize

Variables - Color name saturation

The second parameter of the hsla() function is the saturation, and the Sass variable $var-saturation value is the suffix of the CSS variable name that represents it. The variable is located in the src/variables/_core.scss file and its default value is s.

// src/variables/_core.scss
$var-saturation: 's' !default;

The saturation CSS variable name structure is defined as follows.

--#{$var-prefix}-#{$name}-#{$var-saturation}: #{$value};

For example, with defaults saturation CSS variable name of the primary-color is set as follows.

--s-primary-color-s: 63.4615384615%;

Learn how to customize CSS variable name saturation with the $var-saturation.

Customize

Variables - Color name lightness

The third parameter of the hsla() function is the lightness, and the Sass variable $var-lightness value is the suffix of the CSS variable name that represents it. The variable is located in the src/variables/_core.scss file and its default value is l.

// src/variables/_core.scss
$var-lightness: 'l' !default;

The lightness CSS variable name structure is defined as follows.

--#{$var-prefix}-#{$name}-#{$var-lightness}: #{$value};

Learn how to customize CSS variable name lightness with the $var-lightness.

Customize

Variables - Color name alpha

The fourth parameter of the hsla() function is the alpha, and the Sass variable $var-alpha value is the suffix of the CSS variable name that represents it. The variable is located in the src/variables/_core.scss file and its default value is a.

// src/variables/_core.scss
$var-alpha: 'a' !default;

The alpha CSS variable name structure is defined as follows.

--#{$var-prefix}-#{$name}-#{$var-alpha}: #{$value};

Learn how to customize CSS variable name alpha with the $var-alpha.

Customize

Variables - Color name summary

In summary, the single CSS variable color is set as follows.

--#{$var-prefix}-#{$name}-#{$var-hue}: hue($color)
--#{$var-prefix}-#{$name}-#{$var-saturation}: saturation($color)
--#{$var-prefix}-#{$name}-#{$var-lightness}: calc(lightness($color) + var(--#{$var-prefix}-#{$name}-#{$var-lightness}-l'))
--#{$var-prefix}-#{$name}-#{$var-alpha}: alpha($color)

For example, primary-color with defaults is set as follows.

--s-primary-color-h: 240.9090909091deg;
--s-primary-color-s: 63.4615384615%;
--s-primary-color-l: calc(59.2156862745% + var(--s-primary-color-l-l));
--s-primary-color-l-l: 0%;
--s-primary-color-a: 1;

Variables - Theme

Spectre.css has the first approach of the dark and light theme.

Variables - Color scheme

The CSS color-scheme property is set to light dark in both :root and :host elements with the Sass $color-scheme variable.

"The color-scheme CSS property allows an element to indicate which color schemes it can comfortably be rendered in." - Mozilla.org

The variable is located in the src/variables/_core.scss file.

// src/variables/_core.scss
$color-scheme: light dark !default;

Read moreCustomize

Variables - Theme color

Both themes have the property theme-color dedicated for the meta tag with attribute name='theme-color' indicating a suggested color that the user agent should use to customize the display of the page or the surrounding user interface.

The property of the $theme-dark is located in the src/variables/_theme-dark.scss file and of the $theme-light is located in the src/variables/_theme-light.scss file and their default value is Sass variable primary-color.

Read moreCustomize

Variables - Dark theme

This is a beta feature.

// src/variables/colors/_theme-dark.scss
@use 'control' as *;
@use 'core' as *;
@use 'other' as *;

$theme-dark: (
  // Theme color.
  'theme-color': $primary-color,

  // Core colors.
  'dark-color': #020202,
  'light-color': #e9e9e9,

  'accent-color': $accent-color,

  'primary-color': $primary-color,
  'primary-color-dark': ('primary-color', -3%),
  'primary-color-light': ('primary-color', +3%),

  'secondary-color': ('primary-color', -27.5%),
  'secondary-color-dark': ('secondary-color', -3%),
  'secondary-color-light': ('secondary-color', +3%),

  // Gray colors.
  'gray-color': ('dark-color', +75%),
  'gray-color-dark': ('gray-color', -30%),
  'gray-color-light':('gray-color', +20%),

  // Bg colors.
  'bg-color': ('dark-color', +9%),
  'bg-color-dark': ('bg-color', -3%),
  'bg-color-light': ('bg-color', +3%),

  // Border colors.
  'border-color': ('dark-color', +3%), // Original light 65%
  'border-color-dark': ('border-color', -10%),
  'border-color-light': ('border-color', +8%),

  // Link colors.
  'link-color': 'primary-color',
  'link-color-dark': ('link-color', -10%),
  'link-color-light': ('link-color', +10%),

  // Body colors.
  'body-bg-color': #121212,
  'body-font-color': 'light-color',

  // Control colors.
  'disabled-color': 'bg-color-dark',
  'error-color': $error-color,
  'info-color': $info-color,
  'success-color': $success-color,
  'warning-color': $warning-color,

  // Other colors.
  'code-color': $code-color,
  'highlight-color': $highlight-color,
) !default;
Key Default value Hex
theme-color $primary-color #5755D9
dark-color #303742 #303742
light-color #FFFFFF #FFFFFF
accent-color $accent-color #9932CC
primary-color $primary-color #5755D9
primary-color-dark ('primary-color', -3%) #4B49D6
primary-color-light ('primary-color', -3%) #6362dc
secondary-color ('primary-color', +37.5%) #f1f1fc
secondary-color-dark ('secondary-color', -3%) #e5e5f9
secondary-color-light ('secondary-color', -3%) #fefeff
gray-color ('dark-color', +55%) #bcc3ce
gray-color-dark ('gray-color', -30%) #66758c
gray-color-light ('gray-color', +20%) #f7f8f9
bg-color ('dark-color', +75%) #f7f8f9
bg-color-dark ('bg-color', -3%) #eef0f3
bg-color-light light-color #fefeff
border-color ('dark-color', +65%) #dadee4
border-color-dark ('border-color', -10%) #bcc3ce
border-color-light ('border-color', +8%) #f1f3f5
link-color primary-color' #5755d9
link-color-dark ('link-color', -10%) #302ecd
link-color-light ('link-color', +10%) #807fe2
body-bg-color bg-color-light #ffffff
body-font-color ('dark-color', +5%) #3b4351
disabled-color bg-color-dark #eef0f3
error-color $error-color #e85600
info-color $info-color #d9edf7
success-color $success-color #32b643
warning-color $warning-color #ffb700
code-color $code-color #d73e48
highlight-color $highlight-color #ffe9b3

Learn how to customize CSS variables of the dark theme.

Customize

Variables - Light theme
// src/variables/colors/_theme-light.scss
@use 'control' as *;
@use 'core' as *;
@use 'other' as *;

$theme-light: (
  // Theme color.
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color
  'theme-color': $primary-color,

  // Core colors.
  'dark-color': #303742,
  'light-color': #FFFFFF,

  // - Accent color.
  'accent-color': $accent-color,

  // - Primary colors.
  'primary-color': $primary-color,
  'primary-color-dark': ('primary-color', -3%),
  'primary-color-light': ('primary-color', +3%),

  // - Secondary colors.
  'secondary-color': ('primary-color', +37.5%),
  'secondary-color-dark': ('secondary-color', -3%),
  'secondary-color-light': ('secondary-color', +3%),

  // Gray colors.
  'gray-color': ('dark-color', +55%),
  'gray-color-dark': ('gray-color', -30%),
  'gray-color-light':('gray-color', +20%),

  // Bg colors.
  'bg-color': ('dark-color', +75%),
  'bg-color-dark': ('bg-color', -3%),
  'bg-color-light': 'light-color',

  // Border colors.
  'border-color': ('dark-color', +65%),
  'border-color-dark': ('border-color', -10%),
  'border-color-light': ('border-color', +8%),

  // Link colors.
  'link-color': 'primary-color',
  'link-color-dark': ('link-color', -10%),
  'link-color-light': ('link-color', +10%),

  // Body colors.
  'body-bg-color': 'bg-color-light',
  'body-font-color': ('dark-color', +5%),

  // Control colors.
  'disabled-color': 'bg-color-dark',
  'error-color': $error-color,
  'info-color': $info-color,
  'success-color': $success-color,
  'warning-color': $warning-color,

  // Other colors.
  'code-color': $code-color,
  'highlight-color': $highlight-color,
) !default;
Key Default value Hex
theme-color $primary-color #5755D9
dark-color #303742 #303742
light-color #FFFFFF #FFFFFF
accent-color $accent-color #9932CC
primary-color $primary-color #5755D9
primary-color-dark ('primary-color', -3%) #4B49D6
primary-color-light ('primary-color', -3%) #6362dc
secondary-color ('primary-color', +37.5%) #f1f1fc
secondary-color-dark ('secondary-color', -3%) #e5e5f9
secondary-color-light ('secondary-color', -3%) #fefeff
gray-color ('dark-color', +55%) #bcc3ce
gray-color-dark ('gray-color', -30%) #66758c
gray-color-light ('gray-color', +20%) #f7f8f9
bg-color ('dark-color', +75%) #f7f8f9
bg-color-dark ('bg-color', -3%) #eef0f3
bg-color-light light-color #fefeff
border-color ('dark-color', +65%) #dadee4
border-color-dark ('border-color', -10%) #bcc3ce
border-color-light ('border-color', +8%) #f1f3f5
link-color primary-color' #5755d9
link-color-dark ('link-color', -10%) #302ecd
link-color-light ('link-color', +10%) #807fe2
body-bg-color bg-color-light #ffffff
body-font-color ('dark-color', +5%) #3b4351
disabled-color bg-color-dark #eef0f3
error-color $error-color #e85600
info-color $info-color #d9edf7
success-color $success-color #32b643
warning-color $warning-color #ffb700
code-color $code-color #d73e48
highlight-color $highlight-color #ffe9b3

Learn how to customize CSS variables of the light theme.

Customize

Variables - Colors

Variables - Theme color
theme Theme color
Code theme
Theme key theme-color $primary-color
Hue --s-theme-color-h 216.6666666667deg
Saturation --s-theme-color-s 15.7894736842%
Lightness --s-theme-color-l 22.3529411765%
Alpha --s-theme-color-a 1
Variables - Dark color
dark Dark color
Code dark
Theme key dark-color #020202
Hue --s-dark-color-h 216.6666666667deg
Saturation --s-dark-color-s 15.7894736842%
Lightness --s-dark-color-l 22.3529411765%
Alpha --s-dark-color-a 1
Variables - Light color
light Light color
Code light
Sass variable $light-color #ffffff
Hue --s-light-color-h 0deg
Saturation --s-light-color-s 0%
Lightness --s-light-color-l 100%
Alpha --s-light-color-a 1
light#FFFFFF Light color
Code Sass variable CSS variable Hex
light $light-color --s-light-color-h
--s-light-color-s
--s-light-color-l
--s-light-color-a
Variables - Accent color
Code Sass variable CSS variable Hex
accent $accent-color --s-accent-color-h
--s-accent-color-s
--s-accent-color-l
--s-accent-color-a
Variables - Primary
Code Sass variable CSS variable Hex
primary $primary-color --s-primary-color-h
--s-primary-color-s
--s-primary-color-l
--s-primary-color-a
Variables - Primary dark
Code Sass variable CSS variable Hex
primary-dark $primary-color-dark --s-primary-color-dark-h
--s-primary-color-dark-s
--s-primary-color-dark-l
--s-primary-color-dark-a
Variables - Primary light
Code Sass variable CSS variable Hex
primary-light $primary-color-light --s-primary-color-light-h
--s-primary-color-light-s
--s-primary-color-light-l
--s-primary-color-light-a
Variables - Secondary
Code Sass variable CSS variable Hex
secondary $secondary-color --s-secondary-color-h
--s-secondary-color-s
--s-secondary-color-l
--s-secondary-color-a
secondary-dark $secondary-color-dark --s-secondary-color-dark-h
--s-secondary-color-dark-s
--s-secondary-color-dark-l
--s-secondary-color-dark-a
secondary-light $secondary-color-light --s-secondary-color-light-h
--s-secondary-color-light-s
--s-secondary-color-light-l
--s-secondary-color-light-a
Gray colors
gray $gray-color --s-gray-color-h
--s-gray-color-s
--s-gray-color-l
--s-gray-color-a
gray-dark $gray-color-dark --s-gray-color-dark-h
--s-gray-color-dark-s
--s-gray-color-dark-l
--s-gray-color-dark-a
gray-light $gray-color-light --s-gray-color-light-h
--s-gray-color-light-s
--s-gray-color-light-l
--s-gray-color-light-a
Bg colors
bg $bg-color --s-bg-color-h
--s-bg-color-s
--s-bg-color-l
--s-bg-color-a
bg-dark $bg-color-dark --s-bg-color-dark-h
--s-bg-color-dark-s
--s-bg-color-dark-l
--s-bg-color-dark-a
bg-light $bg-color-light --s-bg-color-light-h
--s-bg-color-light-s
--s-bg-color-light-l
--s-bg-color-light-a
Border colors
border $border-color --s-border-color-h
--s-border-color-s
--s-border-color-l
--s-border-color-a
border-dark $border-color-dark --s-border-color-dark-h
--s-border-color-dark-s
--s-border-color-dark-l
--s-border-color-dark-a
border-light $border-color-light --s-border-color-light-h
--s-border-color-light-s
--s-border-color-light-l
--s-border-color-light-a
link $link-color --s-link-color-h
--s-link-color-s
--s-link-color-l
--s-link-color-a
link-dark $link-color-dark --s-link-color-dark-h
--s-link-color-dark-s
--s-link-color-dark-l
--s-link-color-dark-a
link-light $link-color-light --s-link-color-light-h
--s-link-color-light-s
--s-link-color-light-l
--s-link-color-light-a
Control colors
disabled $disabled-color --s-disabled-color-h
--s-disabled-color-s
--s-disabled-color-l
--s-disabled-color-a
error $error-color --s-error-color-h
--s-error-color-s
--s-error-color-l
--s-error-color-a
info $info-color --s-info-color-h
--s-info-color-s
--s-info-color-l
--s-info-color-a
success $success-color --s-success-color-h
--s-success-color-s
--s-success-color-l
--s-success-color-a
warning $warning-color --s-warning-color-h
--s-warning-color-s
--s-warning-color-l
--s-warning-color-a
Body colors
body-bg $body-bg-color --s-body-bg-color-h
--s-body-bg-color-s
--s-body-bg-color-l
--s-body-bg-color-a
body-font $body-font-color --s-body-font-color-h
--s-body-font-color-s
--s-body-font-color-l
--s-body-font-color-a
Other colors
code $code-color --s-code-color-h
--s-code-color-s
--s-code-color-l
--s-code-color-a
highlight $highlight-color --s-highlight-color-h
--s-highlight-color-s
--s-highlight-color-l
--s-highlight-color-a
parallax-fade $parallax-fade-color --s-parallax-fade-color-h
--s-parallax-fade-color-s
--s-parallax-fade-color-l
--s-parallax-fade-color-a

Variables - Colors on cards

Click on the link to see color dependency change.

Theme demonstration

Accent color
#9932CC
Accent
Primary colors
#5755d9
Primary
#4b48d6
Primary dark
#6362dc
Primary light
Secondary colors
#f1f1fc
Secondary
#e5e5f9
Secondary dark
#fefeff
Secondary light
Gray colors
#bcc3ce
Gray
#66758c
Gray dark
#f7f8f9
Gray light
Bg colors
#f7f8f9
Bg
#eef0f3
Bg dark
#ffffff
Bg light
Border colors
#dadee4
Border
#bcc3ce
Border dark
#f1f3f5
Border light
Link colors
Control colors
#eef0f3
Disabled
#e85600
Error
#d9edf7
Info
#32b643
Success
#ffb700
Warning
Body colors
#ffffff
Body background
#3b4351
Body font
Other colors
#d73e48
Code
#ffe9b3
Highlight

Variables - Sizes

The default REM (root em) size in Spectre.css is 20px.

Please note in the Chinese/Japanese/Korean version, Chrome uses 12px as default minimum font size. That is why Spectre.css sets rem default html font size to 20px, which is relatively easy to calculate.

Spectre.css uses 4px as the unit size. Sizes of components are based on the unit size.

Variables - Border

Code Sass variable CSS variable Default value
border-radius $border-radius --s-border-radius 0.1rem
border-width $border-width --s-border-width 0.05rem
border-width-lg $border-width-lg --s-border-width-lg 0.1rem

Variables - Control

Variables - Control sizes
Code Sass variable CSS variable Default value
control-size $control-size --s-control-size 1.8rem
control-size-sm $control-size-sm --s-control-size-sm 1.4rem
control-size-lg $control-size-lg --s-control-size-lg 2rem
Variables - Control padding
Code Sass variable CSS variable Default value
control-padding-x $control-padding-x --s-control-padding-x 0.4rem
control-padding-x-sm $control-padding-x-sm --s-control-padding-x-sm 0.3rem
control-padding-x-lg $control-padding-x-lg --s-control-padding-x-lg 0.6rem
control-padding-y $control-padding-y --s-control-padding-y 0.25rem
control-padding-y-sm $control-padding-y-sm --s-control-padding-y-sm 0.05rem
control-padding-y-lg $control-padding-y-lg --s-control-padding-y-lg 0.35rem
Variables - Control icon sizes
Code Sass variable CSS variable Default value
control-icon-size $control-icon-size --s-control-icon-size 0.8rem
Variables - Control width
Code Sass variable CSS variable Default value
control-width-xs $control-width-xs --s-control-width-xs 180px
control-width-sm $control-width-sm --s-control-width-sm 320px
control-width-md $control-width-md --s-control-width-md 640px
control-width-lg $control-width-lg --s-control-width-lg 960px
control-width-xl $control-width-xl --s-control-width-xl 1280px

Variables - Font sizes and line height

Variables - Font sizes
Code Sass variable CSS variable Default value
html-font-size $html-font-size --s-html-font-size 20px
font-size $font-size --s-font-size 0.8rem
font-size $font-size-sm --s-font-size-sm 0.7rem
font-size $font-size-lg --s-font-size-lg 0.9rem
Variables - Line height
Code Sass variable CSS variable Default value
html-line-height $html-line-height --s-html-line-height 1.5
line-height $line-height --s-line-height 1.2rem

Variables - Hero sizes

These are common variables for the hero element defined in the _variables.scss via the Sass map $hero-size variable.

xs sm md lg xl 2x
// src/_variables.scss
// Hero sizes.
$hero-size: (
  'xs': 1rem, // --#{$var-prefix}-hero-size-xs.
  'sm': 2rem, // --#{$var-prefix}-hero-size-sm.
  'md': 4rem, // --#{$var-prefix}-hero-size-md.
  'lg': 8rem, // --#{$var-prefix}-hero-size-lg.
  'xl': 10rem // --#{$var-prefix}-hero-size-xl.
) !default;

Common hero size Sass and CSS variables list

Class Sass variable CSS variable Default value
.hero.hero-size-xs $hero-size['xs'] --s-hero-size-xs 1rem
.hero.hero-size-sm $hero-size['sm'] --s-hero-size-sm 2rem
.hero.hero-size-md $hero-size['md'] --s-hero-size-md 4rem
.hero.hero-size-lg $hero-size['lg'] --s-hero-size-lg 8rem
.hero.hero-size-xl $hero-size['xl'] --s-hero-size-xl 10rem

Variables - Layout spacing

Code Sass variable CSS variable Default value
layout-spacing $layout-spacing --s-layout-spacing 0.4
layout-spacing-sm $layout-spacing-sm --s-layout-spacing-sm 0.8
layout-spacing $layout-spacing-lg --s-layout-spacing-lg 0.8
layout-spacing-unit $layout-spacing-unit --s-layout-spacing-unit 1rem

Variables - Parallax

Code Sass variable CSS variable Default value
parallax-deg $parallax-deg --s-parallax-deg 3deg
parallax-offset $parallax-offset --s-parallax-offset 4.5px
parallax-offset-z $parallax-offset-z --s-parallax-offset-z 50px
parallax-perspective $parallax-perspective --s-parallax-perspective 1000px
parallax-scale $parallax-scale --s-parallax-scale 0.95
parallax-fade-color $parallax-fade-color --s-parallax-fade-color #FFFFFF

Variables - Responsive breakpoints

Sass variable CSS variable Default value
size-xs $size-xs --s-size-xs 480px
size-sm $size-sm --s-size-sm 600px
size-md $size-md --s-size-md 840px
size-lg $size-lg --s-size-lg 960px
size-xl $size-xl --s-size-xl 1280px
size-2x $size-2x --s-size-2x 1440px

Variables - Transition duration

Code Sass variable CSS variable Default value
transition-duration $transition-duration --s-transition-duration 0.2s

Variables - Units

Sass variable CSS variable Default value
unit-o $unit-o --s-unit-o 0.05rem
unit-h $unit-h --s-unit-h 0.1rem
unit-1 $unit-1 --s-unit-1 0.2rem
unit-2 $unit-2 --s-unit-2 0.4rem
unit-3 $unit-3 --s-unit-3 0.6rem
unit-4 $unit-4 --s-unit-4 0.8rem
unit-5 $unit-5 --s-unit-5 1rem
unit-6 $unit-6 --s-unit-6 1.2rem
unit-7 $unit-7 --s-unit-7 1.4rem
unit-8 $unit-8 --s-unit-8 1.6rem
unit-9 $unit-9 --s-unit-9 1.8rem
unit-10 $unit-10 --s-unit-10 2rem
unit-12 $unit-12 --s-unit-12 2.4rem
unit-16 $unit-16 --s-unit-16 3.2rem

Variables - z-index

Sass variable CSS variable Default value
z-index-0 $zindex-0 --s-z-index-0 1
z-index-1 $zindex-1 --s-z-index-1 100
z-index-2 $zindex-2 --s-z-index-2 200
z-index-3 $zindex-3 --s-z-index-3 300
z-index-4 $zindex-4 --s-z-index-4 400