@astryxdesign/theme-neutral 0.7.0-canary.291c4e9 → 0.7.0-canary.2c86d9d
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/dist/neutral.js +18 -1
- package/dist/neutralTheme.d.ts.map +1 -1
- package/dist/source.js +11 -0
- package/dist/source.mjs +11 -0
- package/dist/theme.css +66 -0
- package/package.json +3 -3
- package/src/neutralTheme.test.ts +21 -0
- package/src/neutralTheme.ts +12 -0
package/dist/neutral.js
CHANGED
|
@@ -520,7 +520,24 @@ export const neutralTheme = {
|
|
|
520
520
|
"xl": 1280,
|
|
521
521
|
"2xl": 1536
|
|
522
522
|
},
|
|
523
|
-
"rules": [
|
|
523
|
+
"rules": [
|
|
524
|
+
{
|
|
525
|
+
"when": {
|
|
526
|
+
"pointer": "coarse",
|
|
527
|
+
"width": {
|
|
528
|
+
"below": "lg"
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
"value": {
|
|
532
|
+
"typography": {
|
|
533
|
+
"scale": {
|
|
534
|
+
"base": 16,
|
|
535
|
+
"ratio": 1.1736
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
]
|
|
524
541
|
},
|
|
525
542
|
__axes: {
|
|
526
543
|
"typography": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neutralTheme.d.ts","sourceRoot":"","sources":["../src/neutralTheme.ts"],"names":[],"mappings":"AAqEA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"neutralTheme.d.ts","sourceRoot":"","sources":["../src/neutralTheme.ts"],"names":[],"mappings":"AAqEA,eAAO,MAAM,YAAY,yDAuZvB,CAAC"}
|
package/dist/source.js
CHANGED
|
@@ -190,6 +190,17 @@ var neutralTheme = (0, import_theme.defineTheme)({
|
|
|
190
190
|
fallbacks: '"SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
|
|
191
191
|
}
|
|
192
192
|
},
|
|
193
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
194
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
195
|
+
// ratio' = 1.2 * (14/16)^(1/6) ~= 1.1736. Body 14 -> 16px, display-1 stays 42px.
|
|
196
|
+
adaptations: {
|
|
197
|
+
rules: [
|
|
198
|
+
{
|
|
199
|
+
when: { pointer: "coarse", width: { below: "lg" } },
|
|
200
|
+
value: { typography: { scale: { base: 16, ratio: 1.1736 } } }
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
},
|
|
193
204
|
// Motion: snappier than default to match shadcn/Tailwind conventions.
|
|
194
205
|
// Produces: fast-min=95ms, fast=125ms, fast-max=165ms,
|
|
195
206
|
// medium-min=225ms, medium=300ms, medium-max=400ms.
|
package/dist/source.mjs
CHANGED
|
@@ -195,6 +195,17 @@ var neutralTheme = defineTheme({
|
|
|
195
195
|
fallbacks: '"SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
|
|
196
196
|
}
|
|
197
197
|
},
|
|
198
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
199
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
200
|
+
// ratio' = 1.2 * (14/16)^(1/6) ~= 1.1736. Body 14 -> 16px, display-1 stays 42px.
|
|
201
|
+
adaptations: {
|
|
202
|
+
rules: [
|
|
203
|
+
{
|
|
204
|
+
when: { pointer: "coarse", width: { below: "lg" } },
|
|
205
|
+
value: { typography: { scale: { base: 16, ratio: 1.1736 } } }
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
},
|
|
198
209
|
// Motion: snappier than default to match shadcn/Tailwind conventions.
|
|
199
210
|
// Produces: fast-min=95ms, fast=125ms, fast-max=165ms,
|
|
200
211
|
// medium-min=225ms, medium=300ms, medium-max=400ms.
|
package/dist/theme.css
CHANGED
|
@@ -638,6 +638,72 @@
|
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
|
|
641
|
+
@layer astryx-theme {
|
|
642
|
+
@media (width < 1024px) and (pointer: coarse) {
|
|
643
|
+
@scope ([data-astryx-theme="neutral"]) to ([data-astryx-theme]) {
|
|
644
|
+
:scope {
|
|
645
|
+
--font-size-4xs: 0.4375rem;
|
|
646
|
+
--font-size-3xs: 0.5rem;
|
|
647
|
+
--font-size-2xs: 0.625rem;
|
|
648
|
+
--font-size-xs: 0.75rem;
|
|
649
|
+
--font-size-sm: 0.875rem;
|
|
650
|
+
--font-size-base: 1rem;
|
|
651
|
+
--font-size-lg: 1.1875rem;
|
|
652
|
+
--font-size-xl: 1.375rem;
|
|
653
|
+
--font-size-2xl: 1.625rem;
|
|
654
|
+
--font-size-3xl: 1.875rem;
|
|
655
|
+
--font-size-4xl: 2.25rem;
|
|
656
|
+
--font-size-5xl: 2.625rem;
|
|
657
|
+
--text-heading-1-size: var(--font-size-2xl);
|
|
658
|
+
--text-heading-1-weight: var(--font-weight-semibold);
|
|
659
|
+
--text-heading-1-leading: 1.3846;
|
|
660
|
+
--text-heading-2-size: var(--font-size-xl);
|
|
661
|
+
--text-heading-2-weight: var(--font-weight-semibold);
|
|
662
|
+
--text-heading-2-leading: 1.4545;
|
|
663
|
+
--text-heading-3-size: var(--font-size-lg);
|
|
664
|
+
--text-heading-3-weight: var(--font-weight-bold);
|
|
665
|
+
--text-heading-3-leading: 1.4737;
|
|
666
|
+
--text-heading-4-size: var(--font-size-base);
|
|
667
|
+
--text-heading-4-weight: var(--font-weight-bold);
|
|
668
|
+
--text-heading-4-leading: 1.5;
|
|
669
|
+
--text-heading-5-size: var(--font-size-sm);
|
|
670
|
+
--text-heading-5-weight: var(--font-weight-semibold);
|
|
671
|
+
--text-heading-5-leading: 1.4286;
|
|
672
|
+
--text-heading-6-size: var(--font-size-xs);
|
|
673
|
+
--text-heading-6-weight: var(--font-weight-semibold);
|
|
674
|
+
--text-heading-6-leading: 1.6667;
|
|
675
|
+
--text-body-size: var(--font-size-base);
|
|
676
|
+
--text-body-weight: var(--font-weight-normal);
|
|
677
|
+
--text-body-leading: 1.5;
|
|
678
|
+
--text-large-size: var(--font-size-lg);
|
|
679
|
+
--text-large-weight: var(--font-weight-semibold);
|
|
680
|
+
--text-large-leading: 1.4737;
|
|
681
|
+
--text-label-size: var(--font-size-base);
|
|
682
|
+
--text-label-weight: var(--font-weight-medium);
|
|
683
|
+
--text-label-leading: 1.5;
|
|
684
|
+
--text-code-size: var(--font-size-base);
|
|
685
|
+
--text-code-weight: var(--font-weight-normal);
|
|
686
|
+
--text-code-leading: 1.5;
|
|
687
|
+
--text-supporting-size: var(--font-size-sm);
|
|
688
|
+
--text-supporting-weight: var(--font-weight-normal);
|
|
689
|
+
--text-supporting-leading: 1.4286;
|
|
690
|
+
--text-display-1-size: var(--font-size-5xl);
|
|
691
|
+
--text-display-1-weight: var(--font-weight-normal);
|
|
692
|
+
--text-display-1-leading: 1.2381;
|
|
693
|
+
--text-display-2-size: var(--font-size-4xl);
|
|
694
|
+
--text-display-2-weight: var(--font-weight-normal);
|
|
695
|
+
--text-display-2-leading: 1.2222;
|
|
696
|
+
--text-display-3-size: var(--font-size-3xl);
|
|
697
|
+
--text-display-3-weight: var(--font-weight-normal);
|
|
698
|
+
--text-display-3-leading: 1.4667;
|
|
699
|
+
--font-family-body: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
700
|
+
--font-family-heading: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
701
|
+
--font-family-code: ui-monospace, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
641
707
|
@layer astryx-theme {
|
|
642
708
|
@scope ([data-astryx-theme="neutral"]) to ([data-astryx-theme]) {
|
|
643
709
|
[data-astryx-media="dark"] {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/theme-neutral",
|
|
3
|
-
"version": "0.7.0-canary.
|
|
3
|
+
"version": "0.7.0-canary.2c86d9d",
|
|
4
4
|
"displayName": "Neutral Theme",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Restrained warm grays. Minimal and quiet, so the content stays the focus.",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"lucide-react": "^1.18.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@astryxdesign/core": "0.7.0-canary.
|
|
61
|
+
"@astryxdesign/core": "0.7.0-canary.2c86d9d",
|
|
62
62
|
"react": ">=19"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@astryxdesign/cli": "0.7.0-canary.
|
|
65
|
+
"@astryxdesign/cli": "0.7.0-canary.2c86d9d"
|
|
66
66
|
},
|
|
67
67
|
"module": "./dist/source.mjs",
|
|
68
68
|
"scripts": {
|
package/src/neutralTheme.test.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
import {describe, expect, it} from 'vitest';
|
|
4
|
+
import {generateThemeCSS} from '@astryxdesign/core/theme';
|
|
4
5
|
import {neutralPalettes} from './neutralPalettes';
|
|
5
6
|
import {neutralTheme} from './neutralTheme';
|
|
6
7
|
|
|
@@ -407,3 +408,23 @@ describe('neutral theme component overrides', () => {
|
|
|
407
408
|
});
|
|
408
409
|
});
|
|
409
410
|
});
|
|
411
|
+
|
|
412
|
+
describe('neutral touch + narrow type pin', () => {
|
|
413
|
+
it('floors body to 16px and holds Display 1 at its desktop size', () => {
|
|
414
|
+
const rule = neutralTheme.__adaptationRules?.[0];
|
|
415
|
+
|
|
416
|
+
expect(neutralTheme.__adaptations.rules).toHaveLength(1);
|
|
417
|
+
expect(rule?.when).toEqual({pointer: 'coarse', width: {below: 'lg'}});
|
|
418
|
+
expect(rule?.query).toBe('(width < 1024px) and (pointer: coarse)');
|
|
419
|
+
// Pinned ladder: base 16 (was 14), ratio 1.2 -> 1.1736, Display 1 pinned.
|
|
420
|
+
expect(rule?.tokens['--font-size-base']).toBe('1rem');
|
|
421
|
+
expect(rule?.tokens['--font-size-lg']).toBe('1.1875rem');
|
|
422
|
+
expect(rule?.tokens['--font-size-5xl']).toBe('2.625rem');
|
|
423
|
+
// Desktop scale is untouched.
|
|
424
|
+
expect(neutralTheme.tokens['--font-size-base']).toBe('0.875rem');
|
|
425
|
+
expect(neutralTheme.tokens['--font-size-5xl']).toBe('2.625rem');
|
|
426
|
+
expect(generateThemeCSS(neutralTheme).component).toContain(
|
|
427
|
+
'@media (width < 1024px) and (pointer: coarse)',
|
|
428
|
+
);
|
|
429
|
+
});
|
|
430
|
+
});
|
package/src/neutralTheme.ts
CHANGED
|
@@ -95,6 +95,18 @@ export const neutralTheme = defineTheme({
|
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
97
|
|
|
98
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
99
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
100
|
+
// ratio' = 1.2 * (14/16)^(1/6) ~= 1.1736. Body 14 -> 16px, display-1 stays 42px.
|
|
101
|
+
adaptations: {
|
|
102
|
+
rules: [
|
|
103
|
+
{
|
|
104
|
+
when: {pointer: 'coarse', width: {below: 'lg'}},
|
|
105
|
+
value: {typography: {scale: {base: 16, ratio: 1.1736}}},
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
|
|
98
110
|
// Motion: snappier than default to match shadcn/Tailwind conventions.
|
|
99
111
|
// Produces: fast-min=95ms, fast=125ms, fast-max=165ms,
|
|
100
112
|
// medium-min=225ms, medium=300ms, medium-max=400ms.
|