Repository navigation
Expand file tree
/
Copy pathutilities.css
More file actions
216 lines (187 loc) · 4.24 KB
/
Copy pathutilities.css
File metadata and controls
216 lines (187 loc) · 4.24 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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
@import "@fylgja/utilities/utils/toggle.css";
/**
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/auto-grid.css
*/
@utility auto-grid {
--max-col-size: calc(var(--spacing) * 14);
display: grid;
grid-template-columns: repeat(
auto-fill,
minmax(min(100%, var(--max-col-size)), 1fr)
);
}
@utility max-col-size-* {
--max-col-size: calc(var(--spacing) * --value(integer));
}
/**
* This version still requires to override the Tailwind values with out own
*
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/container.css
* See issue: https://github.com/tailwindlabs/tailwindcss/discussions/16132#discussioncomment-12804042
*/
:root {
--container-size: 1280px;
--container-gap: 1.25rem;
}
@utility container {
max-width: none;
width: auto;
inline-size: min(100% - var(--container-gap) * 2, var(--container-size));
margin-inline: auto;
}
/**
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/flow.css
*/
@utility flow {
--flow: 1em;
> :where(:not(:first-child)) {
margin-block: var(--flow) 0;
}
> :first-child {
margin-block: 0;
}
}
@utility flow-none {
> * {
margin-block: 0;
}
}
/**
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/overlay.css
*/
@utility overlay {
--overlay-bg: hsl(0 0% 0% / 60%);
--overlay-fg: #fff;
border-image: 0 fill linear-gradient(0deg, var(--overlay-bg), transparent);
color: var(--overlay-fg);
}
/**
* Add missing defaults
*
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/rounded.css
*/
@utility rounded-inherit {
border-radius: inherit;
}
@utility round {
aspect-ratio: 1;
border-radius: 100000px;
overflow: clip;
}
/**
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/scroll.css
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/scrollbar.css
* TODO: consider adding scroll-mask, but first see how this works with the mask utility
*/
@utility scroll-x {
overflow-x: auto;
overscroll-behavior-x: contain;
}
@utility scroll-y {
overflow-y: auto;
overscroll-behavior-y: contain;
}
@utility scrollbar-none {
scrollbar-width: none;
}
@utility scrollbar-thin {
scrollbar-width: thin;
}
/**
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/snap.css
* Shorthand, might rework this in laterphase for v3
*/
@utility snap {
--snap-dir: x mandatory;
--snap-stop: normal;
--snap-align: start;
scroll-snap-type: var(--snap-dir);
scroll-snap-stop: var(--snap-stop);
scroll-behavior: smooth;
> * {
scroll-snap-align: var(--snap-align);
}
}
/**
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/stack.css
*/
@utility stack {
display: grid;
> *,
> ::before,
> ::after {
grid-area: 1/1;
}
}
/**
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/stretched-link.css
*/
@utility stretched-link {
&::after {
content: "";
position: absolute;
inset: 0;
}
}
/**
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/typography.css
*/
@utility lead {
font-size: large;
font-weight: bold;
}
/**
* Better defaults
*
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/divide.css
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/flex.css
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/list.css
*/
@utility divide-y {
:where(& > :not(:last-child)) {
border-color: inherit;
padding-block: 0 var(--flow);
}
}
@utility divide-y-* {
:where(& > :not(:last-child)) {
border-color: inherit;
padding-block: 0 var(--flow);
}
}
@utility divide-x {
:where(& > :not(:last-child)) {
border-color: inherit;
padding-inline: 0 var(--flow);
}
}
@utility divide-x-* {
:where(& > :not(:last-child)) {
border-color: inherit;
padding-inline: 0 var(--flow);
}
}
@layer utilities {
:where(:is(.flex-col, .flex-wrap):not(dialog, [popover])) {
display: flex;
}
}
@utility list-none {
&::-webkit-details-marker {
display: none;
}
}
/**
* Extend with int-less versions
*
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/gap.css
* @source https://github.com/fylgja/fylgja/blob/main/utilities/utils/line-clamp.css
*/
@theme inline {
--gap-sm: 0.5em;
--line-clamp: 3;
}
@utility gap {
--gap: 1em;
gap: var(--gap);
}