Debian Codegraph @

vendor/static/bulma/sass/utilities/mixins.sass

raw
1 @import "derived-variables"
2
3 =clearfix
4 &::after
5 clear: both
6 content: " "
7 display: table
8
9 =center($width, $height: 0)
10 position: absolute
11 @if $height != 0
12 left: calc(50% - (#{$width} * 0.5))
13 top: calc(50% - (#{$height} * 0.5))
14 @else
15 left: calc(50% - (#{$width} * 0.5))
16 top: calc(50% - (#{$width} * 0.5))
17
18 =fa($size, $dimensions)
19 display: inline-block
20 font-size: $size
21 height: $dimensions
22 line-height: $dimensions
23 text-align: center
24 vertical-align: top
25 width: $dimensions
26
27 =hamburger($dimensions)
28 -moz-appearance: none
29 -webkit-appearance: none
30 appearance: none
31 background: none
32 border: none
33 cursor: pointer
34 display: block
35 height: $dimensions
36 position: relative
37 width: $dimensions
38 span
39 background-color: currentColor
40 display: block
41 height: 1px
42 left: calc(50% - 8px)
43 position: absolute
44 transform-origin: center
45 transition-duration: $speed
46 transition-property: background-color, opacity, transform
47 transition-timing-function: $easing
48 width: 16px
49 &:nth-child(1)
50 top: calc(50% - 6px)
51 &:nth-child(2)
52 top: calc(50% - 1px)
53 &:nth-child(3)
54 top: calc(50% + 4px)
55 &:hover
56 background-color: bulmaRgba(black, 0.05)
57 // Modifers
58 &.is-active
59 span
60 &:nth-child(1)
61 transform: translateY(5px) rotate(45deg)
62 &:nth-child(2)
63 opacity: 0
64 &:nth-child(3)
65 transform: translateY(-5px) rotate(-45deg)
66
67 =overflow-touch
68 -webkit-overflow-scrolling: touch
69
70 =placeholder
71 $placeholders: ':-moz' ':-webkit-input' '-moz' '-ms-input'
72 @each $placeholder in $placeholders
73 &:#{$placeholder}-placeholder
74 @content
75
76 =reset
77 -moz-appearance: none
78 -webkit-appearance: none
79 appearance: none
80 background: none
81 border: none
82 color: currentColor
83 font-family: inherit
84 font-size: 1em
85 margin: 0
86 padding: 0
87
88 // Responsiveness
89
90 =from($device)
91 @media screen and (min-width: $device)
92 @content
93
94 =until($device)
95 @media screen and (max-width: $device - 1px)
96 @content
97
98 =between($from, $until)
99 @media screen and (min-width: $from) and (max-width: $until - 1px)
100 @content
101
102 =mobile
103 @media screen and (max-width: $tablet - 1px)
104 @content
105
106 =tablet
107 @media screen and (min-width: $tablet), print
108 @content
109
110 =tablet-only
111 @media screen and (min-width: $tablet) and (max-width: $desktop - 1px)
112 @content
113
114 =touch
115 @media screen and (max-width: $desktop - 1px)
116 @content
117
118 =desktop
119 @media screen and (min-width: $desktop)
120 @content
121
122 =desktop-only
123 @if $widescreen-enabled
124 @media screen and (min-width: $desktop) and (max-width: $widescreen - 1px)
125 @content
126
127 =until-widescreen
128 @if $widescreen-enabled
129 @media screen and (max-width: $widescreen - 1px)
130 @content
131
132 =widescreen
133 @if $widescreen-enabled
134 @media screen and (min-width: $widescreen)
135 @content
136
137 =widescreen-only
138 @if $widescreen-enabled and $fullhd-enabled
139 @media screen and (min-width: $widescreen) and (max-width: $fullhd - 1px)
140 @content
141
142 =until-fullhd
143 @if $fullhd-enabled
144 @media screen and (max-width: $fullhd - 1px)
145 @content
146
147 =fullhd
148 @if $fullhd-enabled
149 @media screen and (min-width: $fullhd)
150 @content
151
152 =breakpoint($name)
153 $breakpoint: map-get($breakpoints, $name)
154 @if $breakpoint
155 $from: map-get($breakpoint, "from")
156 $until: map-get($breakpoint, "until")
157 @if $from and $until
158 +between($from, $until)
159 @content
160 @else if $from
161 +from($from)
162 @content
163 @else if $until
164 +until($until)
165 @content
166
167 =ltr
168 @if not $rtl
169 @content
170
171 =rtl
172 @if $rtl
173 @content
174
175 =ltr-property($property, $spacing, $right: true)
176 $normal: if($right, "right", "left")
177 $opposite: if($right, "left", "right")
178 @if $rtl
179 #{$property}-#{$opposite}: $spacing
180 @else
181 #{$property}-#{$normal}: $spacing
182
183 =ltr-position($spacing, $right: true)
184 $normal: if($right, "right", "left")
185 $opposite: if($right, "left", "right")
186 @if $rtl
187 #{$opposite}: $spacing
188 @else
189 #{$normal}: $spacing
190
191 // Placeholders
192
193 =unselectable
194 -webkit-touch-callout: none
195 -webkit-user-select: none
196 -moz-user-select: none
197 -ms-user-select: none
198 user-select: none
199
200 =arrow($color: transparent)
201 border: 3px solid $color
202 border-radius: 2px
203 border-right: 0
204 border-top: 0
205 content: " "
206 display: block
207 height: 0.625em
208 margin-top: -0.4375em
209 pointer-events: none
210 position: absolute
211 top: 50%
212 transform: rotate(-45deg)
213 transform-origin: center
214 width: 0.625em
215
216 =block($spacing: $block-spacing)
217 &:not(:last-child)
218 margin-bottom: $spacing
219
220 =delete
221 +unselectable
222 -moz-appearance: none
223 -webkit-appearance: none
224 background-color: bulmaRgba($scheme-invert, 0.2)
225 border: none
226 border-radius: $radius-rounded
227 cursor: pointer
228 pointer-events: auto
229 display: inline-block
230 flex-grow: 0
231 flex-shrink: 0
232 font-size: 0
233 height: 20px
234 max-height: 20px
235 max-width: 20px
236 min-height: 20px
237 min-width: 20px
238 outline: none
239 position: relative
240 vertical-align: top
241 width: 20px
242 &::before,
243 &::after
244 background-color: $scheme-main
245 content: ""
246 display: block
247 left: 50%
248 position: absolute
249 top: 50%
250 transform: translateX(-50%) translateY(-50%) rotate(45deg)
251 transform-origin: center center
252 &::before
253 height: 2px
254 width: 50%
255 &::after
256 height: 50%
257 width: 2px
258 &:hover,
259 &:focus
260 background-color: bulmaRgba($scheme-invert, 0.3)
261 &:active
262 background-color: bulmaRgba($scheme-invert, 0.4)
263 // Sizes
264 &.is-small
265 height: 16px
266 max-height: 16px
267 max-width: 16px
268 min-height: 16px
269 min-width: 16px
270 width: 16px
271 &.is-medium
272 height: 24px
273 max-height: 24px
274 max-width: 24px
275 min-height: 24px
276 min-width: 24px
277 width: 24px
278 &.is-large
279 height: 32px
280 max-height: 32px
281 max-width: 32px
282 min-height: 32px
283 min-width: 32px
284 width: 32px
285
286 =loader
287 animation: spinAround 500ms infinite linear
288 border: 2px solid $grey-lighter
289 border-radius: $radius-rounded
290 border-right-color: transparent
291 border-top-color: transparent
292 content: ""
293 display: block
294 height: 1em
295 position: relative
296 width: 1em
297
298 =overlay($offset: 0)
299 bottom: $offset
300 left: $offset
301 position: absolute
302 right: $offset
303 top: $offset