Skip to content

Instantly share code, notes, and snippets.

@raduchiriac
Last active April 16, 2016 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raduchiriac/9dd6322705424ae32ebb to your computer and use it in GitHub Desktop.
Save raduchiriac/9dd6322705424ae32ebb to your computer and use it in GitHub Desktop.
Sass Magic
// Referencing
.adidas {
.shoe &.dirty {
color: red;
}
}
// Logs
@warn "Key not found.";
// Interpolation
$group: 'lobsters';
.parent-#{$group} {
padding:1em;
}
// Maps
$colors: (
'color-1': #DDD,
'color-2': #EEE,
'color-3': #F29DC1
);
footer {
color:map-get($colors, 'color-1');
}
// Operations
.main {
margin: 10px + 8px;
padding: 20px * 3;
&:after {
$string: "default";
content: "This is a #{$string} button with a width of #{5 * 10} px";
}
}
// Breakpoints
$tablet: "screen and (max-width: 768px)";
li {
@media #{$tablet} {
float:none;
@media (orientation: portrait) {
border: none;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment