-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSS.css
More file actions
124 lines (105 loc) · 2.74 KB
/
CSS.css
File metadata and controls
124 lines (105 loc) · 2.74 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
/* Modern CSS with layers, nesting, and container queries */
@layer base, components, utilities;
@layer base {
:root {
--color-primary: oklch(0.65 0.25 260);
--color-secondary: oklch(0.55 0.18 150);
--color-surface: oklch(0.98 0.005 260);
--color-text: oklch(0.2 0.02 260);
--color-border: oklch(0.85 0.01 260);
--radius-sm: 0.375rem;
--radius-md: 0.75rem;
--radius-lg: 1.5rem;
--shadow-sm: 0 1px 3px color-mix(in oklch, var(--color-text) 10%, transparent);
--shadow-md: 0 4px 12px color-mix(in oklch, var(--color-text) 15%, transparent);
--transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
--transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
}
body {
font-family: system-ui, -apple-system, sans-serif;
color: var(--color-text);
background: var(--color-surface);
line-height: 1.6;
}
}
@layer components {
.card-grid {
container-type: inline-size;
display: grid;
gap: 1.5rem;
grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.card {
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
padding: 1.5rem;
box-shadow: var(--shadow-sm);
transition: box-shadow var(--transition-fast), transform var(--transition-fast);
&:hover {
box-shadow: var(--shadow-md);
transform: translateY(-2px);
}
& .card-title {
font-size: 1.25rem;
font-weight: 600;
margin-block-end: 0.5rem;
}
& .card-body {
color: color-mix(in oklch, var(--color-text) 75%, transparent);
}
&:has(.card-badge) {
border-color: var(--color-primary);
}
}
@container (max-width: 600px) {
.card-grid {
grid-template-columns: 1fr;
}
}
.btn {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.625rem 1.25rem;
border: none;
border-radius: var(--radius-sm);
font-weight: 500;
cursor: pointer;
transition: all var(--transition-fast);
&.btn-primary {
background: var(--color-primary);
color: white;
&:hover { filter: brightness(1.1); }
}
}
}
@layer utilities {
@keyframes fade-in {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.6; }
}
.animate-fade-in {
animation: fade-in 0.4s ease-out both;
}
.animate-pulse {
animation: pulse 2s ease-in-out infinite;
}
}
@media (prefers-color-scheme: dark) {
:root {
--color-surface: oklch(0.15 0.01 260);
--color-text: oklch(0.9 0.01 260);
--color-border: oklch(0.3 0.01 260);
}
}