Last active
January 12, 2019 11:00
-
-
Save hilja/87a4712ae1a328b0351e to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
<h1>Horses with backgorunds!</h1> | |
<div class="horses--horse"></div> | |
<div class="horses--pony"></div> | |
<div class="horses--maxi-pony"></div> | |
<div class="horses--mini-horse"></div> |
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
// ---- | |
// Sass (v3.4.9) | |
// Compass (v1.0.1) | |
// ---- | |
$omni: 20px; | |
// Our two dimentional list | |
$horses: (pony #996633) | |
(horse Pink) | |
(mini-horse #333) | |
(maxi-pony #cc9849); | |
// Base styles for the horses | |
[class^="horses"] { | |
background-size: 100%; | |
background-repeat: no-repeat; | |
float: left; | |
border: solid $omni #fff; | |
border-width: 0 $omni 0 0; | |
height: 200px; | |
width: 25%; | |
} | |
// Horse loop | |
@each $horse in $horses { | |
.horses--#{nth($horse, 1)} { | |
background-color: nth($horse, 2); | |
background-image: url('http://hilja.net/i/#{nth($horse, 1)}.png'); | |
} | |
} | |
// Just some reset stuff | |
body { | |
font-family: sans-serif; | |
margin: $omni 0 $omni $omni; | |
} | |
* { | |
box-sizing: border-box; | |
} |
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
[class^="horses"] { | |
background-size: 100%; | |
background-repeat: no-repeat; | |
float: left; | |
border: solid 20px #fff; | |
border-width: 0 20px 0 0; | |
height: 200px; | |
width: 25%; | |
} | |
.horses--pony { | |
background-color: #996633; | |
background-image: url("http://hilja.net/i/pony.png"); | |
} | |
.horses--horse { | |
background-color: Pink; | |
background-image: url("http://hilja.net/i/horse.png"); | |
} | |
.horses--mini-horse { | |
background-color: #333; | |
background-image: url("http://hilja.net/i/mini-horse.png"); | |
} | |
.horses--maxi-pony { | |
background-color: #cc9849; | |
background-image: url("http://hilja.net/i/maxi-pony.png"); | |
} | |
body { | |
font-family: sans-serif; | |
margin: 20px 0 20px 20px; | |
} | |
* { | |
box-sizing: border-box; | |
} |
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
<h1>Horses with backgorunds!</h1> | |
<div class="horses--horse"></div> | |
<div class="horses--pony"></div> | |
<div class="horses--maxi-pony"></div> | |
<div class="horses--mini-horse"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment