@auriel/peppertino 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.txt +122 -122
- package/README.md +104 -2
- package/dist/accordion.js +51 -0
- package/dist/accordion.js.map +7 -0
- package/dist/main.css +2664 -65
- package/dist/main.css.map +1 -1
- package/dist/peppertino.js +50 -0
- package/dist/peppertino.js.map +3 -3
- package/index.html +587 -18
- package/package.json +1 -1
- package/src/js/accordion.js +61 -0
- package/src/js/peppertino.js +2 -0
- package/src/scss/accordion.scss +156 -0
- package/src/scss/alert.scss +204 -0
- package/src/scss/base.scss +130 -36
- package/src/scss/card.scss +4 -4
- package/src/scss/dark-mode.scss +474 -0
- package/src/scss/footer.scss +2 -2
- package/src/scss/forms/fieldset.scss +4 -4
- package/src/scss/forms/text-field.scss +4 -4
- package/src/scss/forms/validation.scss +1 -1
- package/src/scss/header.scss +8 -8
- package/src/scss/main.scss +4 -0
- package/src/scss/section.scss +1 -1
- package/src/scss/select.scss +5 -5
- package/src/scss/table.scss +5 -5
- package/src/scss/utilities.scss +243 -0
package/package.json
CHANGED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
document.querySelectorAll('.pp-accordion').forEach((accordion) => {
|
|
3
|
+
const allowMultiple = accordion.hasAttribute('data-allow-multiple');
|
|
4
|
+
|
|
5
|
+
accordion.querySelectorAll('.pp-accordion__trigger').forEach((trigger) => {
|
|
6
|
+
const panelId = trigger.getAttribute('aria-controls');
|
|
7
|
+
const panel = panelId
|
|
8
|
+
? document.getElementById(panelId)
|
|
9
|
+
: trigger.nextElementSibling;
|
|
10
|
+
|
|
11
|
+
if (!panel) return;
|
|
12
|
+
|
|
13
|
+
// Ensure ARIA state matches DOM on init
|
|
14
|
+
const isOpen = trigger.getAttribute('aria-expanded') === 'true';
|
|
15
|
+
panel.setAttribute('aria-hidden', isOpen ? 'false' : 'true');
|
|
16
|
+
if (isOpen) panel.classList.add('is-open');
|
|
17
|
+
|
|
18
|
+
trigger.addEventListener('click', () => {
|
|
19
|
+
const expanded = trigger.getAttribute('aria-expanded') === 'true';
|
|
20
|
+
|
|
21
|
+
if (!allowMultiple) {
|
|
22
|
+
accordion.querySelectorAll('.pp-accordion__trigger').forEach((t) => {
|
|
23
|
+
if (t === trigger) return;
|
|
24
|
+
t.setAttribute('aria-expanded', 'false');
|
|
25
|
+
const p = t.getAttribute('aria-controls')
|
|
26
|
+
? document.getElementById(t.getAttribute('aria-controls'))
|
|
27
|
+
: t.nextElementSibling;
|
|
28
|
+
if (p) {
|
|
29
|
+
p.setAttribute('aria-hidden', 'true');
|
|
30
|
+
p.classList.remove('is-open');
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const next = !expanded;
|
|
36
|
+
trigger.setAttribute('aria-expanded', String(next));
|
|
37
|
+
panel.setAttribute('aria-hidden', String(!next));
|
|
38
|
+
panel.classList.toggle('is-open', next);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Keyboard: Home/End focus management within accordion
|
|
42
|
+
trigger.addEventListener('keydown', (e) => {
|
|
43
|
+
const triggers = [...accordion.querySelectorAll('.pp-accordion__trigger')];
|
|
44
|
+
const idx = triggers.indexOf(trigger);
|
|
45
|
+
if (e.key === 'ArrowDown') {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
triggers[(idx + 1) % triggers.length].focus();
|
|
48
|
+
} else if (e.key === 'ArrowUp') {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
triggers[(idx - 1 + triggers.length) % triggers.length].focus();
|
|
51
|
+
} else if (e.key === 'Home') {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
triggers[0].focus();
|
|
54
|
+
} else if (e.key === 'End') {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
triggers[triggers.length - 1].focus();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
})();
|
package/src/js/peppertino.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// PeppertinoCSS — aggregator
|
|
2
2
|
// Imports all JS components so users can include a single <script> tag.
|
|
3
|
+
// Each component is a self-contained IIFE in its own file — import only what you need.
|
|
3
4
|
|
|
5
|
+
import './accordion.js';
|
|
4
6
|
import './carousel.js';
|
|
5
7
|
import './header.js';
|
|
6
8
|
import './modal.js';
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// PeppertinoCSS — Accordion
|
|
2
|
+
|
|
3
|
+
@use 'sass:map';
|
|
4
|
+
@use 'base' as *;
|
|
5
|
+
|
|
6
|
+
// ─── Container ────────────────────────────────────────────────────────────────
|
|
7
|
+
.pp-accordion {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
width: 100%;
|
|
11
|
+
border-radius: 16px;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
border: 1px solid $color-border;
|
|
14
|
+
background: var(--pp-bg-card);
|
|
15
|
+
box-shadow: $shadow-sm;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// ─── Item ─────────────────────────────────────────────────────────────────────
|
|
19
|
+
.pp-accordion__item {
|
|
20
|
+
border-bottom: 1px solid $color-border;
|
|
21
|
+
|
|
22
|
+
&:last-child {
|
|
23
|
+
border-bottom: none;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// ─── Trigger ──────────────────────────────────────────────────────────────────
|
|
28
|
+
.pp-accordion__trigger {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
width: 100%;
|
|
33
|
+
padding: spacing(4) spacing(5);
|
|
34
|
+
background: transparent;
|
|
35
|
+
border: none;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
font-family: $font-sans;
|
|
38
|
+
font-size: font-size('base');
|
|
39
|
+
font-weight: map.get($font-weights, 'medium');
|
|
40
|
+
color: $color-on-surface;
|
|
41
|
+
text-align: left;
|
|
42
|
+
transition: background $transition-fast, color $transition-fast;
|
|
43
|
+
gap: spacing(3);
|
|
44
|
+
|
|
45
|
+
&:hover {
|
|
46
|
+
background: $color-neutral-50;
|
|
47
|
+
color: $color-primary;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&[aria-expanded='true'] {
|
|
51
|
+
color: $color-primary;
|
|
52
|
+
background: $color-neutral-50;
|
|
53
|
+
|
|
54
|
+
.pp-accordion__icon {
|
|
55
|
+
transform: rotate(180deg);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ─── Icon (chevron) ───────────────────────────────────────────────────────────
|
|
61
|
+
.pp-accordion__icon {
|
|
62
|
+
flex-shrink: 0;
|
|
63
|
+
width: 18px;
|
|
64
|
+
height: 18px;
|
|
65
|
+
stroke: currentColor;
|
|
66
|
+
stroke-width: 2;
|
|
67
|
+
fill: none;
|
|
68
|
+
transition: transform $transition-base;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ─── Panel ────────────────────────────────────────────────────────────────────
|
|
72
|
+
.pp-accordion__panel {
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
max-height: 0;
|
|
75
|
+
transition: max-height $transition-slow, padding $transition-base;
|
|
76
|
+
padding: 0 spacing(5);
|
|
77
|
+
|
|
78
|
+
&[aria-hidden='false'],
|
|
79
|
+
&.is-open {
|
|
80
|
+
max-height: 1000px;
|
|
81
|
+
padding: 0 spacing(5) spacing(4);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ─── Content ──────────────────────────────────────────────────────────────────
|
|
86
|
+
.pp-accordion__content {
|
|
87
|
+
font-family: $font-sans;
|
|
88
|
+
font-size: font-size('sm');
|
|
89
|
+
font-weight: map.get($font-weights, 'regular');
|
|
90
|
+
color: $color-neutral-500;
|
|
91
|
+
line-height: $line-height-base;
|
|
92
|
+
padding-top: spacing(1);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// ─── Variant: flush (no outer border/radius) ─────────────────────────────────
|
|
96
|
+
.pp-accordion--flush {
|
|
97
|
+
border: none;
|
|
98
|
+
border-radius: 0;
|
|
99
|
+
box-shadow: none;
|
|
100
|
+
background: transparent;
|
|
101
|
+
|
|
102
|
+
.pp-accordion__item {
|
|
103
|
+
border-bottom: 1px solid $color-border;
|
|
104
|
+
|
|
105
|
+
&:first-child {
|
|
106
|
+
border-top: 1px solid $color-border;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.pp-accordion__trigger:hover,
|
|
111
|
+
.pp-accordion__trigger[aria-expanded='true'] {
|
|
112
|
+
background: transparent;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ─── Variant: dark ────────────────────────────────────────────────────────────
|
|
117
|
+
.pp-accordion--dark {
|
|
118
|
+
background: $color-neutral-900;
|
|
119
|
+
border-color: $color-neutral-700;
|
|
120
|
+
|
|
121
|
+
.pp-accordion__item {
|
|
122
|
+
border-color: $color-neutral-700;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.pp-accordion__trigger {
|
|
126
|
+
color: rgba(#fff, 0.85);
|
|
127
|
+
|
|
128
|
+
&:hover {
|
|
129
|
+
background: $color-neutral-800;
|
|
130
|
+
color: #fff;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&[aria-expanded='true'] {
|
|
134
|
+
color: $color-primary-light;
|
|
135
|
+
background: $color-neutral-800;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.pp-accordion__content {
|
|
140
|
+
color: rgba(#fff, 0.55);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// ─── Variant: primary accent trigger ─────────────────────────────────────────
|
|
145
|
+
.pp-accordion--primary {
|
|
146
|
+
.pp-accordion__trigger[aria-expanded='true'] {
|
|
147
|
+
background: $color-primary;
|
|
148
|
+
color: #fff;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.pp-accordion__item:has(.pp-accordion__trigger[aria-expanded='true']) {
|
|
152
|
+
.pp-accordion__panel {
|
|
153
|
+
background: rgba($color-primary, 0.04);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
// PeppertinoCSS — Alert
|
|
2
|
+
|
|
3
|
+
@use 'sass:map';
|
|
4
|
+
@use 'base' as *;
|
|
5
|
+
|
|
6
|
+
// ─── Base ─────────────────────────────────────────────────────────────────────
|
|
7
|
+
.pp-alert {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: flex-start;
|
|
10
|
+
gap: spacing(3);
|
|
11
|
+
padding: spacing(4) spacing(5);
|
|
12
|
+
border-radius: 12px;
|
|
13
|
+
border: 1px solid transparent;
|
|
14
|
+
font-family: $font-sans;
|
|
15
|
+
font-size: font-size('sm');
|
|
16
|
+
line-height: $line-height-base;
|
|
17
|
+
width: 100%;
|
|
18
|
+
|
|
19
|
+
// Dismiss button (optional)
|
|
20
|
+
&.is-dismissible {
|
|
21
|
+
padding-right: spacing(10);
|
|
22
|
+
position: relative;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// ─── Icon slot ────────────────────────────────────────────────────────────────
|
|
27
|
+
.pp-alert__icon {
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
width: 18px;
|
|
30
|
+
height: 18px;
|
|
31
|
+
margin-top: 2px;
|
|
32
|
+
|
|
33
|
+
svg, i {
|
|
34
|
+
width: 18px;
|
|
35
|
+
height: 18px;
|
|
36
|
+
stroke: currentColor;
|
|
37
|
+
stroke-width: 2;
|
|
38
|
+
fill: none;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// ─── Body ─────────────────────────────────────────────────────────────────────
|
|
43
|
+
.pp-alert__body {
|
|
44
|
+
flex: 1;
|
|
45
|
+
min-width: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.pp-alert__title {
|
|
49
|
+
font-weight: map.get($font-weights, 'semibold');
|
|
50
|
+
color: inherit;
|
|
51
|
+
margin-bottom: spacing(1);
|
|
52
|
+
font-size: font-size('sm');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.pp-alert__message {
|
|
56
|
+
font-weight: map.get($font-weights, 'regular');
|
|
57
|
+
opacity: 0.85;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ─── Dismiss button ───────────────────────────────────────────────────────────
|
|
61
|
+
.pp-alert__dismiss {
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: spacing(3);
|
|
64
|
+
right: spacing(3);
|
|
65
|
+
width: 24px;
|
|
66
|
+
height: 24px;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
background: transparent;
|
|
71
|
+
border: none;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
border-radius: 50%;
|
|
74
|
+
color: inherit;
|
|
75
|
+
opacity: 0.55;
|
|
76
|
+
transition: opacity $transition-fast, background $transition-fast;
|
|
77
|
+
|
|
78
|
+
&:hover {
|
|
79
|
+
opacity: 1;
|
|
80
|
+
background: rgba(0, 0, 0, 0.08);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
svg, i {
|
|
84
|
+
width: 14px;
|
|
85
|
+
height: 14px;
|
|
86
|
+
stroke: currentColor;
|
|
87
|
+
stroke-width: 2.5;
|
|
88
|
+
fill: none;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ─── Variant mixin ────────────────────────────────────────────────────────────
|
|
93
|
+
@mixin alert-variant($bg, $border, $text, $icon-color: $text) {
|
|
94
|
+
background: $bg;
|
|
95
|
+
border-color: $border;
|
|
96
|
+
color: $text;
|
|
97
|
+
|
|
98
|
+
.pp-alert__icon { color: $icon-color; }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// ─── Variants ─────────────────────────────────────────────────────────────────
|
|
102
|
+
.pp-alert--info {
|
|
103
|
+
@include alert-variant(
|
|
104
|
+
rgba($color-info, 0.08),
|
|
105
|
+
rgba($color-info, 0.3),
|
|
106
|
+
#1e3a5f,
|
|
107
|
+
$color-info
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.pp-alert--success {
|
|
112
|
+
@include alert-variant(
|
|
113
|
+
rgba($color-success, 0.08),
|
|
114
|
+
rgba($color-success, 0.3),
|
|
115
|
+
#14532d,
|
|
116
|
+
$color-success
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.pp-alert--warning {
|
|
121
|
+
@include alert-variant(
|
|
122
|
+
rgba($color-warning, 0.1),
|
|
123
|
+
rgba($color-warning, 0.35),
|
|
124
|
+
#78350f,
|
|
125
|
+
$color-warning
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.pp-alert--error {
|
|
130
|
+
@include alert-variant(
|
|
131
|
+
rgba($color-error, 0.08),
|
|
132
|
+
rgba($color-error, 0.3),
|
|
133
|
+
#7f1d1d,
|
|
134
|
+
$color-error
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.pp-alert--primary {
|
|
139
|
+
@include alert-variant(
|
|
140
|
+
rgba($color-primary, 0.07),
|
|
141
|
+
rgba($color-primary, 0.3),
|
|
142
|
+
$color-primary-dark,
|
|
143
|
+
$color-primary
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.pp-alert--neutral {
|
|
148
|
+
@include alert-variant(
|
|
149
|
+
$color-neutral-100,
|
|
150
|
+
$color-neutral-200,
|
|
151
|
+
$color-neutral-700,
|
|
152
|
+
$color-neutral-500
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// ─── Variant: filled (solid background) ──────────────────────────────────────
|
|
157
|
+
.pp-alert--filled {
|
|
158
|
+
&.pp-alert--info {
|
|
159
|
+
@include alert-variant($color-info, $color-info, #fff);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&.pp-alert--success {
|
|
163
|
+
@include alert-variant($color-success, $color-success, #fff);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&.pp-alert--warning {
|
|
167
|
+
@include alert-variant($color-warning, $color-warning, #fff);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&.pp-alert--error {
|
|
171
|
+
@include alert-variant($color-error, $color-error, #fff);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&.pp-alert--primary {
|
|
175
|
+
@include alert-variant($color-primary, $color-primary, #fff);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&.pp-alert--neutral {
|
|
179
|
+
@include alert-variant($color-neutral-800, $color-neutral-800, #fff, rgba(#fff, 0.7));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.pp-alert__dismiss:hover {
|
|
183
|
+
background: rgba(#fff, 0.15);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// ─── Enter / dismiss animations ───────────────────────────────────────────────
|
|
188
|
+
.pp-alert {
|
|
189
|
+
animation: pp-alert-in 200ms ease forwards;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@keyframes pp-alert-in {
|
|
193
|
+
from { opacity: 0; transform: translateY(-6px); }
|
|
194
|
+
to { opacity: 1; transform: translateY(0); }
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.pp-alert.is-dismissing {
|
|
198
|
+
animation: pp-alert-out 180ms ease forwards;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@keyframes pp-alert-out {
|
|
202
|
+
from { opacity: 1; transform: translateY(0); max-height: 200px; }
|
|
203
|
+
to { opacity: 0; transform: translateY(-6px); max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; }
|
|
204
|
+
}
|
package/src/scss/base.scss
CHANGED
|
@@ -5,14 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&family=Kode+Mono:wght@400;500;600;700&display=swap');
|
|
7
7
|
|
|
8
|
-
// ───
|
|
8
|
+
// ─── Static SCSS palette (source of truth) ───────────────────────────────────
|
|
9
|
+
// These never change at runtime; they feed both the CSS vars and any SCSS
|
|
10
|
+
// math that needs a compile-time value.
|
|
11
|
+
|
|
9
12
|
$color-primary: #e90111 !default;
|
|
10
13
|
$color-primary-light: #ff4d5a !default;
|
|
11
14
|
$color-primary-dark: #a8000c !default;
|
|
12
15
|
|
|
13
16
|
$color-accent: #f77f00 !default;
|
|
14
17
|
|
|
15
|
-
$gradient-start: #ffcf67!default;
|
|
18
|
+
$gradient-start: #ffcf67 !default;
|
|
16
19
|
$gradient-end: #ea5753 !default;
|
|
17
20
|
|
|
18
21
|
$color-neutral-50: #fafafa !default;
|
|
@@ -26,10 +29,6 @@ $color-neutral-700: #3f3f46 !default;
|
|
|
26
29
|
$color-neutral-800: #27272a !default;
|
|
27
30
|
$color-neutral-900: #18181b !default;
|
|
28
31
|
|
|
29
|
-
$color-surface: $color-neutral-50 !default;
|
|
30
|
-
$color-on-surface: $color-neutral-900 !default;
|
|
31
|
-
$color-border: $color-neutral-200 !default;
|
|
32
|
-
|
|
33
32
|
$color-success: #22c55e !default;
|
|
34
33
|
$color-warning: #f59e0b !default;
|
|
35
34
|
$color-error: #ef4444 !default;
|
|
@@ -41,8 +40,8 @@ $font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
|
|
41
40
|
$font-mono: 'Kode Mono', ui-monospace, 'Cascadia Code', 'Courier New',
|
|
42
41
|
monospace !default;
|
|
43
42
|
|
|
44
|
-
$font-size-base:
|
|
45
|
-
$line-height-base: 1.6
|
|
43
|
+
$font-size-base: 1rem !default;
|
|
44
|
+
$line-height-base: 1.6 !default;
|
|
46
45
|
|
|
47
46
|
$font-sizes: (
|
|
48
47
|
'xs': 0.75rem,
|
|
@@ -104,31 +103,27 @@ $shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)
|
|
|
104
103
|
|
|
105
104
|
// ─── Breakpoints (Tailwind-compatible) ───────────────────────────────────────
|
|
106
105
|
$breakpoints: (
|
|
107
|
-
'sm': 640px,
|
|
108
|
-
'md': 768px,
|
|
109
|
-
'lg': 1024px,
|
|
110
|
-
'xl': 1280px,
|
|
111
|
-
'2xl': 1536px,
|
|
106
|
+
'sm': 640px,
|
|
107
|
+
'md': 768px,
|
|
108
|
+
'lg': 1024px,
|
|
109
|
+
'xl': 1280px,
|
|
110
|
+
'2xl': 1536px,
|
|
112
111
|
) !default;
|
|
113
112
|
|
|
114
113
|
// ─── Apple / Mac device breakpoints ──────────────────────────────────────────
|
|
115
|
-
// Viewport widths matched to real Apple hardware at default scale
|
|
116
114
|
$mac-breakpoints: (
|
|
117
|
-
|
|
118
|
-
'iphone
|
|
119
|
-
'iphone':
|
|
120
|
-
'iphone-
|
|
121
|
-
'
|
|
122
|
-
|
|
123
|
-
'ipad-
|
|
124
|
-
'ipad-
|
|
125
|
-
'
|
|
126
|
-
'
|
|
127
|
-
|
|
128
|
-
'
|
|
129
|
-
'macbook-pro-14': 1512px, // MacBook Pro 14" (M1 Pro / M3 Pro)
|
|
130
|
-
'macbook-pro-16': 1728px, // MacBook Pro 16" (M1 Max / M3 Max)
|
|
131
|
-
'imac': 2560px, // iMac 24"
|
|
115
|
+
'iphone-se': 375px,
|
|
116
|
+
'iphone': 390px,
|
|
117
|
+
'iphone-plus': 430px,
|
|
118
|
+
'iphone-pro-max': 440px,
|
|
119
|
+
'ipad-mini': 768px,
|
|
120
|
+
'ipad-air': 820px,
|
|
121
|
+
'ipad-pro-11': 834px,
|
|
122
|
+
'ipad-pro-13': 1024px,
|
|
123
|
+
'macbook-air-13': 1280px,
|
|
124
|
+
'macbook-pro-14': 1512px,
|
|
125
|
+
'macbook-pro-16': 1728px,
|
|
126
|
+
'imac': 2560px,
|
|
132
127
|
) !default;
|
|
133
128
|
|
|
134
129
|
// ─── Z-index scale ────────────────────────────────────────────────────────────
|
|
@@ -147,6 +142,85 @@ $transition-fast: 100ms ease !default;
|
|
|
147
142
|
$transition-base: 200ms ease !default;
|
|
148
143
|
$transition-slow: 400ms ease !default;
|
|
149
144
|
|
|
145
|
+
// ─── CSS custom properties (light defaults) ──────────────────────────────────
|
|
146
|
+
// All runtime-switchable tokens live here. Dark-mode.scss overrides these
|
|
147
|
+
// under .dark (applied to <html> or any ancestor).
|
|
148
|
+
// SCSS variables below alias these vars so component code stays unchanged.
|
|
149
|
+
|
|
150
|
+
:root {
|
|
151
|
+
// Primaries (static — no dark flip)
|
|
152
|
+
--pp-primary: #{$color-primary};
|
|
153
|
+
--pp-primary-light: #{$color-primary-light};
|
|
154
|
+
--pp-primary-dark: #{$color-primary-dark};
|
|
155
|
+
|
|
156
|
+
// Gradient (static — same in dark)
|
|
157
|
+
--pp-gradient-start: #{$gradient-start};
|
|
158
|
+
--pp-gradient-end: #{$gradient-end};
|
|
159
|
+
|
|
160
|
+
// Semantic status (static)
|
|
161
|
+
--pp-success: #{$color-success};
|
|
162
|
+
--pp-warning: #{$color-warning};
|
|
163
|
+
--pp-error: #{$color-error};
|
|
164
|
+
--pp-info: #{$color-info};
|
|
165
|
+
|
|
166
|
+
// Neutral scale (flipped in dark mode)
|
|
167
|
+
--pp-neutral-50: #{$color-neutral-50};
|
|
168
|
+
--pp-neutral-100: #{$color-neutral-100};
|
|
169
|
+
--pp-neutral-200: #{$color-neutral-200};
|
|
170
|
+
--pp-neutral-300: #{$color-neutral-300};
|
|
171
|
+
--pp-neutral-400: #{$color-neutral-400};
|
|
172
|
+
--pp-neutral-500: #{$color-neutral-500};
|
|
173
|
+
--pp-neutral-600: #{$color-neutral-600};
|
|
174
|
+
--pp-neutral-700: #{$color-neutral-700};
|
|
175
|
+
--pp-neutral-800: #{$color-neutral-800};
|
|
176
|
+
--pp-neutral-900: #{$color-neutral-900};
|
|
177
|
+
|
|
178
|
+
// Semantic surface tokens (the ones components most commonly reference)
|
|
179
|
+
--pp-surface: #{$color-neutral-50};
|
|
180
|
+
--pp-on-surface: #{$color-neutral-900};
|
|
181
|
+
--pp-border: #{$color-neutral-200};
|
|
182
|
+
|
|
183
|
+
// Component-surface: white in light, dark card in dark
|
|
184
|
+
--pp-bg-card: #ffffff;
|
|
185
|
+
--pp-bg-input: #ffffff;
|
|
186
|
+
--pp-bg-select: #ffffff;
|
|
187
|
+
--pp-bg-select-panel: #ffffff;
|
|
188
|
+
--pp-bg-header: rgb(255 255 255 / 0.65);
|
|
189
|
+
--pp-bg-header-mobile: rgb(255 255 255 / 0.90);
|
|
190
|
+
--pp-bg-dropdown: rgb(255 255 255 / 0.85);
|
|
191
|
+
--pp-bg-footer: #{$color-neutral-50};
|
|
192
|
+
|
|
193
|
+
// Glassmorphism overlays (header, modal)
|
|
194
|
+
--pp-glass-border: rgb(255 255 255 / 0.30);
|
|
195
|
+
--pp-glass-hover: rgb(0 0 0 / 0.05);
|
|
196
|
+
|
|
197
|
+
// Shadows (intensity flips in dark)
|
|
198
|
+
--pp-shadow-sm: #{$shadow-sm};
|
|
199
|
+
--pp-shadow: #{$shadow};
|
|
200
|
+
--pp-shadow-md: #{$shadow-md};
|
|
201
|
+
--pp-shadow-lg: #{$shadow-lg};
|
|
202
|
+
--pp-shadow-xl: #{$shadow-xl};
|
|
203
|
+
|
|
204
|
+
// Label tier vars (consumed by label.scss)
|
|
205
|
+
--pp-label-primary: #{$color-neutral-900};
|
|
206
|
+
--pp-label-secondary: #{$color-neutral-500};
|
|
207
|
+
--pp-label-tertiary: #{$color-neutral-400};
|
|
208
|
+
--pp-label-quaternary: #{$color-neutral-300};
|
|
209
|
+
|
|
210
|
+
// Section --muted background
|
|
211
|
+
--pp-section-muted-bg: #{$color-neutral-100};
|
|
212
|
+
|
|
213
|
+
// Scrollbar
|
|
214
|
+
--pp-scrollbar-thumb: linear-gradient(180deg, #{$gradient-start}, #{$gradient-end});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// ─── SCSS variable aliases → CSS vars ────────────────────────────────────────
|
|
218
|
+
// Components use these aliases; they resolve to the CSS var at runtime.
|
|
219
|
+
|
|
220
|
+
$color-surface: var(--pp-surface) !default;
|
|
221
|
+
$color-on-surface: var(--pp-on-surface) !default;
|
|
222
|
+
$color-border: var(--pp-border) !default;
|
|
223
|
+
|
|
150
224
|
// ─── Helper functions ─────────────────────────────────────────────────────────
|
|
151
225
|
@function spacing($key) {
|
|
152
226
|
@return map.get($spacing, '#{$key}');
|
|
@@ -164,30 +238,49 @@ $transition-slow: 400ms ease !default;
|
|
|
164
238
|
@return map.get($z, $key);
|
|
165
239
|
}
|
|
166
240
|
|
|
167
|
-
// ─── Responsive
|
|
241
|
+
// ─── Responsive mixins ────────────────────────────────────────────────────────
|
|
168
242
|
@mixin respond-to($bp) {
|
|
169
243
|
$value: map.get($breakpoints, $bp);
|
|
170
244
|
@if $value {
|
|
171
|
-
@media (min-width: $value) {
|
|
172
|
-
|
|
173
|
-
}
|
|
245
|
+
@media (min-width: $value) { @content; }
|
|
246
|
+
} @else {
|
|
247
|
+
@warn "Unknown breakpoint: `#{$bp}`.";
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@mixin respond-below($bp) {
|
|
252
|
+
$value: map.get($breakpoints, $bp);
|
|
253
|
+
@if $value {
|
|
254
|
+
@media (max-width: calc(#{$value} - 1px)) { @content; }
|
|
174
255
|
} @else {
|
|
175
256
|
@warn "Unknown breakpoint: `#{$bp}`.";
|
|
176
257
|
}
|
|
177
258
|
}
|
|
178
259
|
|
|
260
|
+
@mixin respond-between($lower, $upper) {
|
|
261
|
+
$lo: map.get($breakpoints, $lower);
|
|
262
|
+
$hi: map.get($breakpoints, $upper);
|
|
263
|
+
@if $lo and $hi {
|
|
264
|
+
@media (min-width: $lo) and (max-width: calc(#{$hi} - 1px)) { @content; }
|
|
265
|
+
} @else {
|
|
266
|
+
@warn "Unknown breakpoint pair: `#{$lower}` / `#{$upper}`.";
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
179
270
|
// ─── Base element styles ─────────────────────────────────────────────────────
|
|
180
271
|
body {
|
|
181
272
|
font-family: $font-sans;
|
|
182
273
|
font-size: $font-size-base;
|
|
183
274
|
line-height: $line-height-base;
|
|
184
|
-
color:
|
|
185
|
-
background-color:
|
|
275
|
+
color: var(--pp-on-surface);
|
|
276
|
+
background-color: var(--pp-surface);
|
|
277
|
+
transition: background-color $transition-base, color $transition-base;
|
|
186
278
|
}
|
|
187
279
|
|
|
188
280
|
h1, h2, h3, h4, h5, h6 {
|
|
189
281
|
font-weight: map.get($font-weights, 'bold');
|
|
190
282
|
line-height: 1.25;
|
|
283
|
+
color: var(--pp-on-surface);
|
|
191
284
|
}
|
|
192
285
|
|
|
193
286
|
h1 { font-size: font-size('5xl'); }
|
|
@@ -206,6 +299,7 @@ pre {
|
|
|
206
299
|
pre {
|
|
207
300
|
overflow-x: auto;
|
|
208
301
|
padding: spacing(4);
|
|
209
|
-
background-color:
|
|
302
|
+
background-color: var(--pp-neutral-100);
|
|
210
303
|
border-radius: radius('md');
|
|
304
|
+
color: var(--pp-on-surface);
|
|
211
305
|
}
|