-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_floats.scss
More file actions
52 lines (42 loc) · 1.48 KB
/
_floats.scss
File metadata and controls
52 lines (42 loc) · 1.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
// =============================
// Enable Private Variables
// =============================
$_floats-enable: true !default;
$_viewport-floats-enable: true !default;
// =============================
// Core Float Utility Helper Classes
// =============================
// Un-namespaced Classes are to be used globally when an elements layout is consistant across all viewports.
@if ($_floats-enable) {
.float-left,
%float-left {
float: left !important
}
.float-right,
%float-right {
float: right !important
}
.float-none,
%float-none {
float: none !important
}
}
// =============================
// Core Viewport Float Utility Helper Attributes
// =============================
//
// Core Viewport Margin Utility Helper Attributes are generated via the below loop to create attributes for certain viewports.
// The advantage to this, is it allows floats to be added to a certain element specifically for a breakpoint which you have defined.
// Example Use - data-desk="float-left" data-lap="float-none".
//
@if ($_viewport-floats-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}~="float-left"] { float: left !important }
[data-#{$viewport}~="float-right"] { float: right !important }
[data-#{$viewport}~="float-none"] { float: none !important }
}
}
}