aliascss 1.3.9 → 1.4.1

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/docc.md CHANGED
@@ -256,4 +256,231 @@ Group multiple AliasCSS classes under the same state/selector:
256
256
 
257
257
  xml
258
258
  <!-- Instead of repeating --hover multiple times: -->
259
- <button class="b0 color-fff bgc-blue --hover-c-gray --hover-border-radius-4px --hover-bgc-skyBlue">
259
+ <button class="b0 color-fff bgc-blue --hover-c-gray --hover-border-radius-4px --hover-bgc-skyBlue">
260
+
261
+ Here is the complete table of repeated CSS values along with all the alias keys that map to them:
262
+
263
+ ## Repeated CSS Values Table
264
+
265
+ | Repeated CSS Value | Keys / Aliases |
266
+ | --- | --- |
267
+ | `align-content: start` | `acs`, `acs/start`<br> |
268
+ | `align-content: stretch` | `acs2`, `acs/stretch`, `acst`<br> |
269
+ | `animation-direction: normal` | `adn`, `adnl`<br> |
270
+ | `animation-fill-mode: backwards` | `afmb`, `afmb/backward`<br> |
271
+ | `animation-fill-mode: both` | `afmb2`, `afmb/both`, `afmbo`<br> |
272
+ | `background-blend-mode: darken` | `bgbmd`, `bgbmd/darken`<br> |
273
+ | `background-blend-mode: difference` | `bgbmd2`, `bgbmd/difference`, `bgbmdf`<br> |
274
+ | `background-blend-mode: lighten` | `bgbml`, `bgbml/lighteb`<br> |
275
+ | `background-blend-mode: luminosity` | `bgbml2`, `bgbml/luminosity`, `bgbmlu`<br> |
276
+ | `background-blend-mode: saturation` | `bgbms2`, `bgbms/saturation`, `bgbmsa`<br> |
277
+ | `background-blend-mode: screen` | `bgbms`, `bgbms/screen`<br> |
278
+ | `background-repeat: no-repeat` | `bgnr`, `bgrn`<br> |
279
+ | `background-repeat: repeat no-repeat` | `bgrnr`, `bgrrn`, `bgrrnr`<br> |
280
+ | `background-repeat: repeat-x` | `bgrrx`, `bgrx`<br> |
281
+ | `background-repeat: repeat-y` | `bgrry`, `bgry`<br> |
282
+ | `background-size: cover` | `bgsc`, `bgsc/cover`<br> |
283
+ | `background-size:contain` | `bgsc2`, `bgsc/contain`<br> |
284
+ | `border-bottom-style: dashed` | `bbsd`, `bbsd/dashed`, `bbsds`<br> |
285
+ | `border-bottom-style: dotted` | `bbsd3`, `bbsd/dotted`, `bbsdt`<br> |
286
+ | `border-bottom-style: double` | `bbsd2`, `bbsd/double`, `bbsdb`<br> |
287
+ | `border-bottom-width: thick` | `bbwt`, `bbwt/thick`<br> |
288
+ | `border-bottom-width: thin` | `bbwt2`, `bbwt/thin`, `bbwtn`<br> |
289
+ | `border-image-repeat: repeat` | `birr`, `birr/repeat`<br> |
290
+ | `border-image-repeat: round` | `birro`, `birr2`, `birr/round`<br> |
291
+ | `border-image-repeat: space` | `birs`, `birs/space`<br> |
292
+ | `border-image-repeat: stretch` | `birs2`, `birs/stretch`, `birsth`<br> |
293
+ | `border-image-source: none` | `bisn2`, `bisn/source`, `bisn/image-source`, `bisno`<br> |
294
+ | `border-inline-end-style: dashed` | `biesd`, `biesd/dashed`, `biesds`<br> |
295
+ | `border-inline-end-style: dotted` | `biesd3`, `biesd/dotted`, `biesdt`<br> |
296
+ | `border-inline-end-style: double` | `biesd2`, `biesd/double`, `biesdb`<br> |
297
+ | `border-inline-start-style: dashed` | `bissd`, `bissd/dashed`, `bissds`<br> |
298
+ | `border-inline-start-style: dotted` | `bissd3`, `bissd/dotted`, `bissdt`<br> |
299
+ | `border-inline-start-style: double` | `bissd2`, `bissd/double`, `bissdb`<br> |
300
+ | `border-inline-style: dashed` | `bisd`, `bisd/dashed`, `bisds`<br> |
301
+ | `border-inline-style: dotted` | `bisd3`, `bisd/dotted`, `bisdt`<br> |
302
+ | `border-inline-style: double` | `bisd2`, `bisd/double`, `bisdb`<br> |
303
+ | `border-inline-style: none` | `bisn`, `bisn/inline-style`, `bisn/style`<br> |
304
+ | `border-left-style: dashed` | `blsd`, `blsd/dashed`, `blsds`<br> |
305
+ | `border-left-style: dotted` | `blsd3`, `blsd/dotted`, `blsdt`<br> |
306
+ | `border-left-style: double` | `blsd2`, `blsd/double`, `blsdb`<br> |
307
+ | `border-left-width: thick` | `blwt`, `blwt/thick`<br> |
308
+ | `border-left-width: thin` | `blwt2`, `blwt/thin`, `blwtn`<br> |
309
+ | `border-right-style: dashed` | `brsd`, `brsd/dashed`, `brsds`<br> |
310
+ | `border-right-style: dotted` | `brsd3`, `brsd/dotted`, `brsdt`<br> |
311
+ | `border-right-style: double` | `brsd2`, `brsd/double`, `brsdb`<br> |
312
+ | `border-right-width: thick` | `brwt`, `brwt/thick`<br> |
313
+ | `border-right-width: thin` | `brwt2`, `brwt/thin`, `brwtn`<br> |
314
+ | `border-style: dashed` | `bsd`, `bsd/dashed`, `bsds`<br> |
315
+ | `border-style: dotted` | `bsd3`, `bsd/dotted`, `bsdt`<br> |
316
+ | `border-style: double` | `bsd2`, `bsd/double`, `bsdb`<br> |
317
+ | `border-style: inset` | `bsi`, `bsi/inset`<br> |
318
+ | `border-top-style: dashed` | `btsd`, `btsd/dashed`, `btsds`<br> |
319
+ | `border-top-style: dotted` | `btsd3`, `btsd/dotted`, `btsdt`<br> |
320
+ | `border-top-style: double` | `btsd2`, `btsd/double`, `btsdb`<br> |
321
+ | `border-top-width: thick` | `btwt`, `btwt/thick`<br> |
322
+ | `border-top-width: thin` | `btwt2`, `btwt/thin`, `btwtn`<br> |
323
+ | `border-width: thick` | `bwt`, `bwt/thick`<br> |
324
+ | `border-width: thin` | `bwt2`, `bwt/thin`, `bwtn`<br> |
325
+ | `bottom: auto` | `ba`, `btma`<br> |
326
+ | `box-align: baseline` | `bab2`, `bab/baseline`, `babl`<br> |
327
+ | `box-align: before` | `bab`, `bab/before`<br> |
328
+ | `break-after: always` | `baa3`, `baa/always`, `baal`<br> |
329
+ | `break-after: auto` | `baa`, `baa/auto`<br> |
330
+ | `break-after: avoid` | `baa2`, `baa/avoid`, `baav`<br> |
331
+ | `break-before: always` | `bba3`, `bba/always`, `bbal`<br> |
332
+ | `break-before: auto` | `bba`, `bba/auto`<br> |
333
+ | `break-before: avoid` | `bba2`, `bba/avoid`, `bbav`<br> |
334
+ | `break-inside: auto` | `bia`, `bia/auto`<br> |
335
+ | `break-inside: avoid` | `bia2`, `bia/avoid`, `biav`<br> |
336
+ | `clear-after: both` | `cab`, `cab/both`<br> |
337
+ | `clear-after: bottom` | `cab2`, `cab/bottom`, `cabtm`<br> |
338
+ | `clear-after: start` | `cas2`, `cas/after`, `cas/clear`, `cast`<br> |
339
+ | `clear: none` | `cn`, `cn/clear`<br> |
340
+ | `clip: auto` | `ca3`, `ca/clip`, `cla`<br> |
341
+ | `column-rule-style: dashed` | `crsd`, `crsd/dashed`, `crsds`<br> |
342
+ | `column-rule-style: dotted` | `crsd3`, `crsd/dotted`, `crsdt`<br> |
343
+ | `column-rule-style: double` | `crsd2`, `crsd/double`, `crsdb`<br> |
344
+ | `column-rule-width: thick` | `crwt`, `crwt/thick`<br> |
345
+ | `column-rule-width: thin` | `crwt2`, `crwt/thin`, `crwtn`<br> |
346
+ | `content: close-quote` | `concq`, `ccq`<br> |
347
+ | `content: icon` | `ci2`, `ci/icon`, `ci/content`, `coni`<br> |
348
+ | `content: no-close-quote` | `cncq`, `conncq`<br> |
349
+ | `content: no-open-quote` | `cnoq`, `connoq`<br> |
350
+ | `content: none` | `cn3`, `cn/content`, `conn`<br> |
351
+ | `content: normal` | `cn4`, `cn/normal`, `connl`<br> |
352
+ | `cursor: alias` | `ca2`, `ca/alias`, `cal`<br> |
353
+ | `cursor: all-scroll` | `cas`, `cas/cursor`<br> |
354
+ | `cursor: auto` | `ca`, `ca/auto`, `ca/cursor`<br> |
355
+ | `cursor: n-resize` | `cnr`, `cnr/n`<br> |
356
+ | `cursor: ne-resize` | `cner`, `cnr7`, `cnr8`, `cnr/ne`<br> |
357
+ | `cursor: nesw-resize` | `cneswr`, `cnr5`, `cnr6`, `cnr/nesw`<br> |
358
+ | `cursor: none` | `cn2`, `cn/cursor`, `cnone`<br> |
359
+ | `cursor: ns-resize` | `cnr2`, `cnr/ns`, `cnsr`<br> |
360
+ | `cursor: nw-resize` | `cnr3`, `cnr/nw`, `cnwr`<br> |
361
+ | `cursor: nwse-resize` | `cnr4`, `cnr/nwse`, `cnwser`<br> |
362
+ | `cursor: pointer` | `cp`, `cp/pointer`<br> |
363
+ | `cursor: progress` | `cp2`, `cp/progress`, `cpg`<br> |
364
+ | `cursor: s-resize` | `csr`, `csr/s`<br> |
365
+ | `cursor: se-resize` | `cser`, `csr3`, `csr/se`<br> |
366
+ | `cursor: sw-resize` | `csr2`, `csr/sw`, `cswr`<br> |
367
+ | `display: compact` | `dc2`, `dc/compact`, `dcp`<br> |
368
+ | `display: container` | `dc`, `dc/container`<br> |
369
+ | `display: table-caption` | `dtc2`, `dtc/caption`, `dtcp`<br> |
370
+ | `display: table-cell` | `dtc3`, `dtc/cell`, `dtcl`<br> |
371
+ | `display: table-column` | `dtc`, `dtc/column`<br> |
372
+ | `flex-direction: column` | `fdc`, `ffc`<br> |
373
+ | `flex-direction: column-reverse` | `fdcr`, `ffcr`<br> |
374
+ | `flex-direction: row` | `fdr`, `ffr`<br> |
375
+ | `flex-direction: row-reverse` | `fdrr`, `ffrr`<br> |
376
+ | `flex-item-align: start` | `fias`, `fias/start`<br> |
377
+ | `flex-item-align: stretch` | `fias2`, `fias/stretch`, `fiasth`<br> |
378
+ | `flex-line-pack: stretch` | `flps/stretch`, `flpsth`<br> |
379
+ | `flex-wrap: nowrap` | `ffn`, `fwn`<br> |
380
+ | `font-kerning: normal` | `fkn2`, `fknl`<br> |
381
+ | `font-size: large` | `fsl`, `fsl/large`<br> |
382
+ | `font-size: larger` | `fsl2`, `fsl/larger`, `fslr`<br> |
383
+ | `font-size: small` | `fss`, `fss/small`<br> |
384
+ | `font-size: smaller` | `fss2`, `fss/smaller`, `fssr`<br> |
385
+ | `font-size: x-large` | `fsxl`, `fsxl/x`<br> |
386
+ | `font-size: xx-large` | `fsxl2`, `fsxl/xx`, `fsxxl`<br> |
387
+ | `font-size: xx-small` | `fsxs2`, `fsxs`, `fsxxs`<br> |
388
+ | `font-smooth: never` | `fsn4`, `fsn/never`, `fsnv`<br> |
389
+ | `font-stretch: normal` | `fsn3`, `fsnml`<br> |
390
+ | `font-style: italic` | `fsi`, `fsi/italic`<br> |
391
+ | `font-style: normal` | `fsn2`, `fsnl`<br> |
392
+ | `font-variant-caps: normal` | `fvcn`, `fvcnl`<br> |
393
+ | `font-weight: bold` | `fwb`, `fwb/bold`<br> |
394
+ | `font-weight: bolder` | `fwb2`, `fwb/bolder`, `fwbr`<br> |
395
+ | `font-weight: normal` | `fwn2`, `fwnl`<br> |
396
+ | `height:auto` | `ha2`, `ha/height`<br> |
397
+ | `hyphens: auto` | `ha`, `ha/hyphen`<br> |
398
+ | `justify-items: right` | `jir`, `jir/right`<br> |
399
+ | `justify-items: start` | `jis`, `jis/start`<br> |
400
+ | `justify-items: stretch` | `jis2`, `jis/stretch`, `jist`<br> |
401
+ | `justify-self: right` | `jsr`, `jsr/right`<br> |
402
+ | `justify-self: start` | `jss`, `jss/start`<br> |
403
+ | `justify-self: stretch` | `jss2`, `jss/stretch`, `jsst`<br> |
404
+ | `letter-spacing: normal` | `lesnl`, `lsn2`, `lsn/normal`, `lsnl`<br> |
405
+ | `line-break: normal` | `lbn`, `lbnl`<br> |
406
+ | `line-height: normal` | `lhn`, `lhnl`<br> |
407
+ | `list-style-type: armenian` | `lsa`, `lsta`<br> |
408
+ | `list-style-type: circle` | `lsc`, `lstc`<br> |
409
+ | `list-style-type: decimal` | `lsd2`, `lsd/decimal`, `lsdc`, `lstd2`, `lstd/decimal`<br> |
410
+ | `list-style-type: decimal-leading-zero` | `lsdlz`, `lstdlz`<br> |
411
+ | `list-style-type: disc` | `lsd`, `lsd/disc`, `lstd`, `lstd/disc`<br> |
412
+ | `list-style-type: georgian` | `lsg`, `lstg`<br> |
413
+ | `list-style-type: lower-alpha` | `lsla`, `lstla`<br> |
414
+ | `list-style-type: lower-greek` | `lslg`, `lstlg`<br> |
415
+ | `list-style-type: lower-latin` | `lsll`, `lstll`<br> |
416
+ | `list-style-type: lower-roman` | `lslr`, `lstlr`<br> |
417
+ | `list-style-type: square` | `lss`, `lsts`<br> |
418
+ | `list-style-type: upper-alpha` | `lstua`, `lsua`<br> |
419
+ | `list-style-type: upper-latin` | `lstul`, `lsul`<br> |
420
+ | `list-style-type: upper-roman` | `lstur`, `lsur`<br> |
421
+ | `list-style: none` | `lsn`, `lsn/none`<br> |
422
+ | `mask-repeat: repeat` | `mrr`, `mrr/repeat`<br> |
423
+ | `mask-repeat: round` | `mrr2`, `mrr/round`, `mrro`<br> |
424
+ | `mix-blend-mode: darken` | `mbmd`, `mbmd/darken`<br> |
425
+ | `mix-blend-mode: difference` | `mbmd2`, `mbmd/difference`, `mbmdf`<br> |
426
+ | `mix-blend-mode: lighten` | `mbml`, `mbml/lighten`<br> |
427
+ | `mix-blend-mode: luminosity` | `mbml2`, `mbml/luminisity`, `mbmlu`<br> |
428
+ | `mix-blend-mode: saturation` | `mbms2`, `mbms/saturation`, `mbmsa`<br> |
429
+ | `mix-blend-mode: screen` | `mbms`, `mbms/screen`<br> |
430
+ | `outline-style: dashed` | `osd`, `osd/dashed`, `osds`<br> |
431
+ | `outline-style: dotted` | `osd3`, `osd/dotted`, `osdt`<br> |
432
+ | `outline-style: double` | `osd2`, `osd/double`, `osdb`<br> |
433
+ | `outline-width: thick` | `owt`, `owt/thick`<br> |
434
+ | `outline-width: thin` | `owt2`, `owt/thin`, `owtn`<br> |
435
+ | `outline:none` | `oln`, `on`<br> |
436
+ | `overflow-wrap: normal` | `own`, `ownl`<br> |
437
+ | `page-break-after: always` | `pbaa3`, `pbaa/always`, `pbaal`<br> |
438
+ | `page-break-after: auto` | `pbaa`, `pbaa/auto`<br> |
439
+ | `page-break-after: avoid` | `pbaa2`, `pbaa/avoid`, `pbaav`<br> |
440
+ | `page-break-before: always` | `pbba3`, `pbba/always`, `pbbal`<br> |
441
+ | `page-break-before: auto` | `pbba`, `pbba/auto`<br> |
442
+ | `page-break-before: avoid` | `pbba2`, `pbba/avoid`, `pbbav`<br> |
443
+ | `page-break-inside: avoid` | `pbia2`, `pbiav`<br> |
444
+ | `perspective-origin: bottom` | `pob`, `pobtm`<br> |
445
+ | `place-items: start legacy` | `pisl`, `pisl/start`<br> |
446
+ | `place-items: stretch legacy` | `pisl2`, `pisl/stretch`, `pistl`<br> |
447
+ | `place-self: start auto` | `pssa`, `pssa/start`<br> |
448
+ | `place-self: stretch auto` | `pssa2`, `pssa/stretch`, `pssta`<br> |
449
+ | `position: static` | `ps`, `ps/static`<br> |
450
+ | `position: sticky` | `ps2`, `ps/sticky`, `pst`<br> |
451
+ | `stroke-linecap:butt` | `slb`, `slb/butt`, `slcb`<br> |
452
+ | `stroke-linecap:round` | `slcr`, `slr`, `slr/linecap`, `slr/cap`<br> |
453
+ | `stroke-linecap:square` | `slcs`, `sls`<br> |
454
+ | `stroke-linejoin:arcs` | `sla`, `slja`<br> |
455
+ | `stroke-linejoin:bevel` | `slb2`, `slb/bevel`, `sljb`<br> |
456
+ | `stroke-linejoin:milter` | `sljm`, `slm`<br> |
457
+ | `stroke-linejoin:milter-clip` | `sljmc`, `slmc`<br> |
458
+ | `stroke-linejoin:round` | `sljr`, `slr2`, `slr/linejoin`, `slr/join`<br> |
459
+ | `text-decoration-style: dashed` | `tdsd2`, `tdsd/double`, `tdsds`<br> |
460
+ | `text-decoration-style: dotted` | `tdsd3`, `tdsd/dotted`, `tdsdt`<br> |
461
+ | `text-decoration-style: double` | `tdsd`, `tdsd/dashed`, `tdsdb`<br> |
462
+ | `text-decoration: dashed` | `tdd`, `tdd/dashed`, `tdds`<br> |
463
+ | `text-decoration: dotted` | `tdd3`, `tdd/dotted`, `tddt`<br> |
464
+ | `text-decoration: double` | `tdd2`, `tdd/double`, `tddb`<br> |
465
+ | `text-decoration: overline` | `tdlo`, `tdo`<br> |
466
+ | `text-overflow: clip` | `toc2`, `toc/clip`, `toc/text`, `toc/overflow`<br> |
467
+ | `text-rendering: geometricPrecision` | `trg`, `trgp`<br> |
468
+ | `text-rendering: optimizeLegibility` | `tro`, `trop`<br> |
469
+ | `text-rendering: optimizeSpeed` | `tro2`, `tros`<br> |
470
+ | `transform-origin: bottom` | `tob`, `tobtm`<br> |
471
+ | `transform-origin: center` | `toc`, `toc/center`, `toc/transform`, `toc/origin`<br> |
472
+ | `transform-style: preserve-3d` | `tsp3`, `tsp3d`<br> |
473
+ | `unicode-bidi: normal` | `ubn`, `ubnl`<br> |
474
+ | `user-select: all` | `usa2`, `usa/all`, `usal`<br> |
475
+ | `user-select: auto` | `usa`, `usa/auto`<br> |
476
+ | `vertical-align: baseline` | `vab`, `vab/baseline`<br> |
477
+ | `vertical-align: bottom` | `vab2`, `vab/bottom`, `vabtm`<br> |
478
+ | `white-space: normal` | `wsn2`, `wsn/space`, `wsn/white`, `wsnl`<br> |
479
+ | `white-space: nowrap` | `wsn`, `wsn/nowrap`<br> |
480
+ | `word-break: normal` | `wbn`, `wbnl`<br> |
481
+ | `word-spacing:normal` | `wsn3`, `wsn/world`, `wsn/spacing`<br> |
482
+ | `word-wrap: normal` | `wwn`, `wwnl`<br> |
483
+ | `writing-direction-ltr` | `wdl`, `wdltr`<br> |
484
+ | `writing-direction-rtl` | `wdr`, `wdrtl`<br> |
485
+ | `writing-mode: vertical-lr` | `wmvl`, `wmvlr`<br> |
486
+ | `writing-mode: vertical-rl` | `wmvr`, `wmvrl`<br> |
@@ -1,4 +1,6 @@
1
1
  import { compiler as statementMaker } from './returnStatement.js';
2
+ import config from './config.js';
3
+ // import mapRawAttributeNames from './utils/browser-helper.js';
2
4
  export default statementMaker;
3
5
  export let classPrinter = {
4
6
  invalidLists: [],
@@ -6,6 +8,8 @@ export let classPrinter = {
6
8
  styleTagExists: false,
7
9
  customCheck: false,
8
10
  useColon: true,
11
+ cls: {},
12
+ kfs: {},
9
13
  kfNames: {},
10
14
  styleTag: null,
11
15
  createStyleTag() {
@@ -15,6 +19,9 @@ export let classPrinter = {
15
19
  const styleTag = document.createElement('style');
16
20
  styleTag.id = 'styleAlias';
17
21
  document.getElementsByTagName('head')[0].appendChild(styleTag);
22
+ // initialize @layer for reset, base, theme, components and utilities
23
+ const initLayer = document.createTextNode(`@layer ${config.layers.join(', ')};`);
24
+ styleTag.appendChild(initLayer);
18
25
  this.styleTag = styleTag;
19
26
  this.styleTagExists = true;
20
27
  return styleTag;
@@ -45,7 +52,7 @@ export let classPrinter = {
45
52
  let attrValue = '';
46
53
  const testRegExp = this.useColon ? /class[-_:]/ : /class[-_]/;
47
54
  const testRegExpKF = this.useColon ? /keyframes[-_:]/ : /keyframes[-_]/;
48
- const rawCSS = /data-raw-css/;
55
+ // const rawCSS=/data-raw-css/;
49
56
  // if class
50
57
  if (el.getAttribute('class'))
51
58
  attrValue += ' ' + el.getAttribute('class');
@@ -219,11 +226,18 @@ export let classPrinter = {
219
226
  return statement;
220
227
  },
221
228
  run(el) {
222
- // const event = new Event('acss:init');
223
229
  var _a;
224
230
  const $root = el || document;
225
231
  // $root.dispatchEvent(event);
226
232
  $root.dispatchEvent(new CustomEvent('acss:init', { bubbles: true, detail: { aliascss: this } }));
233
+ // mapRawAttributeNames().then(({ kfs, cls }) => {
234
+ // // Use the variables inside this block
235
+ // this.cls = cls;
236
+ // this.kfs = kfs;
237
+ // }).catch(error => {
238
+ // console.error("cannot initialize keyframes and class-grouping for case free names:", error);
239
+ // });
240
+ // const event = new Event('acss:init');
227
241
  // create a keyframes object to fix case-sensitive issue
228
242
  (_a = (el || document.body).outerHTML.match(/keyframes-[a-z0-9_-]+(?==)/gi)) === null || _a === void 0 ? void 0 : _a.forEach((each) => {
229
243
  this.kfNames[each.replace('keyframes-', '').toLowerCase()] = each.replace('keyframes-', '');
@@ -1,9 +1,31 @@
1
1
  import color from './color.js';
2
2
  export default function border(data, custom) {
3
- // let result='';
3
+ // let result='';
4
4
  const styleRegex = /-(none|n|hidden|h|dotted|dt|dashed|ds|solid|s|double|db|groove|g|ridge|r|inset|i|outset|o)(?=[\w-]|$)/;
5
5
  const widthRegex = /[-]?([0-9]+[d/.]?[0-9]*(px|em|fr|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|p))/;
6
6
  let [s, l, c] = ['', '', ''];
7
+ // [...data.split('__')].forEach((each)=>{
8
+ // // Style
9
+ // if(styleRegex.test(data)){
10
+ // const m=data.match(styleRegex);
11
+ // s=m?style[m[1]]:'';
12
+ // data=m?data.replace(m[0],''):data;
13
+ // }
14
+ // // width
15
+ // if(/-(thick|medium|thin)/.test(data)){
16
+ // const m=data.match(/-(thick|medium|thin)/);
17
+ // l=m?m[1]:'';
18
+ // data=m?data.replace(m[0],''):data;
19
+ // }else if(widthRegex.test(data)){
20
+ // const m=data.match(widthRegex);
21
+ // l=m?m[1].replace(/p[\s]?$/,'%').replace(/(\d)d(\d)/,'$1.$2'):'';
22
+ // data=m?data.replace(m[0],''):data;
23
+ // }
24
+ // if(data){
25
+ // c=color(data,custom);
26
+ // }
27
+ // result= result+`${l?l:''} ${s?s:''} ${c?c:''}`.trim()+
28
+ // })
7
29
  // Style
8
30
  if (styleRegex.test(data)) {
9
31
  const m = data.match(styleRegex);
@@ -1,10 +1,18 @@
1
1
  // custom.color will be provided {primary:'#2d3f3e....}
2
2
  export default function color(color, custom) {
3
+ var _a, _b;
3
4
  // check for alpha
4
5
  let alpha = null;
5
- if (color.match(/\/[1-9]$/)) {
6
- alpha = "0." + color.slice(-1);
7
- color = color.replace(/\/[1-9]$/, '');
6
+ // const match=color.match(/\/([0][.][1-9][0-9]?$)/);
7
+ const match = color.match(/\/(0\.[0-9][0-9]?|1(\.0+)?)$/);
8
+ const matchPercentage = color.match(/\/(100%|[1-9]?[0-9]%)$/);
9
+ if (match) {
10
+ alpha = (_a = match[1]) !== null && _a !== void 0 ? _a : null;
11
+ color = color.replace(match[0], '');
12
+ }
13
+ else if (matchPercentage) {
14
+ alpha = (_b = matchPercentage[1]) !== null && _b !== void 0 ? _b : null;
15
+ color = color.replace(matchPercentage[0], '');
8
16
  }
9
17
  // ----check for css variables
10
18
  if (color.match(/^--[a-zA-Z]/)) {
@@ -16,7 +24,7 @@ export default function color(color, custom) {
16
24
  color = color.replace(/^[-]/, '');
17
25
  // check if is a raw function
18
26
  if (color.match(/^(rgb|hsl|hsla|rgba|hwb|hwba|lab|oklab|lch|oklch)[(]/)) {
19
- return color;
27
+ return color.replace(/--([\w][\w-]*)/g, 'var(--$1)');
20
28
  }
21
29
  // custom-color
22
30
  if (custom.hasOwnProperty('colors') && typeof custom.colors === 'object') {
@@ -17,10 +17,13 @@ export default function timingFunction(data, custom) {
17
17
  'step-end': 'step-end',
18
18
  };
19
19
  let result = '';
20
- const test1 = /(cubic-bezier|cb)(([-_][-]?[0-9][d]?[0-9]?){4})/;
20
+ const test1 = /(cubic-bezier|cb)(([-_][-]?[0-9][d.]?[0-9]?){4})/;
21
21
  const test2 = /(steps|s)[-_]([0-9]+)[-]((jump)?[-]?(start|end|none|both))/;
22
22
  data.split('__').forEach((e) => {
23
- if (test1.test(e)) {
23
+ if (/\b(cubic-bezier|cb)\((-?\d*\.?\d+),(-?\d*\.?\d+),(-?\d*\.?\d+),(-?\d*\.?\d+)\)/.test(e)) {
24
+ result = result + e.replace('cb(', 'cubic-bezier(') + ", ";
25
+ }
26
+ else if (test1.test(e)) {
24
27
  result = result + e.replace(test1, (e, f, g) => 'cubic-bezier' + "(" + g.replace(/-/, "").replace(/--/g, '-Minus').replace(/-/g, ", ").replace(/d/g, ".").replace(/Minus/g, '-') + ")") + ", ";
25
28
  }
26
29
  else if (test2.test(e)) {
@@ -1,4 +1,6 @@
1
1
  export default function transition(data) {
2
+ if (data.match(/^-?\d*\.?\d+(ms|s)$/))
3
+ return data.replace(/^-/, '');
2
4
  let holder = '';
3
5
  data
4
6
  .replace(/^-/, '')
package/lib/config.d.ts CHANGED
@@ -18,6 +18,7 @@ declare const config: {
18
18
  remUnitsNegative: string[];
19
19
  widths: string[];
20
20
  modes: string[];
21
+ layers: string[];
21
22
  makeStaticGlobalValues?: (a: string, b: string) => string[];
22
23
  };
23
24
  export default config;
package/lib/config.js CHANGED
@@ -2,6 +2,7 @@ const config = {
2
2
  prefix: null,
3
3
  useColon: false,
4
4
  ignore: [],
5
+ layers: ['reset', 'base', 'theme', 'components', 'utilities', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'],
5
6
  useExtractorFunction: false, // (?<=x(`|\(['"]))([\s\w-\(\)]+)[^`"']
6
7
  matchExtractorFunction: new RegExp('(?:' + 'x|@' + ')' + "[\\s*]?(`|\\([" + `"'])` + "([^)`]+)" + "(`|" + `["']` + "\\))"),
7
8
  useCSSModule: false,
@@ -13,7 +14,8 @@ const config = {
13
14
  matchRegExpWithColonKeyFrame: /[\s](?:(keyframes[-_:][\w-]+))=[\s*]?(?:["']\W+\s*(?:\w+)\()?["']([^'"]+)['"]/,
14
15
  createExtractorRegex: (fname) => new RegExp('(?:' + fname + ')' + "[\\s*]?(`|\\([" + `"'])` + "([^'`" + '"]+)' + "(`|" + `["']` + "\\))"),
15
16
  createCSSModuleRegex: (fname) => new RegExp("(?:" + fname + ")\\[[`'" + '"]([^`"' + "']+)(?:[`'" + '"]\\])'),
16
- globalValues: ['initial:ini', 'inherit:in', 'unset:un', 'revert:re', 'revert-layer:rl'],
17
+ // globalValues:['initial:ini','inherit:in','unset:un', 'revert:re','revert-layer:rl'],
18
+ globalValues: ['initial', 'inherit', 'unset', 'revert', 'revert-layer'],
17
19
  // makeStaticGlobalValues:(property:string,alias?:string)=>{
18
20
  // },
19
21
  styles: ['dotted:d', 'dashed:da', 'solid:s', 'double:db', 'groove:g', 'ridge:ri', 'inset:i', 'outset:o', 'none:n', 'hidden:h'],
@@ -441,7 +441,7 @@ const cssProps = {
441
441
  'border-boundary': {
442
442
  alias: '',
443
443
  type: 's',
444
- 'values': ['none:n', 'patent:p', 'display:d']
444
+ 'values': ['none:n', 'parent:p', 'display:d']
445
445
  },
446
446
  'border-collapse': {
447
447
  alias: '',
@@ -1139,6 +1139,16 @@ const cssProps = {
1139
1139
  // compiler:'',
1140
1140
  values: ['normal:nl', 'sub:s', 'super:su:s2'],
1141
1141
  },
1142
+ 'font-variation-settings': {
1143
+ alias: 'fvs',
1144
+ type: 'd',
1145
+ compiler: (value, custom) => {
1146
+ return value.replace(/^-/, '')
1147
+ .replace(/[_]/g, ' ')
1148
+ .replace(/([a-zA-Z]+)/g, '"$1"')
1149
+ .replace(/[-]/g, ',');
1150
+ }
1151
+ },
1142
1152
  'font-variant-emoji': {
1143
1153
  alias: 'fve',
1144
1154
  type: 's',
@@ -1147,8 +1157,8 @@ const cssProps = {
1147
1157
  },
1148
1158
  'font-weight': {
1149
1159
  alias: 'fw',
1150
- type: 's',
1151
- // compiler:'',
1160
+ type: 'd',
1161
+ compiler: (value, custom) => value.replace(/^-/, ''),
1152
1162
  values: ['bolder:b2:blr', 'lighter:l:ltr', '100:1:thin', '200:2:extra-light', '300:3:light', '400:4:normal:nl:regular', '500:5:medium', '600:6:semi-bold', '700:7:bold', '800:8:extra-bold', '900:9:black'],
1153
1163
  },
1154
1164
  'forced-color-adjust': {
@@ -2284,7 +2294,7 @@ const cssProps = {
2284
2294
  'scrollbar-width': {
2285
2295
  alias: 'sbw',
2286
2296
  type: 'd',
2287
- compiler: color,
2297
+ compiler: length,
2288
2298
  values: [''],
2289
2299
  },
2290
2300
  'shape-image-threshold': {
@@ -2747,10 +2757,10 @@ const cssProps = {
2747
2757
  alias: 'slj',
2748
2758
  type: 's',
2749
2759
  // compiler:'',
2750
- values: ['arcs', 'bevel', 'iter', 'miter-clip', 'round'],
2760
+ values: ['arcs', 'bevel', 'miter', 'miter-clip', 'round'],
2751
2761
  },
2752
2762
  // -------------webkit---
2753
- 'webkit-line-cramp': {
2763
+ 'webkit-line-clamp': {
2754
2764
  alias: '',
2755
2765
  property: '-webkit-line-clamp',
2756
2766
  type: 'd',
@@ -33,10 +33,93 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
33
33
  // 'lg':'border-radius: 6px; padding: 0px 24px;font-size: 18px;height: 48px;line-height: 26px;gap: 14px;',
34
34
  // },
35
35
  // },
36
- 'ButtonAR': {
36
+ 'InsetRA': {
37
37
  type: 'group',
38
38
  compiler: (value, custom) => {
39
+ const val = value.replace(/^\(/, '').replace(/\)$/, '').trim();
39
40
  const stm = `
41
+ --lightness-1000: 67.0121%;
42
+ --border-color-disabled: var(--gray-300,${color('grayRATheme300', custom)});
43
+ --border-color-hover: var(--gray-500,${color('grayRATheme500', custom)});
44
+ --invalid-color: oklch(from ${color('redRA', custom)} var(--lightness-1000) c h);
45
+ --gray-50: #ffffff;
46
+ --field-background: var(--gray-50);
47
+ --inset-background: var(--field-background);
48
+ --inset-border: var(--border-color);
49
+ --inset-border-size: 1px;
50
+ --inset-shadow-offset: 2px;
51
+ --inset-shadow-size: 4px;
52
+
53
+
54
+ background: var(--inset-background);
55
+ box-shadow:
56
+ inset 0 0 0 var(--inset-border-size) var(--inset-border),
57
+ /* border */ inset 0 var(--inset-shadow-offset) var(--inset-shadow-size) rgb(0 0 0 / 0.15),
58
+ /* inner shadow */ 0 1px 0 var(--gray-50); /* bottom specular highlight */
59
+ transition: box-shadow 200ms;
60
+ forced-color-adjust: none;
61
+
62
+ @media (prefers-color-scheme: dark) {
63
+ --inset-border: var(--gray-200,${color('grayRATheme200', custom)});
64
+ --border-color-hover: var(--gray-300,${color('grayRATheme300', custom)});
65
+ --inset-highlight: var(--gray-400,${color('grayRATheme400', custom)});
66
+ --inset-shadow-size: 6px;
67
+ --gray-50: oklch(22% 0 0);
68
+
69
+ box-shadow:
70
+ inset 0 calc(-1 * var(--inset-border-size)) 0 var(--inset-highlight),
71
+ /* bottom specular highlight */ inset 0 0 0 var(--inset-border-size) var(--inset-border),
72
+ /* border */ inset 0 1px var(--inset-shadow-size) rgb(0 0 0); /* inner shadow */
73
+ }
74
+
75
+ &:where([data-hovered], [data-pressed]) {
76
+ --inset-border: var(--border-color-hover);
77
+ }
78
+
79
+ @media (forced-colors: active) {
80
+ --inset-border: ButtonBorder;
81
+ box-shadow: inset 0 0 0 var(--inset-border-size) var(--inset-border);
82
+ }
83
+
84
+ &:where([data-invalid]) {
85
+ --inset-border: var(--invalid-color);
86
+ --inset-highlight: var(--inset-border);
87
+ }
88
+
89
+ &:where([data-disabled]) {
90
+ box-shadow: inset 0 0 0 1px var(--border-color-disabled);
91
+ }
92
+
93
+ &.track {
94
+ --inset-shadow-offset: 1px;
95
+ --inset-shadow-size: 3px;
96
+
97
+ @media (prefers-color-scheme: light) {
98
+ --inset-background: var(--gray-300,${color('grayRATheme300', custom)});
99
+ --inset-border: var(--gray-500,${color('grayRATheme500', custom)});
100
+ --inset-border-size: 0.5px;
101
+
102
+ }
103
+
104
+ @media (forced-colors: active) {
105
+ --field-background: Field;
106
+ --border-color-disabled: GrayText;
107
+ --border-color-hover: ButtonBorder;
108
+ --inset-background: Field;
109
+ --inset-border: ButtonBorder;
110
+ --inset-border-size: 1px;
111
+ --invalid-color: LinkText;
112
+ }
113
+ }
114
+ `;
115
+ return stm;
116
+ }
117
+ }, 'ButtonRA': {
118
+ type: 'group',
119
+ compiler: (value, custom) => {
120
+ const val = value.replace(/^\(/, '').replace(/\)$/, '').trim();
121
+ const stm = `
122
+ ${val ? '--accentColor:' + color(val, custom) + ';' : ''}
40
123
  --border-color: ${color('accentRA', custom)};
41
124
  --button-background: ${color('accentRATheme100', custom)};
42
125
  --button-gradient:${color('accentRATheme200', custom)};
@@ -181,6 +264,30 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
181
264
  // });
182
265
  return stm;
183
266
  }
267
+ }, 'x-color-scale-tint': {
268
+ type: 'group',
269
+ compiler: (value) => {
270
+ return `
271
+
272
+ --tint-100: oklch(from var(--tint) var(--lightness-100) var(--chroma-100) h);
273
+ --tint-200: oklch(from var(--tint) var(--lightness-200) var(--chroma-200) h);
274
+ --tint-300: oklch(from var(--tint) var(--lightness-300) var(--chroma-300) h);
275
+ --tint-400: oklch(from var(--tint) var(--lightness-400) var(--chroma-400) h);
276
+ --tint-500: oklch(from var(--tint) var(--lightness-500) var(--chroma-500) h);
277
+ --tint-600: oklch(from var(--tint) var(--lightness-600) var(--chroma-600) h);
278
+ --tint-700: oklch(from var(--tint) var(--lightness-700) var(--chroma-700) h);
279
+ --tint-800: oklch(from var(--tint) var(--lightness-800) var(--chroma-800) h);
280
+ --tint-900: oklch(from var(--tint) var(--lightness-900) var(--chroma-900) h);
281
+ --tint-1000: oklch(from var(--tint) var(--lightness-1000) var(--chroma-1000) h);
282
+ --tint-1100: oklch(from var(--tint) var(--lightness-1100) var(--chroma-1100) h);
283
+ --tint-1200: oklch(from var(--tint) var(--lightness-1200) var(--chroma-1200) h);
284
+ --tint-1300: oklch(from var(--tint) var(--lightness-1300) var(--chroma-1300) h);
285
+ --tint-1400: oklch(from var(--tint) var(--lightness-1400) var(--chroma-1400) h);
286
+ --tint-1500: oklch(from var(--tint) var(--lightness-1500) var(--chroma-1500) h);
287
+ --tint-1600: oklch(from var(--tint) var(--lightness-1600) var(--chroma-1600) h);
288
+
289
+ `;
290
+ }
184
291
  },
185
292
  // Button:{
186
293
  // type:'group',
@@ -229,6 +336,8 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
229
336
  'Size': {
230
337
  type: 'group',
231
338
  compiler: (value, custom) => {
339
+ if (!value.replace(/^\(|\)$/g, '').trim())
340
+ return;
232
341
  let stm = '';
233
342
  const order = ['width', 'height', 'border-radius'];
234
343
  const values = value.replace(/^\(|\)$/g, '').split(',');
@@ -248,6 +357,24 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
248
357
  });
249
358
  return stm;
250
359
  }
360
+ }, 'Font': {
361
+ type: 'group',
362
+ compiler: (value, custom) => {
363
+ let stm = '';
364
+ const order = ['font-size', 'font-weight', 'line-height', 'letter-spacing'];
365
+ const values = value.replace(/^\(|\)$/g, '').split(',');
366
+ values.forEach((e, i) => {
367
+ if (i < order.length && e) {
368
+ if (/--[a-zA-Z]/.test(e)) {
369
+ stm += `${order[i]}:var(${e});`;
370
+ }
371
+ else {
372
+ stm += `${order[i]}:${length(e)};`;
373
+ }
374
+ }
375
+ });
376
+ return stm;
377
+ }
251
378
  }, 'Color': {
252
379
  type: 'group',
253
380
  compiler: (value, custom) => {
@@ -16,7 +16,7 @@ export declare function keyframesStatement(name: string, timeLine: string, state
16
16
  ['make']: (a: string, b?: string | null, c?: boolean) => string;
17
17
  }): string;
18
18
  export declare function createCSSFileByFile(file: string, bool?: boolean): void;
19
- export declare function postify(file: string, plugin: any[], minify?: boolean): void;
19
+ export declare function postify(file: string, plugin: any[], minify?: boolean, sort?: "mobile-first" | "desktop-first"): void;
20
20
  export declare function writeStatementToFile(file: string, content: string, from?: string): void;
21
21
  export declare function initialize(configFile: {
22
22
  [key: string]: any;