@astryxdesign/theme-stone 0.7.0-canary.fe57f54 → 0.7.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/dist/source.js +11 -0
- package/dist/source.mjs +11 -0
- package/dist/stone.js +18 -1
- package/dist/stoneTheme.d.ts.map +1 -1
- package/dist/stoneTheme.test.d.ts +2 -0
- package/dist/stoneTheme.test.d.ts.map +1 -0
- package/dist/theme.css +66 -0
- package/package.json +3 -3
- package/src/stoneTheme.test.ts +25 -0
- package/src/stoneTheme.ts +12 -0
package/dist/source.js
CHANGED
|
@@ -133,6 +133,17 @@ var stoneTheme = (0, import_theme.defineTheme)({
|
|
|
133
133
|
fallbacks: '"SF Mono", Monaco, Consolas, monospace'
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
137
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
138
|
+
// ratio' = 1.25 * (14/16)^(1/6) ~= 1.2225. Body 14 -> 16px, display-1 stays 53px.
|
|
139
|
+
adaptations: {
|
|
140
|
+
rules: [
|
|
141
|
+
{
|
|
142
|
+
when: { pointer: "coarse", width: { below: "lg" } },
|
|
143
|
+
value: { typography: { scale: { base: 16, ratio: 1.2225 } } }
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
136
147
|
motion: { fast: 125, medium: 300, slow: 700, ratio: 0.75 },
|
|
137
148
|
syntax: stoneSyntax,
|
|
138
149
|
tokens: {
|
package/dist/source.mjs
CHANGED
|
@@ -135,6 +135,17 @@ var stoneTheme = defineTheme({
|
|
|
135
135
|
fallbacks: '"SF Mono", Monaco, Consolas, monospace'
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
139
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
140
|
+
// ratio' = 1.25 * (14/16)^(1/6) ~= 1.2225. Body 14 -> 16px, display-1 stays 53px.
|
|
141
|
+
adaptations: {
|
|
142
|
+
rules: [
|
|
143
|
+
{
|
|
144
|
+
when: { pointer: "coarse", width: { below: "lg" } },
|
|
145
|
+
value: { typography: { scale: { base: 16, ratio: 1.2225 } } }
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
138
149
|
motion: { fast: 125, medium: 300, slow: 700, ratio: 0.75 },
|
|
139
150
|
syntax: stoneSyntax,
|
|
140
151
|
tokens: {
|
package/dist/stone.js
CHANGED
|
@@ -521,7 +521,24 @@ export const stoneTheme = {
|
|
|
521
521
|
"xl": 1280,
|
|
522
522
|
"2xl": 1536
|
|
523
523
|
},
|
|
524
|
-
"rules": [
|
|
524
|
+
"rules": [
|
|
525
|
+
{
|
|
526
|
+
"when": {
|
|
527
|
+
"pointer": "coarse",
|
|
528
|
+
"width": {
|
|
529
|
+
"below": "lg"
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
"value": {
|
|
533
|
+
"typography": {
|
|
534
|
+
"scale": {
|
|
535
|
+
"base": 16,
|
|
536
|
+
"ratio": 1.2225
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
]
|
|
525
542
|
},
|
|
526
543
|
__axes: {
|
|
527
544
|
"typography": {
|
package/dist/stoneTheme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stoneTheme.d.ts","sourceRoot":"","sources":["../src/stoneTheme.ts"],"names":[],"mappings":"AA6DA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"stoneTheme.d.ts","sourceRoot":"","sources":["../src/stoneTheme.ts"],"names":[],"mappings":"AA6DA,eAAO,MAAM,UAAU,yDA6VrB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2PhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stoneTheme.test.d.ts","sourceRoot":"","sources":["../src/stoneTheme.test.ts"],"names":[],"mappings":""}
|
package/dist/theme.css
CHANGED
|
@@ -649,6 +649,72 @@
|
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
651
|
|
|
652
|
+
@layer astryx-theme {
|
|
653
|
+
@media (width < 1024px) and (pointer: coarse) {
|
|
654
|
+
@scope ([data-astryx-theme="stone"]) to ([data-astryx-theme]) {
|
|
655
|
+
:scope {
|
|
656
|
+
--font-size-4xs: 0.375rem;
|
|
657
|
+
--font-size-3xs: 0.4375rem;
|
|
658
|
+
--font-size-2xs: 0.5625rem;
|
|
659
|
+
--font-size-xs: 0.6875rem;
|
|
660
|
+
--font-size-sm: 0.8125rem;
|
|
661
|
+
--font-size-base: 1rem;
|
|
662
|
+
--font-size-lg: 1.25rem;
|
|
663
|
+
--font-size-xl: 1.5rem;
|
|
664
|
+
--font-size-2xl: 1.8125rem;
|
|
665
|
+
--font-size-3xl: 2.25rem;
|
|
666
|
+
--font-size-4xl: 2.75rem;
|
|
667
|
+
--font-size-5xl: 3.3125rem;
|
|
668
|
+
--text-heading-1-size: var(--font-size-2xl);
|
|
669
|
+
--text-heading-1-weight: var(--font-weight-semibold);
|
|
670
|
+
--text-heading-1-leading: 1.3793;
|
|
671
|
+
--text-heading-2-size: var(--font-size-xl);
|
|
672
|
+
--text-heading-2-weight: var(--font-weight-semibold);
|
|
673
|
+
--text-heading-2-leading: 1.3333;
|
|
674
|
+
--text-heading-3-size: var(--font-size-lg);
|
|
675
|
+
--text-heading-3-weight: var(--font-weight-bold);
|
|
676
|
+
--text-heading-3-leading: 1.4;
|
|
677
|
+
--text-heading-4-size: var(--font-size-base);
|
|
678
|
+
--text-heading-4-weight: var(--font-weight-bold);
|
|
679
|
+
--text-heading-4-leading: 1.5;
|
|
680
|
+
--text-heading-5-size: var(--font-size-sm);
|
|
681
|
+
--text-heading-5-weight: var(--font-weight-semibold);
|
|
682
|
+
--text-heading-5-leading: 1.5385;
|
|
683
|
+
--text-heading-6-size: var(--font-size-xs);
|
|
684
|
+
--text-heading-6-weight: var(--font-weight-semibold);
|
|
685
|
+
--text-heading-6-leading: 1.4545;
|
|
686
|
+
--text-body-size: var(--font-size-base);
|
|
687
|
+
--text-body-weight: var(--font-weight-normal);
|
|
688
|
+
--text-body-leading: 1.5;
|
|
689
|
+
--text-large-size: var(--font-size-lg);
|
|
690
|
+
--text-large-weight: var(--font-weight-semibold);
|
|
691
|
+
--text-large-leading: 1.4;
|
|
692
|
+
--text-label-size: var(--font-size-base);
|
|
693
|
+
--text-label-weight: var(--font-weight-medium);
|
|
694
|
+
--text-label-leading: 1.5;
|
|
695
|
+
--text-code-size: var(--font-size-base);
|
|
696
|
+
--text-code-weight: var(--font-weight-normal);
|
|
697
|
+
--text-code-leading: 1.5;
|
|
698
|
+
--text-supporting-size: var(--font-size-sm);
|
|
699
|
+
--text-supporting-weight: var(--font-weight-normal);
|
|
700
|
+
--text-supporting-leading: 1.5385;
|
|
701
|
+
--text-display-1-size: var(--font-size-5xl);
|
|
702
|
+
--text-display-1-weight: var(--font-weight-normal);
|
|
703
|
+
--text-display-1-leading: 1.283;
|
|
704
|
+
--text-display-2-size: var(--font-size-4xl);
|
|
705
|
+
--text-display-2-weight: var(--font-weight-normal);
|
|
706
|
+
--text-display-2-leading: 1.2727;
|
|
707
|
+
--text-display-3-size: var(--font-size-3xl);
|
|
708
|
+
--text-display-3-weight: var(--font-weight-normal);
|
|
709
|
+
--text-display-3-leading: 1.2222;
|
|
710
|
+
--font-family-body: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
711
|
+
--font-family-heading: Montserrat, "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
712
|
+
--font-family-code: "JetBrains Mono", "SF Mono", Monaco, Consolas, monospace;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
|
|
652
718
|
@layer astryx-theme {
|
|
653
719
|
@scope ([data-astryx-theme="stone"]) to ([data-astryx-theme]) {
|
|
654
720
|
[data-astryx-media="dark"] {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/theme-stone",
|
|
3
|
-
"version": "0.7.0
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"displayName": "Stone Theme",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Warm stone and slate, earthy and understated, with just enough character to feel handcrafted.",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"lucide-react": "^1.18.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@astryxdesign/core": "0.7.0
|
|
60
|
+
"@astryxdesign/core": "0.7.0",
|
|
61
61
|
"react": ">=19"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@astryxdesign/cli": "0.7.0
|
|
64
|
+
"@astryxdesign/cli": "0.7.0"
|
|
65
65
|
},
|
|
66
66
|
"module": "./dist/source.mjs",
|
|
67
67
|
"scripts": {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
import {describe, expect, it} from 'vitest';
|
|
4
|
+
import {generateThemeCSS} from '@astryxdesign/core/theme';
|
|
5
|
+
import {stoneTheme} from './stoneTheme';
|
|
6
|
+
|
|
7
|
+
describe('stone touch + narrow type pin', () => {
|
|
8
|
+
it('floors body to 16px and holds Display 1 at its desktop size', () => {
|
|
9
|
+
const rule = stoneTheme.__adaptationRules?.[0];
|
|
10
|
+
|
|
11
|
+
expect(stoneTheme.__adaptations.rules).toHaveLength(1);
|
|
12
|
+
expect(rule?.when).toEqual({pointer: 'coarse', width: {below: 'lg'}});
|
|
13
|
+
expect(rule?.query).toBe('(width < 1024px) and (pointer: coarse)');
|
|
14
|
+
// Pinned ladder: base 16 (was 14), ratio 1.25 -> 1.2225, Display 1 pinned.
|
|
15
|
+
expect(rule?.tokens['--font-size-base']).toBe('1rem');
|
|
16
|
+
expect(rule?.tokens['--font-size-lg']).toBe('1.25rem');
|
|
17
|
+
expect(rule?.tokens['--font-size-5xl']).toBe('3.3125rem');
|
|
18
|
+
// Desktop scale is untouched.
|
|
19
|
+
expect(stoneTheme.tokens['--font-size-base']).toBe('0.875rem');
|
|
20
|
+
expect(stoneTheme.tokens['--font-size-5xl']).toBe('3.3125rem');
|
|
21
|
+
expect(generateThemeCSS(stoneTheme).component).toContain(
|
|
22
|
+
'@media (width < 1024px) and (pointer: coarse)',
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
});
|
package/src/stoneTheme.ts
CHANGED
|
@@ -81,6 +81,18 @@ export const stoneTheme = defineTheme({
|
|
|
81
81
|
},
|
|
82
82
|
},
|
|
83
83
|
|
|
84
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
85
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
86
|
+
// ratio' = 1.25 * (14/16)^(1/6) ~= 1.2225. Body 14 -> 16px, display-1 stays 53px.
|
|
87
|
+
adaptations: {
|
|
88
|
+
rules: [
|
|
89
|
+
{
|
|
90
|
+
when: {pointer: 'coarse', width: {below: 'lg'}},
|
|
91
|
+
value: {typography: {scale: {base: 16, ratio: 1.2225}}},
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
|
|
84
96
|
motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},
|
|
85
97
|
|
|
86
98
|
syntax: stoneSyntax,
|