Skip to content

Instantly share code, notes, and snippets.

@hail2u
Created May 13, 2014 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hail2u/b7bc9e72c12d90541327 to your computer and use it in GitHub Desktop.
Save hail2u/b7bc9e72c12d90541327 to your computer and use it in GitHub Desktop.
Sassの色管理パターン
// Create swatch
$color-base: #33ff33;
$color-accent: #3333ff;
.header {
background-color: $color-base;
}
.header .active {
color: $color-accent;
}
// Extend CSS color keywords
$my-red: #ee3333;
$my-blue: #3333ee;
.header {
background-color: $my-red;
}
.header .active {
color: $my-blue;
}
// Name variables its usage
$header-bg: #33ff33;
$header-active-fg: #3333ff;
.header {
background-color: $header-bg;
}
.header .active {
color: $my-blue;
}
@kotarok
Copy link

kotarok commented May 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment