Created
August 20, 2015 16:23
-
-
Save chrisdavies/2712449b569a9d172b01 to your computer and use it in GitHub Desktop.
File-scoped variables in 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
// A single mixin per file allows file-scoped variables | |
@mixin theme-blue { | |
// File-scoped variables | |
$main-bg: white; | |
$main-fg: #333; | |
$accent-bg: #00B4EF; | |
$accent-fg: white; | |
$content-width: 700px; | |
$gutter-width: 1rem; | |
body { | |
background: $main-bg; | |
color: $main-fg; | |
} | |
.page-header, | |
.main-content { | |
max-width: $content-width; | |
margin: 0 auto; | |
} | |
.page-header { | |
padding-top: 2em $gutter-width; | |
background: $accent-color; | |
color: $accent-fg; | |
} | |
} | |
// Mixin the rules for this file | |
@include theme-blue; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment