maquina-components 0.7.1 → 0.7.2
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 870cc289944a0b16196e5e259398cbdabf0ca1dd998bf2a178967898a3d1a57e
|
|
4
|
+
data.tar.gz: db3daba76341084ee6e096fd2186cebdcf594b6faee992be2c9e62e4b5781eed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a1934e3230c028e772cbaf0a0276a21fbb6f8ea406e76c355fdfc29587b445619a717a2d7f69a388a65afbcdef5236e59495072192845993a3079c944b0ca59c
|
|
7
|
+
data.tar.gz: 6c29f68c06d96157c4402ff03f1594aac41a748480d464c678bd995d10aa49ba055f759674786d666a1fb8b0f146fc76243a95171b146c88e82aa88d42df644c
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
accent. Set them to your own blue (or to var(--primary)) if you prefer. */
|
|
21
21
|
--info: oklch(0.93 0.04 240);
|
|
22
22
|
--info-foreground: oklch(0.4 0.12 250);
|
|
23
|
+
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
25
|
+
.dark {
|
|
26
|
+
--info: oklch(0.34 0.07 250);
|
|
27
|
+
--info-foreground: oklch(0.88 0.06 240);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/* -------------------------------------------------------------------------
|
|
@@ -76,58 +76,61 @@
|
|
|
76
76
|
--sidebar-accent-foreground: oklch(0.145 0 0);
|
|
77
77
|
--sidebar-border: oklch(0.88 0 0);
|
|
78
78
|
--sidebar-ring: oklch(0.645 0.246 16);
|
|
79
|
+
}
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
/* Dark Mode
|
|
82
|
+
Put the `dark` class on <html>. This block must stay at the top level: nested
|
|
83
|
+
inside :root it compiles to `:root .dark`, which never matches <html> itself,
|
|
84
|
+
and the @theme bindings below resolve against <html>. */
|
|
85
|
+
.dark {
|
|
86
|
+
--background: oklch(0.145 0 0);
|
|
87
|
+
--foreground: oklch(0.985 0 0);
|
|
84
88
|
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
--card: oklch(0.205 0 0);
|
|
90
|
+
--card-foreground: oklch(0.985 0 0);
|
|
87
91
|
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
--popover: oklch(0.269 0 0);
|
|
93
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
90
94
|
|
|
91
|
-
|
|
92
|
-
|
|
95
|
+
--primary: oklch(0.712 0.194 13);
|
|
96
|
+
--primary-foreground: oklch(0.15 0.052 13);
|
|
93
97
|
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
--secondary: oklch(0.269 0 0);
|
|
99
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
96
100
|
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
--muted: oklch(0.269 0 0);
|
|
102
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
99
103
|
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
--accent: oklch(0.371 0 0);
|
|
105
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
102
106
|
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
--success: oklch(0.32 0.06 168);
|
|
108
|
+
--success-foreground: oklch(0.82 0.06 168);
|
|
105
109
|
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
--warning: oklch(0.36 0.06 55);
|
|
111
|
+
--warning-foreground: oklch(0.86 0.06 55);
|
|
108
112
|
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
--destructive: oklch(0.34 0.07 8);
|
|
114
|
+
--destructive-foreground: oklch(0.88 0.06 8);
|
|
111
115
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
--border: oklch(1 0 0 / 10%);
|
|
117
|
+
--input: oklch(1 0 0 / 15%);
|
|
118
|
+
--ring: oklch(0.455 0.188 13);
|
|
115
119
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
--chart-1: oklch(0.712 0.194 13);
|
|
121
|
+
--chart-2: oklch(0.72 0.09 168);
|
|
122
|
+
--chart-3: oklch(0.78 0.09 55);
|
|
123
|
+
--chart-4: oklch(0.645 0.246 16);
|
|
124
|
+
--chart-5: oklch(0.58 0.13 8);
|
|
121
125
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
126
|
+
--sidebar: oklch(0.14 0 0);
|
|
127
|
+
--sidebar-foreground: oklch(0.9 0 0);
|
|
128
|
+
--sidebar-primary: oklch(0.712 0.194 13);
|
|
129
|
+
--sidebar-primary-foreground: oklch(0.15 0.052 13);
|
|
130
|
+
--sidebar-accent: oklch(0.22 0 0);
|
|
131
|
+
--sidebar-accent-foreground: oklch(0.95 0 0);
|
|
132
|
+
--sidebar-border: oklch(1 0 0 / 12%);
|
|
133
|
+
--sidebar-ring: oklch(0.455 0.188 13);
|
|
131
134
|
}
|
|
132
135
|
|
|
133
136
|
/* Tailwind Theme Bindings
|
|
@@ -57,6 +57,10 @@ module MaquinaComponents
|
|
|
57
57
|
RADIUS_DECL = /(?:border-radius\s*:|@apply[^;{}]*\brounded(?:-[a-z0-9\[\].\/-]+)?\b)/
|
|
58
58
|
SHADOW_DECL = /(?:box-shadow\s*:|@apply[^;{}]*\b(?:shadow|ring)(?:-[a-z0-9\[\].\/-]+)?\b)/
|
|
59
59
|
FOCUS_SELECTOR = /:focus(-visible|-within)?\b/
|
|
60
|
+
# A bare `.dark` in a selector list; `&.dark` (which compiles to :root.dark)
|
|
61
|
+
# is fine and does not match.
|
|
62
|
+
BARE_DARK_SELECTOR = /(?:\A|,)\s*\.dark\s*(?:,|\z)/
|
|
63
|
+
ROOT_SELECTOR = /\A(?::root|html)\z/
|
|
60
64
|
|
|
61
65
|
# 0.7.1 -----------------------------------------------------------------
|
|
62
66
|
# The destructive pair plus the surface it lands on, read out of a host
|
|
@@ -196,7 +200,10 @@ module MaquinaComponents
|
|
|
196
200
|
selector = buffer.strip
|
|
197
201
|
buffer = +""
|
|
198
202
|
at_rule = selector.start_with?("@")
|
|
199
|
-
|
|
203
|
+
unless at_rule
|
|
204
|
+
check_selector(path, index, selector, in_layer?(stack))
|
|
205
|
+
check_nested_dark(path, index, selector, stack)
|
|
206
|
+
end
|
|
200
207
|
stack.push(selector)
|
|
201
208
|
when "}"
|
|
202
209
|
check_declaration(path, index, buffer.strip, stack)
|
|
@@ -281,6 +288,24 @@ module MaquinaComponents
|
|
|
281
288
|
end
|
|
282
289
|
end
|
|
283
290
|
|
|
291
|
+
# `.dark` nested in `:root` compiles to `:root .dark`, a descendant of
|
|
292
|
+
# <html>, so `<html class="dark">` never matches it. And the @theme
|
|
293
|
+
# bindings resolve against <html>, so moving the class to <body> does not
|
|
294
|
+
# help either: dark mode silently never applies. The 0.7.1 installer
|
|
295
|
+
# shipped its palette this way.
|
|
296
|
+
def check_nested_dark(path, index, selector, stack)
|
|
297
|
+
return unless BARE_DARK_SELECTOR.match?(selector)
|
|
298
|
+
return unless stack.any? { |ancestor| ROOT_SELECTOR.match?(ancestor) }
|
|
299
|
+
|
|
300
|
+
add(path, index, selector, :breaking, "nested-dark-block",
|
|
301
|
+
"This .dark block is nested inside :root, so it compiles to `:root .dark` and\n" \
|
|
302
|
+
"never matches <html class=\"dark\">: dark mode does not apply. Move it out to\n" \
|
|
303
|
+
"the top level, after the closing brace of :root:\n" \
|
|
304
|
+
" :root { ... }\n" \
|
|
305
|
+
" .dark { ... }",
|
|
306
|
+
"0.7.2")
|
|
307
|
+
end
|
|
308
|
+
|
|
284
309
|
# Checks that read the same in CSS, ERB and JS.
|
|
285
310
|
def scan_shared(path, index, line)
|
|
286
311
|
if PRESENCE_ACTIVE.match?(line)
|