Created
September 25, 2012 14:16
-
-
Save mikefowler/3782192 to your computer and use it in GitHub Desktop.
Flexible Backgrounds with Sass and Compass
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
/** | |
* Our theme base. | |
* | |
* We shouldn't have to modify this to create a new theme. | |
*/ | |
@import 'compass/css3/images'; | |
$page-fill: #f1f1f1 !default; | |
html { | |
width: 100%; | |
height: 100%; | |
} | |
/** | |
* THE IMPORTANT PART | |
*/ | |
body { | |
@if type-of($page-fill) == "list" { | |
@include background(linear-gradient($page-fill)); | |
} @else if type-of($page-fill) == "color" { | |
background-color: $page-fill; | |
} | |
} |
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 sample theme. | |
* | |
* The goal here is to be able to create a theme with either a solid background | |
* or a gradient with N breakpoints, and control that from a single variable. | |
*/ | |
// Possibilities include: | |
$page-fill: #f1f1f1; | |
$page-fill: (#333, #eee); | |
$page-fill: (#333, #eee, #333); | |
$page-fill: (#ccc 10%, #eee 50%, #aaa 85%); | |
@import 'base'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment