Skip to content

Commit 6e3a5b0

Browse files
authored
chore: promote dev to main — dark mode complete
chore: promote dev to main — dark mode complete
2 parents 7bc8edd + d7e915b commit 6e3a5b0

File tree

3 files changed

+51
-30
lines changed

3 files changed

+51
-30
lines changed

.changeset/dark-mode-snippet.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'helixir': patch
3+
'@helixir/core': patch
4+
---
5+
6+
Add dark mode CSS example to buildCssSnippet — agents see correct theme-scoped custom property pattern with explicit WRONG example showing that standard properties on host can't reach shadow DOM.

packages/core/src/handlers/styling-diagnostics.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,21 @@ export function buildCssSnippet(meta: ComponentMetadata): string {
234234
}
235235
}
236236

237+
// Dark mode section — show the correct pattern for theme-scoped styling
238+
if (meta.cssProperties.length > 0) {
239+
const firstToken = meta.cssProperties[0];
240+
if (firstToken) {
241+
lines.push('');
242+
lines.push(`/* Dark mode — use custom properties, NOT standard properties */`);
243+
lines.push(`.dark ${tag},`);
244+
lines.push(`[data-theme="dark"] ${tag} {`);
245+
lines.push(` ${firstToken.name}: /* dark value */;`);
246+
lines.push(`}`);
247+
lines.push(`/* WRONG: .dark ${tag} { color: white; } — standard properties`);
248+
lines.push(` on the host won't reach shadow DOM internals. */`);
249+
}
250+
}
251+
237252
// Slot styling section — show how to style slotted content in light DOM
238253
if (meta.slots.length > 0) {
239254
lines.push('');

tests/__fixtures__/benchmark-results/latest-benchmark.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"timestamp": "2026-03-21T08:29:23.742Z",
2+
"timestamp": "2026-03-21T08:59:37.296Z",
33
"scorecards": {
44
"material": {
55
"library": "material",
@@ -187,7 +187,7 @@
187187
"heuristic": 426,
188188
"untested": 747
189189
},
190-
"timestamp": "2026-03-21T08:29:23.738Z"
190+
"timestamp": "2026-03-21T08:59:37.291Z"
191191
},
192192
"spectrum": {
193193
"library": "spectrum",
@@ -375,7 +375,7 @@
375375
"heuristic": 404,
376376
"untested": 601
377377
},
378-
"timestamp": "2026-03-21T08:29:23.738Z"
378+
"timestamp": "2026-03-21T08:59:37.292Z"
379379
},
380380
"vaadin": {
381381
"library": "vaadin",
@@ -563,7 +563,7 @@
563563
"heuristic": 439,
564564
"untested": 717
565565
},
566-
"timestamp": "2026-03-21T08:29:23.739Z"
566+
"timestamp": "2026-03-21T08:59:37.292Z"
567567
},
568568
"fluentui": {
569569
"library": "fluentui",
@@ -751,7 +751,7 @@
751751
"heuristic": 139,
752752
"untested": 293
753753
},
754-
"timestamp": "2026-03-21T08:29:23.739Z"
754+
"timestamp": "2026-03-21T08:59:37.292Z"
755755
},
756756
"carbon": {
757757
"library": "carbon",
@@ -939,7 +939,7 @@
939939
"heuristic": 397,
940940
"untested": 793
941941
},
942-
"timestamp": "2026-03-21T08:29:23.739Z"
942+
"timestamp": "2026-03-21T08:59:37.292Z"
943943
},
944944
"ui5": {
945945
"library": "ui5",
@@ -1127,7 +1127,7 @@
11271127
"heuristic": 582,
11281128
"untested": 1304
11291129
},
1130-
"timestamp": "2026-03-21T08:29:23.740Z"
1130+
"timestamp": "2026-03-21T08:59:37.293Z"
11311131
},
11321132
"calcite": {
11331133
"library": "calcite",
@@ -1315,7 +1315,7 @@
13151315
"heuristic": 318,
13161316
"untested": 848
13171317
},
1318-
"timestamp": "2026-03-21T08:29:23.740Z"
1318+
"timestamp": "2026-03-21T08:59:37.294Z"
13191319
},
13201320
"porsche": {
13211321
"library": "porsche",
@@ -1503,7 +1503,7 @@
15031503
"heuristic": 304,
15041504
"untested": 702
15051505
},
1506-
"timestamp": "2026-03-21T08:29:23.740Z"
1506+
"timestamp": "2026-03-21T08:59:37.294Z"
15071507
},
15081508
"ionic": {
15091509
"library": "ionic",
@@ -1691,7 +1691,7 @@
16911691
"heuristic": 331,
16921692
"untested": 744
16931693
},
1694-
"timestamp": "2026-03-21T08:29:23.741Z"
1694+
"timestamp": "2026-03-21T08:59:37.294Z"
16951695
},
16961696
"wired": {
16971697
"library": "wired",
@@ -1879,7 +1879,7 @@
18791879
"heuristic": 78,
18801880
"untested": 208
18811881
},
1882-
"timestamp": "2026-03-21T08:29:23.741Z"
1882+
"timestamp": "2026-03-21T08:59:37.294Z"
18831883
},
18841884
"elix": {
18851885
"library": "elix",
@@ -2067,7 +2067,7 @@
20672067
"heuristic": 148,
20682068
"untested": 740
20692069
},
2070-
"timestamp": "2026-03-21T08:29:23.741Z"
2070+
"timestamp": "2026-03-21T08:59:37.295Z"
20712071
},
20722072
"helix": {
20732073
"library": "helix",
@@ -2255,7 +2255,7 @@
22552255
"heuristic": 440,
22562256
"untested": 555
22572257
},
2258-
"timestamp": "2026-03-21T08:29:23.742Z"
2258+
"timestamp": "2026-03-21T08:59:37.295Z"
22592259
}
22602260
},
22612261
"comparisonTable": {
@@ -3278,74 +3278,74 @@
32783278
"API Surface Quality",
32793279
"Event Architecture"
32803280
],
3281-
"timestamp": "2026-03-21T08:29:23.742Z"
3281+
"timestamp": "2026-03-21T08:59:37.296Z"
32823282
},
32833283
"performance": {
3284-
"totalMs": 2868,
3284+
"totalMs": 2876,
32853285
"phases": [
32863286
{
32873287
"name": "load-libraries",
3288-
"durationMs": 133
3288+
"durationMs": 143
32893289
},
32903290
{
32913291
"name": "score-all-libraries",
3292-
"durationMs": 2730
3292+
"durationMs": 2727
32933293
},
32943294
{
32953295
"name": "score-material",
3296-
"durationMs": 298
3296+
"durationMs": 178
32973297
},
32983298
{
32993299
"name": "score-spectrum",
3300-
"durationMs": 134
3300+
"durationMs": 148
33013301
},
33023302
{
33033303
"name": "score-vaadin",
3304-
"durationMs": 764
3304+
"durationMs": 916
33053305
},
33063306
{
33073307
"name": "score-fluentui",
3308-
"durationMs": 27
3308+
"durationMs": 38
33093309
},
33103310
{
33113311
"name": "score-carbon",
3312-
"durationMs": 119
3312+
"durationMs": 132
33133313
},
33143314
{
33153315
"name": "score-ui5",
3316-
"durationMs": 167
3316+
"durationMs": 225
33173317
},
33183318
{
33193319
"name": "score-calcite",
3320-
"durationMs": 371
3320+
"durationMs": 578
33213321
},
33223322
{
33233323
"name": "score-porsche",
3324-
"durationMs": 177
3324+
"durationMs": 62
33253325
},
33263326
{
33273327
"name": "score-ionic",
3328-
"durationMs": 204
3328+
"durationMs": 119
33293329
},
33303330
{
33313331
"name": "score-wired",
3332-
"durationMs": 23
3332+
"durationMs": 24
33333333
},
33343334
{
33353335
"name": "score-elix",
3336-
"durationMs": 312
3336+
"durationMs": 236
33373337
},
33383338
{
33393339
"name": "score-helix",
3340-
"durationMs": 134
3340+
"durationMs": 71
33413341
},
33423342
{
33433343
"name": "generate-scorecards",
33443344
"durationMs": 5
33453345
},
33463346
{
33473347
"name": "generate-comparison",
3348-
"durationMs": 0
3348+
"durationMs": 1
33493349
}
33503350
],
33513351
"withinGate": true

0 commit comments

Comments
 (0)