Skip to content

Instantly share code, notes, and snippets.

View dawidw's full-sized avatar

Dawid Woźniak dawidw

View GitHub Profile
$icons: smile, poop, godzilla;
@each $icon in $icons {
.icon-#{$icon} { background-image: url('/icons/#{$icon}.png') }
}
$font-list: Helvetica, Arial, sans-serif;
.post {
font-family: $font-list;
}
/* _post.scss */
$el : "post";
.#{$el} {
background: blue;
}
.#{$el}__title {
background: red;
}
$el : "post";
.#{$el} {
background: blue;
& .#{$el}__title {
background: red;
}
}
/* _posts_controller.scss */
.posts.show .post {
/* view specific styles */
}
/* _post.scss */
.post {
background: whitesmoke;
}
@function double($variable){
@return $variable *2;
}
.post{
font-size: double(2px);
}
.post--big{
width: percentage(.5);
font-size: max(12px, 14px, 16px);
background: rgba(231, 0.8, 2, .8);
}
$title: 'This is title';
.post__title{
content: quote($title);
}
%post-skeletor{
font:{ size: 12; weight: 700;}
box-sizing: border-box;
padding: 5px;
margin: 10px;
border: 1px solid whitesmoke;
}
.post-class {
font:{ size: 12; weight: 700;}
@mixin fight-with($monster) {
@if $monster == mechagodzilla {
.post__title{ &:after { @content } }
}
@else if $monster == spacegodzilla {
@content;
}
}
.post--mechagodzilla {
@mixin you-can-do-it {
@content;
}
@include you-can-do-it {
.yes-you-can { color: red }
}