Skip to content

Commit 57c4ff5

Browse files
committed
added css mixins
1 parent 932b104 commit 57c4ff5

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

source/styles.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ html {
1818

1919
body {
2020
min-height: 100%;
21-
position: sticky;
2221
}
2322

2423
code {

source/styling/mixins.scss

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
media mixin
3+
-----------
4+
5+
usage:
6+
@include media(500px) {
7+
// css for above 500px
8+
}
9+
10+
@include media(500px, 600px) {
11+
// css for between 500px - 599px
12+
}
13+
14+
------------------------------------------ */
15+
@mixin media($from, $to: null) {
16+
$query: 'screen';
17+
@if $from {
18+
$query: unquote("#{$query} and (min-width: #{$from})")
19+
}
20+
@if $to {
21+
$query: unquote("#{$query} and (max-width: #{$to - 1px})")
22+
}
23+
@media #{$query} {
24+
@content;
25+
}
26+
}
27+
28+
29+
/*
30+
clearfix mixin
31+
--------------
32+
33+
Clearfix hack for floats
34+
------------------------------------------ */
35+
@mixin clearfix($pseudo-element: 'before') {
36+
&::after {
37+
content: "";
38+
display: table;
39+
clear: both;
40+
}
41+
}

0 commit comments

Comments
 (0)