Skip to content

Commit 213d3f1

Browse files
style: added clamp
1 parent 4442620 commit 213d3f1

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

style/globals.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
@layer base {
66
:root {
7-
/* LAYOUT */
8-
/* 100% of root, 5rem to 1rem, screen 1440 - 320 */
9-
--section-block-padding: clamp(2rem, 4.286vw + 1.143rem, 5rem);
7+
/* Clamps */
8+
/* 100% of root, 5rem to 2rem, screen 1440 - 320 */
9+
--clamp_5-2: clamp(2rem, 4.286vw + 1.143rem, 5rem);
1010

1111
/* 100% of root, 4rem to 1rem, screen 1440 - 320 */
12-
--section-inline-padding: clamp(1rem, 4.286vw + 0.143rem, 4rem);
12+
--clamp_4-1: clamp(1rem, 4.286vw + 0.143rem, 4rem);
1313

1414
/* TYPOGRAPHY */
1515
/* 100% of root, desktop 4rem, mobile 2.5rem, screen 1440 - 320 */
@@ -84,7 +84,7 @@
8484

8585
/* LAYOUT */
8686
section {
87-
@apply px-section_x py-section_y;
87+
@apply px-clamp_4-1 py-clamp_5-2;
8888
}
8989

9090
.section_container {

tailwind.config.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ const config: Config = {
2929

3030
extend: {
3131
padding: {
32-
section_x: 'var(--section-inline-padding)',
33-
section_y: 'var(--section-block-padding)',
34-
section_card_offset:
35-
'calc(var(--section-block-padding) + var(--card-offset))'
32+
'clamp_5-2': 'var(--clamp_5-2)',
33+
'clamp_4-1': 'var(--clamp_4-1)',
34+
section_card_offset: 'calc(var(--clamp_5-2) + var(--card-offset))'
3635
},
3736
margin: {
3837
card_offset: 'var(--card-offset)'

0 commit comments

Comments
 (0)