Last active
December 8, 2018 07:45
-
-
Save eweader/f3a3df0b6fc0ad6b1e8eabb6c6c6fccb to your computer and use it in GitHub Desktop.
diff CSS, SCSS, SASS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*CSS | |
In CSS we write code as depicted bellow, | |
in full length. | |
*/ | |
body{ | |
width: 800px; | |
color: #ffffff; | |
} | |
body content{ | |
width:750px; | |
background:#ffffff; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SASS | |
In SASS however, | |
the whole structure | |
is visually quicker | |
and cleaner than SCSS. | |
It is sensitive | |
to white space | |
when you are using | |
copy and paste, | |
It seems that it doesn t | |
support inline CSS currently. */ | |
$color: #ffffff | |
$width: 800px | |
$stack: Helvetica, sans-serif | |
body | |
width: $width | |
color: $color | |
font: 100% $stack | |
content | |
width: $width | |
background:$color |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SCSS | |
In SCSS we can shorten this code using | |
a @mixin so we don’t have to write color | |
and width properties again and again. | |
We can define this through a function, | |
similarly to PHP or other languages. | |
*/ | |
$color: #ffffff; | |
$width: 800px; | |
@mixin body{ | |
width: $width; | |
color: $color; | |
content{ | |
width: $width; | |
background:$color; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment