css variables vs sass code example
Example 1: sass vs scss
/* Answer to: "sass vs scss" */
/*
The basic difference is the syntax. While SASS has a loose syntax
with white space and no semicolons, the SCSS resembles more to CSS.
SASS stands for Syntactically Awesome StyleSheets. It is an
extension of CSS that adds power and elegance to the basic
language.
There's more differences but too much for me! Fortunately, someone
else asked the same question over in StackOverflow! Here's a link
to their answer:
https://stackoverflow.com/questions/5654447/whats-the-difference-between-scss-and-sass
*/
Example 2: scss variables
$base-color: #c6538c;
Example 3: Sass Variables
$myFont: Helvetica, sans-serif;
$myColor: red;
$myFontSize: 18px;
$myWidth: 680px;
body {
font-family: $myFont;
font-size: $myFontSize;
color: $myColor;
}
#container {
width: $myWidth;
}
Example 4: scss variables
$variable: 1;