forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflex-addon.styl
More file actions
201 lines (179 loc) · 5.48 KB
/
flex-addon.styl
File metadata and controls
201 lines (179 loc) · 5.48 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
fr(selector, name, i = '')
unquote(replace(unquote('<i>'), unquote(i), replace(unquote('<name>'), unquote(name), unquote(selector))))
fe(selector, name, noProc, i = '')
if noProc
return fr(selector, name, i)
return unquote(join(',', fr(selector, '', i) fr(selector, name, i)))
fg($name, $size)
$noProcZero = $size == 0
$noProcNotZero = $size > 0
@media (min-width $size)
{fe('.flex<name>-', $name, $noProcNotZero)}
&block
display block
&inline
display inline-block
$all-{$name}-inline-flex
display inline-flex
$row-{$name}-reverse
flex-direction row-reverse
$column-{$name}-reverse
flex-direction column-reverse
for $space, $value in $spaces
.q-pa{$name}-{$space}
padding: $value.y $value.x
.q-pl{$name}-{$space}
padding-left: $value.x
.q-pr{$name}-{$space}
padding-right: $value.x
.q-pt{$name}-{$space}
padding-top: $value.y
.q-pb{$name}-{$space}
padding-bottom: $value.y
.q-px{$name}-{$space}
@extends .q-pl{$name}-{$space}, .q-pr{$name}-{$space}
.q-py{$name}-{$space}
@extends .q-pt{$name}-{$space}, .q-pb{$name}-{$space}
.q-ma{$name}-{$space}
margin: $value.y $value.x
.q-ml{$name}-{$space}
margin-left: $value.x
.q-mr{$name}-{$space}
margin-right: $value.x
.q-mt{$name}-{$space}
margin-top: $value.y
.q-mb{$name}-{$space}
margin-bottom: $value.y
.q-mx{$name}-{$space}
@extends .q-ml{$name}-{$space}, .q-mr{$name}-{$space}
.q-my{$name}-{$space}
@extends .q-mt{$name}-{$space}, .q-mb{$name}-{$space}
.q-ml{$name}-auto
margin-left auto
.q-mr{$name}-auto
margin-right auto
.q-mx{$name}-auto
@extends .q-ml{$name}-auto, .q-mr{$name}-auto
.q-my-{$name}-form:not(.q-if-full-width)
margin-top $input-margin-top
margin-bottom $input-margin-bottom
&.q-if-dense
margin-top $input-dense-margin-top
margin-bottom $input-dense-margin-bottom
.row, .column, .flex
if $noProcNotZero
{fr('&.inline<name>', $name)}
@extends $all-{$name}-inline-flex
{fr('&<name>', $name)}
display flex
flex-wrap wrap
{fe('&.inline<name>', $name, $noProcZero)}
@extends $all-{$name}-inline-flex
.row
if $noProcNotZero
{fr('&.reverse<name>', $name)}
@extends $row-{$name}-reverse
{fr('&<name>', $name)}
flex-direction row
{fe('&.reverse<name>', $name, $noProcZero)}
@extends $row-{$name}-reverse
.column
if $noProcNotZero
{fr('&.reverse<name>', $name)}
@extends $column-{$name}-reverse
{fr('&<name>', $name)}
flex-direction column
{fe('&.reverse<name>', $name, $noProcZero)}
@extends $column-{$name}-reverse
{fr('.wrap<name>', $name)}
flex-wrap wrap
{fr('.no-wrap<name>', $name)}
flex-wrap nowrap
{fr('.reverse-wrap<name>', $name)}
flex-wrap wrap-reverse
{fr('.order<name>-', $name)}
&first
order -10000
&last
order 10000
&none
order 0
{fr('.justify<name>-', $name)}
&start
justify-content flex-start
&end
justify-content flex-end
¢er
justify-content center
&between
justify-content space-between
&around
justify-content space-around
{fr('.items<name>-', $name)}
&start
align-items flex-start
&end
align-items flex-end
¢er
align-items center
&baseline
align-items baseline
&stretch
align-items stretch
{fr('.content<name>-', $name)}
&start
align-content flex-start
&end
align-content flex-end
¢er
align-content center
&between
align-content space-between
&around
align-content space-around
{fr('.self<name>-', $name)}
&start
align-self flex-start
&end
align-self flex-end
¢er
align-self center
&baseline
align-self baseline
&stretch
align-self stretch
{fr('.flex<name>-center', $name)}
@extend .items{$name}-center
@extend .justify{$name}-center
for $gname, $gsize in $flex-gutter
{fr('.gutter<name>-', $name)}
&x-{$gname}
margin-left (- $gsize)
> div
padding-left $gsize
&y-{$gname}
margin-top (- $gsize)
> div
padding-top $gsize
&{$gname}
@extends .gutter{$name}-x-{$gname}, .gutter{$name}-y-{$gname}
> div
@extends .gutter{$name}-x-{$gname} > div, .gutter{$name}-y-{$gname} > div
for $name2, $size2 in $sizes
if $size >= $size2
$name2c = s('-%s', unquote($name2))
$noProcNotZero2 = $size2 > 0
for $i in (0..$flex-cols)
$ic = s('%s', $i)
{fr('.row<name>', $name)}
{fe('> .col<name>-<i>', $name2c, $noProcNotZero2, $ic)}
height auto
width (round($i / $flex-cols * 100, 4))%
{fe('> .offset<name>-<i>', $name2c, $noProcNotZero2, $ic)}
margin-left (round($i / $flex-cols * 100, 4))%
{fr('.column<name>', $name)}
{fe('> .col<name>-<i>', $name2c, $noProcNotZero2, $ic)}
height (round($i / $flex-cols * 100, 4))%
width auto
for $name, $size in $sizes
fg(s('-%s', unquote($name)), $size)