Using variables and helper functions built into the framework, you can override EvoToolkit defaults so it can be tailored towards your project needs. The variables described in this section represent the Settings layer of the ITCSS methodology.
To configure variables, you have 3 options:-
sample.page.scss.overrides.scss to apply globally across all stylesheets. This is useful to enable styles which you know are on all pages (Headers, footers etc).theme-overrides.scss containing all related variables and settings.Here's everything you can do:-
There are high level options which trickle down to multiple parts across the framework:-
| Name | |
|---|---|
| Name |
$container-gutter
|
| Description | |
| Description |
The spacing at either side of the container object from the |
| Default | |
| Default |
$gutter
|
| Name | |
|---|---|
| Name |
$container-gutter-mobile
|
| Description | |
| Description |
The spacing at either side of the container object until the |
| Default | |
| Default |
10px
|
| Name | |
|---|---|
| Name |
$container-size
|
| Description | |
| Description |
The maximum width of the container object, which together with the layout object and width utilities form a grid system. |
| Default | |
| Default |
1170px
|
| Name | |
|---|---|
| Name |
$global-body-color
|
| Description | |
| Description |
Sets the colour of the document text. |
| Default | |
| Default |
color('very-dark')
|
| Name | |
|---|---|
| Name |
$global-body-font
|
| Description | |
| Description |
The font used for every non-heading text in the framework. |
| Default | |
| Default |
'Roboto', sans-serif
|
| Name | |
|---|---|
| Name |
$global-body-font-size
|
| Description | |
| Description |
The standard |
| Default | |
| Default |
16px
|
| Name | |
|---|---|
| Name |
$global-body-weight
|
| Description | |
| Description |
How thick all non-heading text is by default. |
| Default | |
| Default |
300
|
| Name | |
|---|---|
| Name |
$global-border-radius
|
| Description | |
| Description |
Many components have rounded corners. This determines how round. |
| Default | |
| Default |
5px
|
| Name | |
|---|---|
| Name |
$global-border-radius-large
|
| Description | |
| Description |
A larger variant of |
| Default | |
| Default |
10px
|
| Name | |
|---|---|
| Name |
$global-font-path
|
| Description | |
| Description |
The directory where custom |
| Default | |
| Default |
../fonts/
|
| Name | |
|---|---|
| Name |
$global-header-font
|
| Description | |
| Description |
The font used for headings in typography header classes ( |
| Default | |
| Default |
'moderat', sans-serif
|
| Name | |
|---|---|
| Name |
$global-header-weight
|
| Description | |
| Description |
The thickness used for headings in typography header classes ( |
| Default | |
| Default |
normal
|
| Name | |
|---|---|
| Name |
$global-line-height
|
| Description | |
| Description |
The default |
| Default | |
| Default |
1.5
|
| Name | |
|---|---|
| Name |
$global-mobile-body-font-size
|
| Description | |
| Description |
The standard |
| Default | |
| Default |
14px
|
| Name | |
|---|---|
| Name |
$global-transition-duration
|
| Description | |
| Description |
The transition speed in seconds for any component CSS animations. |
| Default | |
| Default |
0.25s
|
| Name | |
|---|---|
| Name |
$global-transition-duration-fast
|
| Description | |
| Description |
A faster variant of |
| Default | |
| Default |
0.1s
|
| Name | |
|---|---|
| Name |
$gutter
|
| Description | |
| Description |
Used for the amount of spacing between columns in the grid system and by default the spacing at either side of the container object. |
| Default | |
| Default |
20px
|
| Name | |
|---|---|
| Name |
$set-breakpoint()
|
| Description | |
| Description |
A function allowing you to add or edit breakpoints in |
| Example | |
| Example |
|
| Name | |
|---|---|
| Name |
$set-spacing()
|
| Description | |
| Description |
A function allowing you to add or edit spacing values in |
| Example | |
| Example |
|
| Name | |
|---|---|
| Name |
$typography
|
| Description | |
| Description |
The default set of typography sizes are stored in this object. Edit using the set-breakpoint() mixin. |
| Example | |
| Example |
|
EvoToolkit supports theming, so you can easily change the colours used by the framework to suit the needs of your project.
This theming functionality is split between a number of key/value pairs and mixins (getters/setters etc). These can be set in theme-overrides.scss. Here's the run down:-
The first key/value pair is called $colors, which is simply an archive of colours where the theming system can draw from, so we don't have to remember any hex codes. By default, there is a mixture of Evolution Funding brand colours and other more generic colours to fulfil certain UI roles (success messages, errors etc):-
These are greyscale colours named after their opacity, which allows for easier management. Read Color in Design Systems for a good overview of this approach.
These are Evolution Funding Brand Colours.
These are original colours which are required to perform various roles in a UI which grayscale and brand colours aren't suited towards.
The second key/value pair is $theme, where the contents of $color are given user interface oriented roles.
For each $theme colour, a dark and light shade is programatically generated for things like hovers and focus styles.
If you need to add or edit any colours in $colors or $theme, you can do so using set-color and set-theme.
If required, you can also define how dark or how light $theme shades are with the set-theme-shades tool.
In addition, with set-theme-dark-text-color, any $theme colour names you pass here will have very-light text colour (default: very-dark) when its respective theme utility class is a applied to an element.
@include set-color((
'green': #00ff00,
'orange': #ffa500
));
@include set-theme((
'accent': #cccccc,
'info': color('green')
));
@include set-theme-shades((
'info': (
'dark': 5%,
'light': 23%
)
));
@include set-theme-dark-text-color(('accent', 'info'));
To retrieve colours from either $colors or $theme, you can use the color tool.
.c-my-component {
background-color: color('primary');
}
For each component, variable exists where $theme colors are assigned roles specific to that component. For example:-
$component-input-border-color: color('medium');
.c-input {
border: rem(1px) solid $component-input-border-color;
}
These generally shouldn't need to be edited unless you're introducing a lot more theme colours to the mix and would like to add more colour depth to components.
You can find a full list of theme variables in each component's respective documentation pages.
The reason behind this $colors and $theme split is one of scalability and maintainability.
If we only had $colors, this would make theming a more complicated process. For example, if components had border colours set to $grey and you wanted to change them to red, you would have 2 options:-
$grey to red, which would do the job, as the variable would trickle down to the component styles. The problem here is with semantics, in that the variable $grey is now actually red, which is just unnecessary confusion.OR
$red and then go through every single component and override their theme variables. A time consuming process.Because $theme contains colours named according to their role, we can assign them any colour and have it still make sense semantically. And because these $theme colours are the ones already referenced in the component styles, we don't have to go through and edit any component theme variables at all.