Skip to content

Instantly share code, notes, and snippets.

@akfzambrana
Last active March 3, 2017 17:00
Show Gist options
  • Save akfzambrana/ae97dbbf4d48939e2af04b8eac07b0cd to your computer and use it in GitHub Desktop.
Save akfzambrana/ae97dbbf4d48939e2af04b8eac07b0cd to your computer and use it in GitHub Desktop.
Example using mixin
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
@mixin loader-base-config
color: red
position: fixed
box-sizing: border-box
left: -9999px
top: -9999px
width: 0
height: 0
overflow: hidden
z-index: 999999
&:after,
&:before
box-sizing: border-box
display: none
&.is-active
background-color: blue
width: 100%
height: 100%
left: 0
top: 0
&:after,
&:before
display: block
.class-1
@include loader-base-config
border: 1px solid red
.class-2
@include loader-base-config
text-decoration: underline
.class-1 {
color: red;
position: fixed;
box-sizing: border-box;
left: -9999px;
top: -9999px;
width: 0;
height: 0;
overflow: hidden;
z-index: 999999;
border: 1px solid red;
}
.class-1:after, .class-1:before {
box-sizing: border-box;
display: none;
}
.class-1.is-active {
background-color: blue;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.class-1.is-active:after, .class-1.is-active:before {
display: block;
}
.class-2 {
color: red;
position: fixed;
box-sizing: border-box;
left: -9999px;
top: -9999px;
width: 0;
height: 0;
overflow: hidden;
z-index: 999999;
text-decoration: underline;
}
.class-2:after, .class-2:before {
box-sizing: border-box;
display: none;
}
.class-2.is-active {
background-color: blue;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.class-2.is-active:after, .class-2.is-active:before {
display: block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment