Created
February 5, 2016 18:56
-
-
Save jaromero/2be19cc1bc56db429dc6 to your computer and use it in GitHub Desktop.
Checkerboard background pattern mixin
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
@mixin checkerboard ($c1, $c2, $sx, $sy) { | |
// Usage: | |
// @include checkerboard(<color 1>, <color 2>, <cell width>, <cell height>); | |
$sx2: ($sx * 2); | |
$sy2: ($sy * 2); | |
background: { | |
color: $c1; | |
image: linear-gradient(to bottom right, $c2 25%, transparent 25%, transparent 75%, $c2 75%, $c2), | |
linear-gradient(to bottom right, $c2 25%, transparent 25%, transparent 75%, $c2 75%, $c2); | |
position: 0 0, $sx $sy; | |
size: $sx2 $sy2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment