This repository has been archived by the owner on Jun 9, 2022. It is now read-only.
forked from supple-kit/supple-css
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_retain.scss
73 lines (54 loc) · 1.54 KB
/
_retain.scss
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
/* =========================================================================
objects.retain
Page-level constraining and wrapping elements.
========================================================================= */
/* Variables
========================================================================= */
$supple-retain-text-size: 40em !default;
$supple-retain-space: $supple-space !default;
/**
* Sizes
*/
$supple-retain-sizes: (
lap: 640px,
desk: 960px,
wall: $supple-static-breakpoint,
text: $supple-retain-text-size
) !default;
/* Functions/Mixins
========================================================================= */
/* Module
========================================================================= */
.o-retain {
--o-retain-max-width: 100%;
max-width: var(--o-retain-max-width);
@include supple-rem(padding-right, $supple-retain-space);
@include supple-rem(padding-left, $supple-retain-space);
margin-right: auto;
margin-left: auto;
}
/**
* Modifier: text
*/
.o-retain--text {
--o-retain-max-width: #{$supple-retain-text-size};
padding-right: 0;
padding-left: 0;
margin-left: 0;
margin-right: 0;
}
/**
* Modifier: no-padding
*/
.o-retain--no-padding {
padding-right: 0;
padding-left: 0;
}
/* Common width modifiers, for use in browsers without
custom-property support
========================================================================= */
@each $key, $value in $supple-retain-sizes {
.o-retain--#{$key} {
@include supple-rem(max-width, $value);
}
}