@master/css 2.0.0-rc.41 → 2.0.0-rc.43

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.
@@ -1,7 +1,7 @@
1
1
  import colors from '@master/colors';
2
2
  import extend from '@techor/extend';
3
3
 
4
- const variables = extend(colors, {
4
+ const _variables = {
5
5
  full: '100%',
6
6
  fit: 'fit-content',
7
7
  max: 'max-content',
@@ -120,6 +120,25 @@ const variables = extend(colors, {
120
120
  view: 'view-box'
121
121
  },
122
122
  current: 'currentColor',
123
+ frame: {
124
+ neutral: {
125
+ '@light': '$(slate-60)',
126
+ '@dark': '$(gray-30)'
127
+ },
128
+ light: {
129
+ '@light': '$(slate-60)/.2',
130
+ '@dark': '$(gray-30)/.2'
131
+ },
132
+ lighter: {
133
+ '@light': '$(slate-60)/.16',
134
+ '@dark': '$(gray-30)/.16'
135
+ },
136
+ lightest: {
137
+ '@light': '$(slate-60)/.12',
138
+ '@dark': '$(gray-30)/.12'
139
+ }
140
+ },
141
+ // from figma
123
142
  white: '#ffffff',
124
143
  black: '#000000',
125
144
  base: {
@@ -138,96 +157,223 @@ const variables = extend(colors, {
138
157
  '@light': '$(black)',
139
158
  '@dark': '$(white)'
140
159
  },
141
- line: {
142
- neutral: {
143
- '@light': '$(slate-60)',
144
- '@dark': '$(gray-30)'
145
- }
146
- },
147
160
  gray: {
148
161
  '@light': '$(gray-30)',
149
- '@dark': '$(gray-40)'
162
+ '@dark': '$(gray-40)',
163
+ active: {
164
+ '@light': '$(gray-40)',
165
+ '@dark': '$(gray-30)'
166
+ },
167
+ text: {
168
+ '@light': '$(gray-90)',
169
+ '@dark': '$(gray-95)'
170
+ }
150
171
  },
151
172
  slate: {
152
173
  '@light': '$(slate-30)',
153
- '@dark': '$(slate-40)'
174
+ '@dark': '$(slate-40)',
175
+ active: {
176
+ '@light': '$(slate-40)',
177
+ '@dark': '$(slate-30)'
178
+ },
179
+ text: {
180
+ '@light': '$(slate-90)',
181
+ '@dark': '$(slate-95)'
182
+ }
154
183
  },
155
184
  brown: {
156
185
  '@light': '$(brown-40)',
157
- '@dark': '$(brown-50)'
186
+ '@dark': '$(brown-50)',
187
+ active: {
188
+ '@light': '$(brown-50)',
189
+ '@dark': '$(brown-40)'
190
+ },
191
+ text: {
192
+ '@light': '$(brown-90)',
193
+ '@dark': '$(brown-95)'
194
+ }
158
195
  },
159
196
  orange: {
160
197
  '@light': '$(orange-40)',
161
- '@dark': '$(orange-50)'
198
+ '@dark': '$(orange-50)',
199
+ active: {
200
+ '@light': '$(orange-50)',
201
+ '@dark': '$(orange-40)'
202
+ },
203
+ text: {
204
+ '@light': '$(orange-90)',
205
+ '@dark': '$(orange-95)'
206
+ }
162
207
  },
163
208
  amber: {
164
209
  '@light': '$(amber-40)',
165
- '@dark': '$(amber-50)'
210
+ '@dark': '$(amber-50)',
211
+ active: {
212
+ '@light': '$(amber-50)',
213
+ '@dark': '$(amber-30)'
214
+ },
215
+ text: {
216
+ '@light': '$(amber-90)',
217
+ '@dark': '$(amber-95)'
218
+ }
166
219
  },
167
220
  yellow: {
168
221
  '@light': '$(yellow-40)',
169
- '@dark': '$(yellow-50)'
222
+ '@dark': '$(yellow-50)',
223
+ active: {
224
+ '@light': '$(yellow-50)',
225
+ '@dark': '$(yellow-30)'
226
+ },
227
+ text: {
228
+ '@light': '$(yellow-90)',
229
+ '@dark': '$(yellow-95)'
230
+ }
170
231
  },
171
232
  lime: {
172
233
  '@light': '$(lime-40)',
173
- '@dark': '$(lime-50)'
234
+ '@dark': '$(lime-50)',
235
+ active: {
236
+ '@light': '$(lime-50)',
237
+ '@dark': '$(lime-30)'
238
+ },
239
+ text: {
240
+ '@light': '$(lime-90)',
241
+ '@dark': '$(lime-95)'
242
+ }
174
243
  },
175
244
  green: {
176
245
  '@light': '$(green-40)',
177
- '@dark': '$(green-50)'
246
+ '@dark': '$(green-50)',
247
+ active: {
248
+ '@light': '$(green-50)',
249
+ '@dark': '$(green-30)'
250
+ },
251
+ text: {
252
+ '@light': '$(green-90)',
253
+ '@dark': '$(green-95)'
254
+ }
178
255
  },
179
256
  beryl: {
180
257
  '@light': '$(beryl-40)',
181
- '@dark': '$(beryl-50)'
258
+ '@dark': '$(beryl-50)',
259
+ active: {
260
+ '@light': '$(beryl-50)',
261
+ '@dark': '$(beryl-30)'
262
+ },
263
+ text: {
264
+ '@light': '$(beryl-90)',
265
+ '@dark': '$(beryl-95)'
266
+ }
182
267
  },
183
268
  teal: {
184
269
  '@light': '$(teal-40)',
185
- '@dark': '$(teal-50)'
270
+ '@dark': '$(teal-50)',
271
+ active: {
272
+ '@light': '$(teal-50)',
273
+ '@dark': '$(teal-30)'
274
+ },
275
+ text: {
276
+ '@light': '$(teal-90)',
277
+ '@dark': '$(teal-95)'
278
+ }
186
279
  },
187
280
  cyan: {
188
281
  '@light': '$(cyan-40)',
189
- '@dark': '$(cyan-50)'
282
+ '@dark': '$(cyan-50)',
283
+ active: {
284
+ '@light': '$(cyan-50)',
285
+ '@dark': '$(cyan-30)'
286
+ },
287
+ text: {
288
+ '@light': '$(cyan-90)',
289
+ '@dark': '$(cyan-95)'
290
+ }
190
291
  },
191
292
  sky: {
192
293
  '@light': '$(sky-60)',
193
- '@dark': '$(sky-50)'
294
+ '@dark': '$(sky-50)',
295
+ active: {
296
+ '@light': '$(sky-70)',
297
+ '@dark': '$(sky-40)'
298
+ },
299
+ text: '$(white)'
194
300
  },
195
301
  blue: {
196
302
  '@light': '$(blue-60)',
197
- '@dark': '$(blue-50)'
303
+ '@dark': '$(blue-50)',
304
+ active: {
305
+ '@light': '$(blue-70)',
306
+ '@dark': '$(blue-40)'
307
+ },
308
+ text: '$(white)'
198
309
  },
199
310
  indigo: {
200
311
  '@light': '$(indigo-60)',
201
- '@dark': '$(indigo-50)'
312
+ '@dark': '$(indigo-50)',
313
+ active: {
314
+ '@light': '$(indigo-70)',
315
+ '@dark': '$(indigo-40)'
316
+ },
317
+ text: '$(white)'
202
318
  },
203
319
  violet: {
204
320
  '@light': '$(violet-60)',
205
- '@dark': '$(violet-50)'
321
+ '@dark': '$(violet-50)',
322
+ active: {
323
+ '@light': '$(violet-70)',
324
+ '@dark': '$(violet-40)'
325
+ },
326
+ text: '$(white)'
206
327
  },
207
328
  purple: {
208
329
  '@light': '$(purple-60)',
209
- '@dark': '$(purple-50)'
330
+ '@dark': '$(purple-50)',
331
+ active: {
332
+ '@light': '$(purple-70)',
333
+ '@dark': '$(purple-40)'
334
+ },
335
+ text: '$(white)'
210
336
  },
211
337
  fuchsia: {
212
338
  '@light': '$(fuchsia-60)',
213
- '@dark': '$(fuchsia-50)'
339
+ '@dark': '$(fuchsia-50)',
340
+ active: {
341
+ '@light': '$(fuchsia-70)',
342
+ '@dark': '$(fuchsia-40)'
343
+ },
344
+ text: '$(white)'
214
345
  },
215
346
  pink: {
216
347
  '@light': '$(pink-60)',
217
- '@dark': '$(pink-50)'
348
+ '@dark': '$(pink-50)',
349
+ active: {
350
+ '@light': '$(pink-70)',
351
+ '@dark': '$(pink-40)'
352
+ },
353
+ text: '$(white)'
218
354
  },
219
355
  crimson: {
220
356
  '@light': '$(crimson-60)',
221
- '@dark': '$(crimson-50)'
357
+ '@dark': '$(crimson-50)',
358
+ active: {
359
+ '@light': '$(crimson-70)',
360
+ '@dark': '$(crimson-40)'
361
+ },
362
+ text: '$(white)'
222
363
  },
223
364
  red: {
224
365
  '@light': '$(red-60)',
225
- '@dark': '$(red-50)'
366
+ '@dark': '$(red-50)',
367
+ active: {
368
+ '@light': '$(red-70)',
369
+ '@dark': '$(red-40)'
370
+ },
371
+ text: '$(white)'
226
372
  },
227
373
  text: {
228
374
  invert: {
229
- '@light': '$(black)',
230
- '@dark': '$(white)'
375
+ '@light': '$(white)',
376
+ '@dark': '$(black)'
231
377
  },
232
378
  strong: {
233
379
  '@light': '$(slate-95)',
@@ -330,6 +476,7 @@ const variables = extend(colors, {
330
476
  '@dark': '$(red-30)'
331
477
  }
332
478
  }
333
- });
479
+ };
480
+ const variables = extend(colors, _variables);
334
481
 
335
482
  export { variables as default };
package/dist/core.cjs CHANGED
@@ -923,9 +923,15 @@ class MasterCSS {
923
923
  break;
924
924
  case 'host':
925
925
  selectorText = `:host(.${mode})`;
926
+ if (this.config.defaultMode === mode) {
927
+ selectorText += ',:host';
928
+ }
926
929
  break;
927
930
  case 'class':
928
- selectorText = `.${mode}`;
931
+ selectorText = '.' + mode;
932
+ if (this.config.defaultMode === mode) {
933
+ selectorText += ',:root';
934
+ }
929
935
  break;
930
936
  default:
931
937
  return;
@@ -1011,7 +1017,7 @@ class MasterCSS {
1011
1017
  let prefix = '';
1012
1018
  let suffix = '}';
1013
1019
  if (variableCSSRule.parentRule) {
1014
- prefix += variableCSSRule.parentRule.conditionText.replace(/ /g, '') + '{';
1020
+ prefix += '@media' + variableCSSRule.parentRule.conditionText.replace(/ /g, '') + '{';
1015
1021
  suffix += '}';
1016
1022
  }
1017
1023
  prefix += variableCSSRule.selectorText + '{';
package/dist/core.d.ts CHANGED
@@ -84,7 +84,7 @@ export default class MasterCSS {
84
84
  }
85
85
  export declare const masterCSSs: MasterCSS[];
86
86
  export default interface MasterCSS {
87
- readonly style: HTMLStyleElement;
87
+ style: HTMLStyleElement;
88
88
  styles: Record<string, string[]>;
89
89
  stylesBy: Record<string, string[]>;
90
90
  selectors: Record<string, [RegExp, string[]][]>;
package/dist/core.mjs CHANGED
@@ -919,9 +919,15 @@ class MasterCSS {
919
919
  break;
920
920
  case 'host':
921
921
  selectorText = `:host(.${mode})`;
922
+ if (this.config.defaultMode === mode) {
923
+ selectorText += ',:host';
924
+ }
922
925
  break;
923
926
  case 'class':
924
- selectorText = `.${mode}`;
927
+ selectorText = '.' + mode;
928
+ if (this.config.defaultMode === mode) {
929
+ selectorText += ',:root';
930
+ }
925
931
  break;
926
932
  default:
927
933
  return;
@@ -1007,7 +1013,7 @@ class MasterCSS {
1007
1013
  let prefix = '';
1008
1014
  let suffix = '}';
1009
1015
  if (variableCSSRule.parentRule) {
1010
- prefix += variableCSSRule.parentRule.conditionText.replace(/ /g, '') + '{';
1016
+ prefix += '@media' + variableCSSRule.parentRule.conditionText.replace(/ /g, '') + '{';
1011
1017
  suffix += '}';
1012
1018
  }
1013
1019
  prefix += variableCSSRule.selectorText + '{';
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@master/css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","test":"vitest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"The CSS language and framework for rapidly building modern and high-performance websites","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/core"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":false,"main":"./dist/index.cjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"bin":"./dist/bin/index.mjs","files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/colors":"^2.1.0","@master/normal.css":"^3.1.0","@techor/extend":"^3.0.23","csstype":"^3.1.3"},"devDependencies":{"shared":"^2.0.0-rc.41"},"version":"2.0.0-rc.41"}
1
+ {"name":"@master/css","type":"module","scripts":{"build":"techor build \"src/**/*.ts\"","dev":"pnpm build --watch","test":"vitest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"The CSS language and framework for rapidly building modern and high-performance websites","author":"Aoyue Design LLC.","funding":"https://rc.css.master.co/sponsor","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/core"},"keywords":["style","styles","html","variants","virtual","virtual-css","utility","css","ui","lightweight","class","webpack","plugin","integration","vite","parcel","build-tools","mastercss"],"sideEffects":false,"main":"./dist/index.cjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"bin":"./dist/bin/index.mjs","files":["dist"],"publishConfig":{"access":"public","provenance":true},"dependencies":{"@master/colors":"^2.1.0","@master/normal.css":"^3.1.0","@techor/extend":"^3.0.23","csstype":"^3.1.3"},"devDependencies":{"shared":"^2.0.0-rc.43"},"version":"2.0.0-rc.43"}