3 ms·
Take a look at Bootstrap Alpha 4: https://github.com/twbs/bootstrap/tree/v4-dev/scss https://github.com/twbs/bootstrap/tree/v4-dev/scss I don't know if readin
by danso 11y ago
Take a look at Bootstrap Alpha 4:
https://github.com/twbs/bootstrap/tree/v4-dev/scss https://github.com/twbs/bootstrap/tree/v4-dev/scss
I don't know if reading the source code is enough, but if you try incorporating it in projects, it's easier to see how well SCSS works in practice. I really enjoy how Bootstrap sets up conventions for typography and other variables:
https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variable...
https://github.com/twbs/bootstrap/blob/v4-dev/scss/_type.scss https://github.com/twbs/bootstrap/blob/v4-dev/scss/_type.scs...
There's global variables for serif, sans-serif, and mono...When prototyping a site, I sometimes change my mind over whether or not to use serif or sans-serif...with SCSS, it's a matter of just switching $font-family-base to either $font-family-serif or $font-family-sans-serif:
$font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, font-family-sans-serifs-serif !default;
$font-family-serif: Georgia, "Times New Roman", Times, serif !default;
$font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace !default;
$font-family-base: $font-family-sans-serif !default;
I usually set a $font-family-headings variable if I decide to use a third font for headings. All font-family names are set in this file and I never have to refer to them explicitly in any of my other CSS.
The elegance of setting a base font size and then having h1-h6 be multiples of that number is also a delightful convenience. And this is just the bare minimum of ways that SCSS can aid in composability...though to be honest...besides variables and the ability to nest definitions within each other...I don't habitually use all of the other really nice features, yet.