@crystal-neuo/css 0.0.0-stage → 4.0.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/package.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "@crystal-neuo/css",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "4.0.0",
4
+ "description": "Crystal Neuo framework-agnostic CSS: design tokens + component classes.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/AnoRebel/crystal-neuo.git",
9
+ "directory": "packages/css"
10
+ },
11
+ "homepage": "https://crystal-neuo.anorebel.net",
12
+ "type": "module",
13
+ "files": [
14
+ "dist",
15
+ "src"
16
+ ],
17
+ "exports": {
18
+ ".": "./dist/crystal-neuo.css",
19
+ "./tokens.css": "./dist/tokens.css",
20
+ "./base.css": "./src/base.css",
21
+ "./components.css": "./src/components.css"
22
+ },
23
+ "scripts": {
24
+ "build": "bun run build-css.ts",
25
+ "typecheck": "tsc --noEmit"
26
+ },
27
+ "dependencies": {
28
+ "@crystal-neuo/tokens": "4.0.0"
29
+ },
30
+ "devDependencies": {
31
+ "@types/bun": "1.4.4"
32
+ }
33
+ }
package/src/base.css ADDED
@@ -0,0 +1,166 @@
1
+ /* Crystal Neuo base layer — applies tokens to document defaults.
2
+ Import AFTER tokens.css. Framework-agnostic, no component classes here
3
+ except the two public utilities at the end. */
4
+
5
+ *,
6
+ *::before,
7
+ *::after {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ html {
12
+ -webkit-text-size-adjust: 100%;
13
+ text-size-adjust: 100%;
14
+ color-scheme: light;
15
+ }
16
+ :where([data-theme="dark"], [data-theme="high-contrast"]) {
17
+ color-scheme: dark;
18
+ }
19
+
20
+ body {
21
+ margin: 0;
22
+ background: var(--surface-app);
23
+ color: var(--content-primary);
24
+ /* The platform's interface face: the material's text face on the web, the
25
+ system face on iOS, Android, Windows, and macOS. */
26
+ font-family: var(--font-family-ui);
27
+ font-size: var(--type-body-base);
28
+ line-height: var(--leading-normal);
29
+ font-weight: var(--weight-regular);
30
+ -webkit-font-smoothing: antialiased;
31
+ text-rendering: optimizeLegibility;
32
+ transition:
33
+ background-color var(--motion-duration-base) var(--motion-easing-standard),
34
+ color var(--motion-duration-base) var(--motion-easing-standard);
35
+ }
36
+
37
+ /* A nested axis attribute recomputes the tokens below it, but inherited
38
+ properties were already computed from the page's tokens at <body>.
39
+ Re-resolve them where a subtree changes theme, material, or platform, so
40
+ inherited text takes the subtree's ink and UI face. A nested theme also
41
+ paints its own app surface, or dark text could land on a light page.
42
+ Zero specificity: any component rule still wins. */
43
+ :where(body [data-theme], body [data-material], body [data-platform]) {
44
+ color: var(--content-primary);
45
+ font-family: var(--font-family-ui);
46
+ }
47
+ :where(body [data-theme]) {
48
+ background-color: var(--surface-app);
49
+ }
50
+
51
+ h1,
52
+ h2,
53
+ h3,
54
+ h4,
55
+ h5,
56
+ h6 {
57
+ margin: 0 0 var(--space-3);
58
+ font-family: var(--font-family-display);
59
+ line-height: var(--leading-tight);
60
+ font-weight: var(--weight-bold);
61
+ letter-spacing: var(--tracking-tight);
62
+ color: var(--content-primary);
63
+ text-wrap: balance;
64
+ }
65
+
66
+ h1 {
67
+ font-size: var(--type-h1);
68
+ }
69
+ h2 {
70
+ font-size: var(--type-h2);
71
+ }
72
+ h3 {
73
+ font-size: var(--type-h3);
74
+ }
75
+ h4 {
76
+ font-size: var(--type-h4);
77
+ }
78
+ h5 {
79
+ font-size: var(--type-h5);
80
+ }
81
+ h6 {
82
+ font-size: var(--type-h6);
83
+ }
84
+
85
+ p {
86
+ margin: 0 0 var(--space-4);
87
+ text-wrap: pretty;
88
+ }
89
+
90
+ /* Underlined by default: the link color alone is under 3:1 against body text,
91
+ so color cannot be the only cue (WCAG 1.4.1). Navigation components opt out
92
+ because their position already identifies them as links. */
93
+ a {
94
+ color: var(--accent-primary-subtle);
95
+ text-decoration: underline;
96
+ text-decoration-thickness: from-font;
97
+ text-underline-offset: 0.2em;
98
+ }
99
+ @media (hover: hover) {
100
+ a:hover {
101
+ text-decoration-thickness: 2px;
102
+ }
103
+ }
104
+
105
+ /* One focus indicator everywhere: the accent ring (verified 3:1 against the
106
+ page), sized and offset by the platform. */
107
+ :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
108
+ outline: var(--focus-ring-width) solid var(--focus-ring);
109
+ outline-offset: var(--focus-ring-offset);
110
+ }
111
+
112
+ code,
113
+ kbd,
114
+ pre {
115
+ font-family: var(--font-family-mono);
116
+ font-size: 0.9em;
117
+ }
118
+
119
+ /* Inline code only: code inside a <pre> belongs to the block's surface. */
120
+ :where(:not(pre) > code) {
121
+ background: var(--surface-raised);
122
+ padding: 0.1em 0.35em;
123
+ border-radius: var(--radius-xs);
124
+ }
125
+
126
+ pre {
127
+ background: var(--surface-raised);
128
+ padding: var(--space-4);
129
+ border-radius: var(--radius-md);
130
+ overflow-x: auto;
131
+ border: var(--border-width-hairline) solid var(--border-subtle);
132
+ }
133
+
134
+ ::selection {
135
+ background: var(--accent-primary-soft);
136
+ color: var(--content-primary);
137
+ }
138
+
139
+ /* Hidden visually, still read by assistive technology (live regions, labels). */
140
+ .cn-visually-hidden {
141
+ position: absolute;
142
+ inline-size: 1px;
143
+ block-size: 1px;
144
+ padding: 0;
145
+ margin: -1px;
146
+ overflow: hidden;
147
+ clip-path: inset(50%);
148
+ white-space: nowrap;
149
+ border: 0;
150
+ }
151
+
152
+ /* Figures: the material's numeric face with aligned digits. */
153
+ .cn-num {
154
+ font-family: var(--font-family-numeric);
155
+ font-variant-numeric: tabular-nums;
156
+ font-weight: var(--weight-semibold);
157
+ }
158
+
159
+ /* Micro-label: uppercase and tracked in materials that use that voice. */
160
+ .cn-label {
161
+ font-size: var(--type-caption);
162
+ font-weight: var(--weight-semibold);
163
+ letter-spacing: var(--tracking-wide);
164
+ text-transform: var(--type-label-transform);
165
+ color: var(--content-secondary);
166
+ }