Created
September 22, 2020 06:01
-
-
Save Manntrix/152e098a4088b8d45e9b9dc0fd13abcf to your computer and use it in GitHub Desktop.
This file contains 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
//Variable Example | |
$main-color : red; | |
h1{ | |
color:$main-color; | |
font-size: 20px; | |
} | |
// Nested Rules | |
$bgcolor : #c1c1c1; | |
#nested { | |
background-color: $bgcolor; | |
h3{ | |
color: green; | |
} | |
} | |
//Interpolation Example | |
@mixin text-style($name, $bold-or-normal, $size, $color) { | |
#{$name} { | |
font-size: #{$size}px; | |
font-weight: #{$bold-or-normal}; | |
color: #{$color}; | |
} | |
} | |
@include text-style(".interpolation", bold, 25, blue); | |
//Function Example | |
@function invert($color, $amount: 100%) { | |
$inverse: change-color($color, $hue: hue($color) + 180); | |
@return mix($inverse, $color, $amount); | |
} | |
$primary-color:green; | |
#function { | |
background-color: invert($primary-color, 80%); | |
h3{ | |
color: white; | |
} | |
} | |
//Mixin Example | |
@mixin default-text-style { | |
padding: 20px; | |
font-size: 16px; | |
font-weight:bold; | |
} | |
#mixin{ | |
p{ | |
@include default-text-style | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment