-
Notifications
You must be signed in to change notification settings - Fork 2
CSS Standards
Brandon Bouchard edited this page Nov 24, 2022
·
7 revisions
Look for the Two Dashes style under the Alternative naming schemes heading in the following documentation:
This project utilizes element-local CSS custom property definitions wherein a .bcgovbtn
class may declare its color to be as such: color: --btn-clr
and then any extensions of this base class may define the value of --btn-clr
like this: --btn-clr: #{$text-light}
.
.btn {
background-color: $primary-color;
font-family: 'BCSans', sans-serif;
color: var(--btn-clr); <-- this is where the magic begins
}
.btn__primary {
--btn-clr: #{$text-light}; <-- note the #{} syntax wrapping the SCSS variable, this is required
}
When naming new CSS variables use the following convention:
block-name__elem-name--mod-name--mod-val
e.g.:
.btn__primary--type--outline
This the wiki footer for BC Government's DPIA product.