The framework uses different variables, such as color variables or even font-names, path, or anything that needs to be used more than one time. And in order to make the CSS developement easier !
-
Path
To make the maintenance easy, you can declare your assets path in a separate
.scssfile, called_variables.scssKeep this file at the top of your sass file, to make the path variable accessible to any OVCSS components.
Keep everything clean
To easily track your files and ressources, you can custom your own path like the following :
$root: '../'; $path-css: $root + 'css/'; $path-js: $root + 'js/'; $path-fonts: $root + 'fonts/'; $path-img: $root + 'images/';Usecase
Let's say you have your own icons set, and you put them in you
imagespath, into asvgfolder.1 Add a new variable to
_variables.scss$path-svg: $path-image + 'svg/'2 Add an @each function to your
_icons.scss$icons: "phone", "twitter", "email"; @each $icon in $icons { .ico{ &[class*="ico-#{($icon)}"]{ &:before{ @include icon-background('#{$path-svg}#{($icon)}.svg'); } } } } -
Fonts
The framework use a smart font system, that requires a minimum setting. on the same
_variables.scss, you can set 3 different parameters.$font-name: "ProximaNova"; $font-fallback: "Helvetica"; $font-directory: $path-fonts + "ProximaNova/"; -
Colors
To keep the whole design easy to maintain, EfficaCSS use colors variables, and shorten colors variables.
Here is a sample of the_color.scssfile this page is using.$purple: #663399; $text-purple: #4B5184; $dark-purple: #363953; $light-purple: #C8C9DA; $grey: #EFF0F2; $light-grey: #FAFBFB; $dark-grey: #9295A4; $blue: #1393D5; $white: #F3F3F5; $yellow: #EEBD2B; $green: #83BC49; /* Shortcuts --------------------------------------------------------------------------------------------------*/ $p: $purple; $dp: $dark-purple; $lp: $light-purple; $tp: $text-purple; $ge: $grey; $lg: $light-grey; $dg: $dark-grey; $b: $blue; $w: $white; $y: $yellow; $g: $green; /* Theme --------------------------------------------------------------------------------------------------*/ $color-theme: $b; $ct: $color-theme;