-
Notifications
You must be signed in to change notification settings - Fork 173
/
Copy path_patterns_suru.scss
163 lines (138 loc) · 5.53 KB
/
_patterns_suru.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
@import 'settings';
@mixin vf-p-suru {
$vf-suru-min-height: 24rem;
// add suru backgrounds to the themes
@at-root {
:root,
.is-light,
.is-paper {
// new suru backgrounds don't have white (light) version,
// they need paper background
--vf-suru-background: #{$color-paper};
--vf-suru-25-75: url('#{$assets-path}505636a6-0000_suru-main-25x75-light.png');
--vf-suru-50-50: url('#{$assets-path}e66e280b-0001_suru-main-50x50-light.png');
--vf-suru-fan-top-right: url('#{$assets-path}ed94a429-0000_suru-corner-fan--top-right-light.jpg');
--vf-suru-fan-bottom-right: url('#{$assets-path}2adade55-suru-corner-fan--bottom-0000_light.jpg');
--vf-suru-pyramid-top-left: url('#{$assets-path}8846d6a5-suru-pyramid-top-corner_0000_light.jpg');
--vf-suru-pyramid-top-right: url('#{$assets-path}5d9f8cd3-suru-pyramid-top-right-corner_0000_light.jpg');
--vf-suru-divider: url('#{$assets-path}9e25feb2-suru-triangle-from-left-edge--_0000_light.jpg');
}
.is-dark {
--vf-suru-background: #{$colors--theme--background-default};
--vf-suru-25-75: url('#{$assets-path}7ccd4f39-0003_suru-main-25x75-dark.png');
--vf-suru-50-50: url('#{$assets-path}70c2bbcd-0002_suru-main-50x50-dark.png');
--vf-suru-fan-top-right: url('#{$assets-path}fd6ef995-0001_suru-corner-fan--top-right-dark.jpg');
--vf-suru-fan-bottom-right: url('#{$assets-path}725af649-suru-corner-fan--bottom-0001_dark.jpg');
--vf-suru-pyramid-top-left: url('#{$assets-path}86ed5771-suru-pyramid-top-corner_0001_dark.jpg');
--vf-suru-pyramid-top-right: url('#{$assets-path}9f740811-suru-pyramid-top-right-corner_0001_dark.jpg');
--vf-suru-divider: url('#{$assets-path}9c0bee5c-suru-triangle-from-left-edge--_0001_dark.jpg');
}
}
.p-suru,
.p-suru--25-75,
.p-suru--50-50 {
background-color: var(--vf-suru-background);
color: $colors--theme--text-default;
// padding top based on p-section--hero
// bottom padding not needed (as it's covered by the suru background image)
padding-top: $spv--large;
// on large screens, same as %section-padding--shallow
@media (min-width: $breakpoint-large) {
padding-top: $spv--x-large;
}
// for backwards compatibility with p-suru used as a standalone component
// we remove top padding if there are no children
// for this to work there can't be any whitespace in the suru element
// <div class="p-suru"></div>
&:-moz-only-whitespace,
&:empty {
padding-top: 0;
}
&::after {
aspect-ratio: calc(2600 / 471); // aspect ratio calculated from image dimensions
background-image: var(--vf-suru-25-75);
background-size: contain;
content: '';
display: block;
margin: 0 auto;
max-width: $grid-max-width;
}
&.p-suru--50-50::after {
// aspect ratio of 50/50 background is the same, so no need to override
background-image: var(--vf-suru-50-50);
}
}
.p-suru--fan-top,
.p-suru--fan-bottom,
.p-suru--pyramid-left,
.p-suru--pyramid-right {
background-color: var(--vf-suru-background);
color: $colors--theme--text-default;
// same as %section-padding--default
padding-bottom: $spv--strip-regular * 0.5;
@media (min-width: $breakpoint-large) {
padding-bottom: $spv--strip-regular;
}
// padding top based on p-section--hero
padding-top: $spv--large;
// on large screens, same as %section-padding--shallow
@media (min-width: $breakpoint-large) {
padding-top: $spv--x-large;
}
}
// only apply suru background images on large screens
@media (min-width: $breakpoint-large) {
.p-suru--fan-top,
.p-suru--fan-bottom,
.p-suru--pyramid-left,
.p-suru--pyramid-right {
min-height: $vf-suru-min-height;
}
.p-suru--fan-top,
.p-suru--fan-bottom {
background-image: var(--vf-suru-fan-top-right);
background-position: top right;
background-repeat: no-repeat;
background-size: 32rem 24.09rem; // based on image dimensions (2048x1542) scaled down by 0.25, coverted to rem
}
.p-suru--fan-bottom {
background-image: var(--vf-suru-fan-bottom-right);
background-position: bottom right;
}
.p-suru--pyramid-right,
.p-suru--pyramid-left {
background-image: var(--vf-suru-pyramid-top-left);
background-position: top left;
background-repeat: no-repeat;
background-size: 22.125rem 16.1718rem; // based on image dimensions (1380x1035) scaled down by 0.25, converted to rem
}
.p-suru--pyramid-right {
background-image: var(--vf-suru-pyramid-top-right);
background-position: top right;
}
}
.p-suru--divider {
background-color: var(--vf-suru-background);
color: $colors--theme--text-default;
// same as %section-padding--deep
padding-bottom: calc($spv--strip-deep / 2);
position: relative;
// only apply suru background images on large screens
@media (min-width: $breakpoint-large) {
padding-bottom: calc(2 * $spv--strip-deep);
&::after {
$suru-divider-height: 13.75rem; // 220px / 16px = 13.75rem
background-image: var(--vf-suru-divider);
background-position: bottom left;
background-repeat: no-repeat;
background-size: 80rem 14.8125rem; // based on image dimensions (2560x474) scaled down by 0.5, converted to rem
bottom: calc((2 * $spv--strip-deep - $suru-divider-height) / 2);
content: '';
display: block;
height: $suru-divider-height;
position: absolute;
width: 100%;
}
}
}
}