Created
January 30, 2015 14:41
-
-
Save suisho/83788e9d14e7f9608b9f to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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 (v3.3.14) | |
| // Compass (v1.0.1) | |
| // ---- | |
| // http://erskinedesign.com/blog/friendlier-colour-names-sass-maps/ | |
| //http://maketea.co.uk/2014/07/21/managing-relationships-between-colours-with-sass.html | |
| // setting | |
| $color-palette :( | |
| red : ( | |
| base : #ff0000, | |
| dark : #ffcccc | |
| ), | |
| blue : ( | |
| base : #0000ff, | |
| light : #00bbff, | |
| ) | |
| ) !default; | |
| // color(色系統, トーン) | |
| @function color($color, $tone){ | |
| @return map-get(map-get($color-palette, $color), $tone) | |
| } | |
| @each $name, $palette in $color-palette { | |
| @each $tone, $code in $palette { | |
| .sample-color-palette-#{$name}-#{$tone}{ | |
| background : color($name, $tone); | |
| .black-text{ color : #000 }; | |
| .white-text{ color: #fff }; | |
| } | |
| } | |
| } |
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
| .sample-color-palette-red-base { | |
| background: red; | |
| } | |
| .sample-color-palette-red-base .black-text { | |
| color: black; | |
| } | |
| .sample-color-palette-red-base .white-text { | |
| color: white; | |
| } | |
| .sample-color-palette-red-dark { | |
| background: #ffcccc; | |
| } | |
| .sample-color-palette-red-dark .black-text { | |
| color: black; | |
| } | |
| .sample-color-palette-red-dark .white-text { | |
| color: white; | |
| } | |
| .sample-color-palette-blue-base { | |
| background: blue; | |
| } | |
| .sample-color-palette-blue-base .black-text { | |
| color: black; | |
| } | |
| .sample-color-palette-blue-base .white-text { | |
| color: white; | |
| } | |
| .sample-color-palette-blue-light { | |
| background: #00bbff; | |
| } | |
| .sample-color-palette-blue-light .black-text { | |
| color: black; | |
| } | |
| .sample-color-palette-blue-light .white-text { | |
| color: white; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment