-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_position.scss
More file actions
54 lines (44 loc) · 1.59 KB
/
_position.scss
File metadata and controls
54 lines (44 loc) · 1.59 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
// =============================
// Enable Private Variables
// =============================
$_position-enable: true !default;
$_viewport-position-enable: true !default;
// =============================
// Core Position Utility Helper Classes
// =============================
//
// Un-namespaced Classes are to be used globally when an elements layout is consistant across all viewports.
//
@if ($_position-enable) {
.position-static,
%position-static {
position: static !important
}
.position-relative,
%position-relative {
position: relative !important
}
.position-absolute,
%position-absolute {
position: absolute !important
}
}
// =============================
// Core Viewport Position Utility Helper Attributes
// =============================
//
// Core Viewport Position Utility Helper Attributes are generated via the below loop to create attributes for certain viewports.
// The advantage to this, is it allows position to be added to a certain element specifically for a breakpoint which you have defined.
// Example Use - data-desk="position-absolute" data-lap="position-static".
//
@if ($_viewport-position-enable) {
@each $viewport, $breakpoint in $viewport-values {
// Attributes only apply once certain breakpoint is triggered.
@include media-query($from: nth($breakpoint, 1),
$to: nth($breakpoint, 2)) {
[data-#{$viewport}~="position-static"] { position: static !important }
[data-#{$viewport}~="position-relative"] { position: relative !important }
[data-#{$viewport}~="position-absolute"] { position: absolute !important }
}
}
}