-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_margins.scss
More file actions
52 lines (41 loc) · 1.41 KB
/
_margins.scss
File metadata and controls
52 lines (41 loc) · 1.41 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
// =============================
$_margins-enable: true !default;
$_viewport-margins-enable: true !default;
// =============================
// Global Margin Utility Helper Classes
// =============================
//
// Un-namespaced Classes are to be used globally when an elements spacing is consistant across all viewports.
// Example Use - class="mar-r-2x".
//
@if ($_margins-enable) {
@include generate-spacing-batch("margin");
}
// =============================
// Viewport Margin Utility Helper Attributes
// =============================
//
// Core Viewport Margin Utility Helper Attributes are generated via the below mixin to create attributes for certain viewports.
// The advantage to this, is it allows margins to be added to a certain element specifically for a breakpoint which you have defined.
// Example Use - data-desk="mar-r-2x" data-palm="mar-r-0".
//
//
// Attribute Name Key
// -t- = Top
// -b- = Bottom
// -l- = Left
// -r- = Right
// -e- = Ends (Top & Bottom)
// -s- = Sides (Left & Right)
//
@if ($_viewport-margins-enable) {
@each $viewport, $viewport-val in $viewport-values {
// Attributes only apply once certain breakpoint is triggered.
@include media-query($from: nth($viewport-val, 1),
$to: nth($viewport-val, 2)) {
@include generate-spacing-batch("margin", $namespace: $viewport);
}
}
}