Created
May 13, 2014 08:25
-
-
Save hail2u/b7bc9e72c12d90541327 to your computer and use it in GitHub Desktop.
Sassの色管理パターン
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
// Create swatch | |
$color-base: #33ff33; | |
$color-accent: #3333ff; | |
.header { | |
background-color: $color-base; | |
} | |
.header .active { | |
color: $color-accent; | |
} |
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
// Extend CSS color keywords | |
$my-red: #ee3333; | |
$my-blue: #3333ee; | |
.header { | |
background-color: $my-red; | |
} | |
.header .active { | |
color: $my-blue; | |
} |
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
// Name variables its usage | |
$header-bg: #33ff33; | |
$header-active-fg: #3333ff; | |
.header { | |
background-color: $header-bg; | |
} | |
.header .active { | |
color: $my-blue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is what I do.
https://gist.github.com/kotarok/ec32bb632797af084551