@neatui/css 5.6.1 → 5.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/package.json +1 -1
- package/tokens/grammar.cjs +8 -1
- package/tokens/neatui.tokens.json +12 -0
package/package.json
CHANGED
package/tokens/grammar.cjs
CHANGED
|
@@ -79,8 +79,11 @@ function compileClassPatterns(spec) {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
function createValidatorFromSpec(spec) {
|
|
82
|
+
function createValidatorFromSpec(spec, options = {}) {
|
|
83
83
|
const classPatterns = compileClassPatterns(spec);
|
|
84
|
+
// Exact class names from the compiled CSS snapshot. Patterns only cover the
|
|
85
|
+
// graded families, so anything actually emitted by the CSS is accepted first.
|
|
86
|
+
const knownClasses = new Set(options.knownClasses || []);
|
|
84
87
|
const responsivePrefixes = new Set(spec.responsivePrefixes || ['mob', 'pad']);
|
|
85
88
|
|
|
86
89
|
const attributes = {};
|
|
@@ -108,6 +111,10 @@ function createValidatorFromSpec(spec) {
|
|
|
108
111
|
const token = String(raw || '').trim();
|
|
109
112
|
if (!token) return null;
|
|
110
113
|
|
|
114
|
+
if (knownClasses.has(token)) {
|
|
115
|
+
return { kind: 'class', token, ok: true, patternId: 'snapshot', prefix: null, base: token };
|
|
116
|
+
}
|
|
117
|
+
|
|
111
118
|
const { prefix, base, unknownPrefix } = stripResponsivePrefix(token);
|
|
112
119
|
if (unknownPrefix) {
|
|
113
120
|
return {
|
|
@@ -129,6 +129,18 @@
|
|
|
129
129
|
{
|
|
130
130
|
"value": "deep",
|
|
131
131
|
"intent": "加深背景(由 back 推导)。"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"value": "w",
|
|
135
|
+
"intent": "纯白(#fff),用于有色深背景上的白字。"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"value": "b",
|
|
139
|
+
"intent": "纯黑(#000)。"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"value": "none",
|
|
143
|
+
"intent": "透明(transparent)。"
|
|
132
144
|
}
|
|
133
145
|
],
|
|
134
146
|
"flex": {
|