-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_spacing.scss
131 lines (131 loc) · 3.18 KB
/
_spacing.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*!
* Spry Spacing
*/
.m-auto {
margin: auto;
}
.my-auto,
.mt-auto {
margin-top: auto;
}
.my-auto,
.mb-auto {
margin-bottom: auto;
}
.mx-auto,
.ml-auto {
margin-left: auto;
display: block;
}
.mx-auto,
.mr-auto {
margin-right: auto;
display: block;
}
@each $s, $space in $spacing {
@each $prop in (padding, margin) {
.#{str-slice($prop, 0, 1)}-#{$s} {
#{$prop}: #{$space};
}
.#{str-slice($prop, 0, 1)}x-#{$s},
.#{str-slice($prop, 0, 1)}l-#{$s} {
#{$prop}-left: #{$space};
}
.#{str-slice($prop, 0, 1)}x-#{$s},
.#{str-slice($prop, 0, 1)}r-#{$s} {
#{$prop}-right: #{$space};
}
.#{str-slice($prop, 0, 1)}y-#{$s},
.#{str-slice($prop, 0, 1)}t-#{$s} {
#{$prop}-top: #{$space};
}
.#{str-slice($prop, 0, 1)}y-#{$s},
.#{str-slice($prop, 0, 1)}b-#{$s} {
#{$prop}-bottom: #{$space};
}
@if $prop == margin and $s {
.#{str-slice($prop, 0, 1)}x-n#{$s},
.#{str-slice($prop, 0, 1)}l-n#{$s} {
#{$prop}-left: -#{$space};
}
.#{str-slice($prop, 0, 1)}x-n#{$s},
.#{str-slice($prop, 0, 1)}r-n#{$s} {
#{$prop}-right: -#{$space};
}
.#{str-slice($prop, 0, 1)}y-n#{$s},
.#{str-slice($prop, 0, 1)}t-n#{$s} {
#{$prop}-top: -#{$space};
}
.#{str-slice($prop, 0, 1)}y-n#{$s},
.#{str-slice($prop, 0, 1)}b-n#{$s} {
#{$prop}-bottom: -#{$space};
}
}
}
}
@each $breakpoint, $breakpoint_width in $breakpoints {
@media screen and (min-width: $breakpoint_width) {
.#{$breakpoint}-m-auto {
margin: auto;
}
.#{$breakpoint}-my-auto,
.#{$breakpoint}-mt-auto {
margin-top: auto;
}
.#{$breakpoint}-my-auto,
.#{$breakpoint}-mb-auto {
margin-bottom: auto;
}
.#{$breakpoint}-mx-auto,
.#{$breakpoint}-ml-auto {
margin-left: auto;
display: block;
}
.#{$breakpoint}-mx-auto,
.#{$breakpoint}-mr-auto {
margin-right: auto;
display: block;
}
@each $s, $space in $spacing {
@each $prop in (padding, margin) {
.#{$breakpoint}-#{str-slice($prop, 0, 1)}-#{$s} {
#{$prop}: #{$space};
}
.#{$breakpoint}-#{str-slice($prop, 0, 1)}x-#{$s},
.#{$breakpoint}-#{str-slice($prop, 0, 1)}l-#{$s} {
#{$prop}-left: #{$space};
}
.#{$breakpoint}-#{str-slice($prop, 0, 1)}x-#{$s},
.#{$breakpoint}-#{str-slice($prop, 0, 1)}r-#{$s} {
#{$prop}-right: #{$space};
}
.#{$breakpoint}-#{str-slice($prop, 0, 1)}y-#{$s},
.#{$breakpoint}-#{str-slice($prop, 0, 1)}t-#{$s} {
#{$prop}-top: #{$space};
}
.#{$breakpoint}-#{str-slice($prop, 0, 1)}y-#{$s},
.#{$breakpoint}-#{str-slice($prop, 0, 1)}b-#{$s} {
#{$prop}-bottom: #{$space};
}
@if $prop == margin and $s {
.#{$breakpoint}-#{str-slice($prop, 0, 1)}x-n#{$s},
.#{$breakpoint}-#{str-slice($prop, 0, 1)}l-n#{$s} {
#{$prop}-left: -#{$space};
}
.#{$breakpoint}-#{str-slice($prop, 0, 1)}x-n#{$s},
.#{$breakpoint}-#{str-slice($prop, 0, 1)}r-n#{$s} {
#{$prop}-right: -#{$space};
}
.#{$breakpoint}-#{str-slice($prop, 0, 1)}y-n#{$s},
.#{$breakpoint}-#{str-slice($prop, 0, 1)}t-n#{$s} {
#{$prop}-top: -#{$space};
}
.#{$breakpoint}-#{str-slice($prop, 0, 1)}y-n#{$s},
.#{$breakpoint}-#{str-slice($prop, 0, 1)}b-n#{$s} {
#{$prop}-bottom: -#{$space};
}
}
}
}
}
}