@onereach/styles 3.1.0 → 3.1.1-beta.3176.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.
@@ -1,4 +1,14 @@
1
- const plugin = require('tailwindcss/plugin');
1
+ const { plugin: core } = require('./tailwind/plugins/core');
2
+ const { plugin: layout } = require('./tailwind/plugins/layout');
3
+ const { plugin: interactivity } = require('./tailwind/plugins/interactivity');
4
+ const { plugin: typography } = require('./tailwind/plugins/typography');
5
+ const { plugin: iconography } = require('./tailwind/plugins/iconography');
6
+
7
+ const { plugin: themePreset } = require('./tailwind/plugins/theme-preset');
8
+ const { plugin: themeForeground } = require('./tailwind/plugins/theme-foreground');
9
+ const { plugin: themeBackground } = require('./tailwind/plugins/theme-background');
10
+ const { plugin: themeBorder } = require('./tailwind/plugins/theme-border');
11
+ const { plugin: themeOutline } = require('./tailwind/plugins/theme-outline');
2
12
 
3
13
  const {
4
14
  parseSpacingTokens,
@@ -9,7 +19,7 @@ const {
9
19
  parseFontFamilyTokens,
10
20
  parseFontSizeTokens,
11
21
  parseFontWeightTokens,
12
- } = require('./tailwind-utils');
22
+ } = require('./tailwind/utils');
13
23
 
14
24
  const {
15
25
  SpacePatterns: spacingTokens,
@@ -186,899 +196,16 @@ module.exports = {
186
196
  },
187
197
 
188
198
  plugins: [
189
- // Core
190
- plugin(({ addVariant, addUtilities }) => {
191
- addVariant('enabled', '&:not([disabled])');
192
- addVariant('disabled', '&[disabled]');
193
-
194
- addVariant('read-write', '&:not([readonly])');
195
- addVariant('read-only', '&[readonly]');
196
-
197
- addVariant('valid', '&:not([invalid])');
198
- addVariant('invalid', '&[invalid]');
199
-
200
- addVariant('required', '&[required]');
201
- addVariant('optional', '&:not([required])');
202
-
203
- addVariant('checked', ['&[checked]', '&:checked']);
204
- addVariant('selected', ['&[selected]', '&:checked']);
205
- addVariant('activated', ['&[activated]']);
206
-
207
- addVariant('hover', [
208
- '&:not(.interactivity-none):hover',
209
- '&:not(.interactivity-none)[force-state="hover"]',
210
- ]);
211
-
212
- addVariant('focus', [
213
- '&:not(.interactivity-none):focus-visible',
214
- '&:not(.interactivity-none)[force-state="focus"]',
215
- ]);
216
-
217
- addVariant('focus-within', [
218
- '&:not(.interactivity-none):focus-within',
219
- '&:not(.interactivity-none)[force-state="focus-within"]',
220
- ]);
221
-
222
- addVariant('active', [
223
- '&:not(.interactivity-none):active',
224
- '&:not(.interactivity-none)[force-state="active"]',
225
- ]);
226
-
227
- addVariant('children', ['& > *']);
228
- addVariant('first-child', ['& > *:first-child']);
229
- addVariant('intermediate-child', ['& > *:not(:first-child):not(:last-child)']);
230
- addVariant('last-child', ['& > *:last-child']);
231
-
232
- addVariant('links', ['& :any-link']);
233
-
234
- // TODO: Remove when migration complete
235
- addUtilities({
236
- '.visually-hidden': {
237
- width: 0,
238
- height: 0,
239
- visibility: 'hidden',
240
- },
241
- });
242
- }),
243
-
244
- // Layout
245
- plugin(({ matchUtilities }) => {
246
- matchUtilities({
247
- 'layout': (value) => {
248
- const { prefix = '', direction } = /^(?:(?<prefix>inline-)\.\.)?(?<direction>.+)$/.exec(value).groups;
249
-
250
- return {
251
- display: prefix + 'flex',
252
-
253
- flexFlow: `${direction} nowrap`,
254
- flex: prefix === 'inline-' ? '0 0 auto' : undefined,
255
-
256
- alignContent: direction === 'row' ? 'center' : undefined,
257
- alignItems: direction === 'row' ? 'center' : undefined,
258
-
259
- maxWidth: prefix === 'inline-' ? '100%' : undefined,
260
- };
261
- },
262
- }, {
263
- values: {
264
- 'row': 'row',
265
- 'row-reverse': 'row-reverse',
266
-
267
- 'column': 'column',
268
- 'column-reverse': 'column-reverse',
269
-
270
- 'inline-row': 'inline-..row',
271
- 'inline-row-reverse': 'inline-..row-reverse',
272
-
273
- 'inline-column': 'inline-..column',
274
- 'inline-column-reverse': 'inline-..column-reverse',
275
- },
276
- });
277
- }),
278
-
279
- // Interactivity
280
- plugin(({ addUtilities }) => {
281
- addUtilities({
282
- '.interactivity-auto': {
283
- pointerEvents: 'auto',
284
- cursor: 'pointer',
285
-
286
- '&[disabled]': {
287
- pointerEvents: 'none',
288
- cursor: 'default',
289
- },
290
-
291
- userSelect: 'none',
292
- },
293
-
294
- '.interactivity-none': {
295
- pointerEvents: 'none',
296
- cursor: 'default',
297
-
298
- userSelect: 'none',
299
- },
300
- });
301
- }),
302
-
303
- // Typography
304
- plugin(({ matchUtilities, theme }) => {
305
- matchUtilities({
306
- 'typography': (value) => {
307
- const fontSizeConfig = theme('fontSize');
308
-
309
- const [fontSizeDesktop, optionsDesktop] = fontSizeConfig[value] ?? [];
310
- const [fontSizeMobile, optionsMobile] = fontSizeConfig[`mobile-${value}`] ?? [];
311
-
312
- return {
313
- fontFamily: theme(`fontFamily.mobile-${value}`) ?? theme(`fontFamily.${value}`),
314
- fontWeight: theme(`fontWeight.mobile-${value}`) ?? theme(`fontWeight.${value}`),
315
- fontSize: fontSizeMobile ?? fontSizeDesktop,
316
- lineHeight: optionsMobile?.lineHeight ?? optionsDesktop?.lineHeight,
317
-
318
- // Desktop
319
- [`@media (min-width: ${theme('screens.md')})`]: {
320
- fontFamily: theme(`fontFamily.${value}`),
321
- fontWeight: theme(`fontWeight.${value}`),
322
- fontSize: fontSizeDesktop,
323
- lineHeight: optionsDesktop?.lineHeight,
324
- },
325
- };
326
- },
327
- }, {
328
- values: {
329
- 'display-large': 'display-large',
330
- 'display-medium': 'display-medium',
331
- 'display-small': 'display-small',
332
- 'headline-1': 'headline-1',
333
- 'headline-2': 'headline-2',
334
- 'headline-3': 'headline-3',
335
- 'headline-4': 'headline-4',
336
- 'body-1-regular': 'body-1-regular',
337
- 'body-1-semibold': 'body-1-semibold',
338
- 'body-1-bold': 'body-1-bold',
339
- 'body-2-regular': 'body-2-regular',
340
- 'body-2-semibold': 'body-2-semibold',
341
- 'body-2-bold': 'body-2-bold',
342
- 'caption-regular': 'caption-regular',
343
- 'caption-semibold': 'caption-semibold',
344
- 'caption-bold': 'caption-bold',
345
- 'button': 'button',
346
-
347
- 'inherit': 'inherit',
348
- },
349
- });
350
- }),
351
-
352
- // Iconography
353
- plugin(({ matchUtilities }) => {
354
- matchUtilities({
355
- 'iconography': (value) => ({
356
- fontFamily: '"Material Symbols Outlined"',
357
- fontVariationSettings: value,
358
- }),
359
- }, {
360
- values: {
361
- 'outlined': '"opsz" 24, "wght" 400, "FILL" 0, "GRAD" 0',
362
- 'outlined-bold': '"opsz" 24, "wght" 700, "FILL" 0, "GRAD" 0',
363
-
364
- 'filled': '"opsz" 24, "wght" 400, "FILL" 1, "GRAD" 0',
365
- 'filled-bold': '"opsz" 24, "wght" 700, "FILL" 1, "GRAD" 0',
366
-
367
- 'inherit': 'inherit',
368
- },
369
- });
370
- }),
371
-
372
- // Theme
373
- plugin(({ matchUtilities, addUtilities, theme }) => {
374
- // Presets
375
- matchUtilities({
376
- 'theme-preset-1': (value) => {
377
- const [token, suffix = ''] = value.split('..');
378
-
379
- return {
380
- color: theme(`textColor.on-${token}` + suffix),
381
- backgroundColor: theme(`backgroundColor.${token}` + suffix),
382
-
383
- borderStyle: 'none',
384
- outlineStyle: 'none',
385
-
386
- '&[disabled]': {
387
- color: `${theme('textColor.on-disabled' + suffix)} !important`,
388
- backgroundColor: `${theme('backgroundColor.disabled' + suffix)} !important`,
389
- },
390
-
391
- '&:not(.interactivity-none)': {
392
- '&:active, &[force-state="active"]': {
393
- backgroundColor: theme(`backgroundColor.${token}-hover` + suffix),
394
- },
395
-
396
- // Desktop
397
- [`@media (min-width: ${theme('screens.md')})`]: {
398
- '&:hover, &[force-state="hover"]': {
399
- backgroundColor: theme(`backgroundColor.${token}-hover` + suffix),
400
- },
401
-
402
- '&:focus-visible, &[force-state="focus"]': {
403
- backgroundColor: theme(`backgroundColor.${token}-hover` + suffix),
404
- },
405
-
406
- '&:active, &[force-state="active"]': {
407
- backgroundColor: theme(`backgroundColor.${token}` + suffix),
408
- },
409
- },
410
- },
411
-
412
- transitionProperty: 'color, background-color, border-color, outline-color',
413
- transitionDuration: theme('transitionDuration.short'),
414
- transitionTimingFunction: theme('transitionTimingFunction.standard'),
415
- };
416
- },
417
-
418
- 'theme-preset-2': (value) => {
419
- const [token, suffix = ''] = value.split('..');
420
-
421
- return {
422
- color: theme(`textColor.${token}` + suffix),
423
- backgroundColor: theme(`backgroundColor.${token}-opacity-0-08` + suffix),
424
-
425
- borderStyle: 'none',
426
- outlineStyle: 'none',
427
-
428
- '&[disabled]': {
429
- color: `${theme('textColor.on-disabled' + suffix)} !important`,
430
- backgroundColor: `${theme('backgroundColor.disabled' + suffix)} !important`,
431
- },
432
-
433
- '&:not(.interactivity-none)': {
434
- '&:active, &[force-state="active"]': {
435
- backgroundColor: theme(`backgroundColor.${token}-opacity-0-12` + suffix),
436
- },
437
-
438
- // Desktop
439
- [`@media (min-width: ${theme('screens.md')})`]: {
440
- '&:hover, &[force-state="hover"]': {
441
- backgroundColor: theme(`backgroundColor.${token}-opacity-0-12` + suffix),
442
- },
443
-
444
- '&:focus-visible, &[force-state="focus"]': {
445
- backgroundColor: theme(`backgroundColor.${token}-opacity-0-12` + suffix),
446
- },
447
-
448
- '&:active, &[force-state="active"]': {
449
- backgroundColor: theme(`backgroundColor.${token}-opacity-0-16` + suffix),
450
- },
451
- },
452
- },
453
-
454
- transitionProperty: 'color, background-color, border-color, outline-color',
455
- transitionDuration: theme('transitionDuration.short'),
456
- transitionTimingFunction: theme('transitionTimingFunction.standard'),
457
- };
458
- },
459
-
460
- 'theme-preset-3': (value) => {
461
- const [token, suffix = ''] = value.split('..');
462
-
463
- return {
464
- color: theme(`textColor.${token}` + suffix),
465
- backgroundColor: 'transparent',
466
-
467
- borderStyle: 'none',
468
- outlineStyle: 'none',
469
-
470
- '&[disabled]': {
471
- color: `${theme('textColor.on-disabled' + suffix)} !important`,
472
- backgroundColor: 'transparent !important',
473
- },
474
-
475
- '&:not(.interactivity-none)': {
476
- '&:active, &[force-state="active"]': {
477
- backgroundColor: theme(`backgroundColor.${token}-opacity-0-08` + suffix),
478
- },
479
-
480
- // Desktop
481
- [`@media (min-width: ${theme('screens.md')})`]: {
482
- '&:hover, &[force-state="hover"]': {
483
- backgroundColor: theme(`backgroundColor.${token}-opacity-0-08` + suffix),
484
- },
485
-
486
- '&:focus-visible, &[force-state="focus"]': {
487
- backgroundColor: theme(`backgroundColor.${token}-opacity-0-08` + suffix),
488
- },
489
-
490
- '&:active, &[force-state="active"]': {
491
- backgroundColor: theme(`backgroundColor.${token}-opacity-0-16` + suffix),
492
- },
493
- },
494
- },
495
-
496
- transitionProperty: 'color, background-color, border-color, outline-color',
497
- transitionDuration: theme('transitionDuration.short'),
498
- transitionTimingFunction: theme('transitionTimingFunction.standard'),
499
- };
500
- },
501
-
502
- 'theme-preset-4': (value) => {
503
- const [token, suffix = ''] = value.split('..');
504
-
505
- return {
506
- color: theme(`textColor.${token}` + suffix),
507
- backgroundColor: 'transparent',
508
-
509
- borderStyle: 'none',
510
- outlineStyle: 'none',
511
-
512
- '&[disabled]': {
513
- color: `${theme('textColor.on-disabled' + suffix)} !important`,
514
- backgroundColor: 'transparent !important',
515
- },
516
-
517
- '&:not(.interactivity-none)': {
518
- '&:active, &[force-state="active"]': {
519
- color: theme(`textColor.${token}-hover` + suffix),
520
- },
521
-
522
- // Desktop
523
- [`@media (min-width: ${theme('screens.md')})`]: {
524
- '&:hover, &[force-state="hover"]': {
525
- color: theme(`textColor.${token}-hover` + suffix),
526
- },
527
-
528
- '&:focus-visible, &[force-state="focus"]': {
529
- color: theme(`textColor.${token}-hover` + suffix),
530
- },
531
-
532
- '&:active, &[force-state="active"]': {
533
- color: theme(`textColor.${token}` + suffix),
534
- },
535
- },
536
- },
537
-
538
- transitionProperty: 'color, background-color, border-color, outline-color',
539
- transitionDuration: theme('transitionDuration.short'),
540
- transitionTimingFunction: theme('transitionTimingFunction.standard'),
541
- };
542
- },
543
- }, {
544
- values: {
545
- 'primary': 'primary',
546
- 'primary-dark': 'primary..-dark',
547
-
548
- 'secondary': 'secondary',
549
- 'secondary-dark': 'secondary..-dark',
550
-
551
- 'tertiary': 'tertiary',
552
- 'tertiary-dark': 'tertiary..-dark',
553
-
554
- 'success': 'success',
555
- 'success-dark': 'success..-dark',
556
-
557
- 'warning': 'warning',
558
- 'warning-dark': 'warning..-dark',
559
-
560
- 'error': 'error',
561
- 'error-dark': 'error..-dark',
562
- },
563
- });
564
-
565
- // Foregrounds
566
- matchUtilities({
567
- 'theme-foreground': (value) => {
568
- const [token, suffix = ''] = value.split('..');
569
-
570
- return {
571
- color: theme(`textColor.${token}` + suffix, token),
572
-
573
- '&[disabled]': {
574
- color: `${theme('textColor.on-disabled' + suffix)} !important`,
575
- },
576
- };
577
- },
578
- }, {
579
- values: {
580
- 'base': 'white',
581
- 'base-dark': 'black',
582
-
583
- 'default': 'on-background',
584
- 'default-dark': 'on-background..-dark',
585
-
586
- 'disabled': 'on-disabled',
587
- 'disabled-dark': 'on-disabled..-dark',
588
-
589
- 'outline': 'outline',
590
- 'outline-dark': 'outline..-dark',
591
-
592
- 'outline-variant': 'outline-variant',
593
- 'outline-variant-dark': 'outline-variant..-dark',
594
-
595
- 'primary': 'primary',
596
- 'primary-dark': 'primary..-dark',
597
-
598
- 'secondary': 'secondary',
599
- 'secondary-dark': 'secondary..-dark',
600
-
601
- 'tertiary': 'tertiary',
602
- 'tertiary-dark': 'tertiary..-dark',
603
-
604
- 'success': 'success',
605
- 'success-dark': 'success..-dark',
606
-
607
- 'warning': 'warning',
608
- 'warning-dark': 'warning..-dark',
609
-
610
- 'error': 'error',
611
- 'error-dark': 'error..-dark',
612
-
613
- 'primary-hover': 'primary-hover',
614
- 'primary-hover-dark': 'primary-hover..-dark',
615
-
616
- // 'secondary-hover': 'secondary-hover',
617
- // 'secondary-hover-dark': 'secondary-hover..-dark',
618
-
619
- // 'tertiary-hover': 'tertiary-hover',
620
- // 'tertiary-hover-dark': 'tertiary-hover..-dark',
621
-
622
- 'success-hover': 'success-hover',
623
- 'success-hover-dark': 'success-hover..-dark',
624
-
625
- 'warning-hover': 'warning-hover',
626
- 'warning-hover-dark': 'warning-hover..-dark',
627
-
628
- 'error-hover': 'error-hover',
629
- 'error-hover-dark': 'error-hover..-dark',
630
-
631
- 'primary-inverse': 'primary-inverse',
632
- 'primary-inverse-dark': 'primary-inverse..-dark',
633
-
634
- // 'secondary-inverse': 'secondary-inverse',
635
- // 'secondary-inverse-dark': 'secondary-inverse..-dark',
636
-
637
- // 'tertiary-inverse': 'tertiary-inverse',
638
- // 'tertiary-inverse-dark': 'tertiary-inverse..-dark',
639
-
640
- // 'success-inverse': 'success-inverse',
641
- // 'success-inverse-dark': 'success-inverse..-dark',
642
-
643
- // 'warning-inverse': 'warning-inverse',
644
- // 'warning-inverse-dark': 'warning-inverse..-dark',
645
-
646
- // 'error-inverse': 'error-inverse',
647
- // 'error-inverse-dark': 'error-inverse..-dark',
648
-
649
- 'on-primary': 'on-primary',
650
- 'on-primary-dark': 'on-primary..-dark',
651
-
652
- 'on-secondary': 'on-secondary',
653
- 'on-secondary-dark': 'on-secondary..-dark',
654
-
655
- 'on-tertiary': 'on-tertiary',
656
- 'on-tertiary-dark': 'on-tertiary..-dark',
657
-
658
- 'on-success': 'on-success',
659
- 'on-success-dark': 'on-success..-dark',
660
-
661
- 'on-warning': 'on-warning',
662
- 'on-warning-dark': 'on-warning..-dark',
663
-
664
- 'on-error': 'on-error',
665
- 'on-error-dark': 'on-error..-dark',
666
-
667
- 'on-primary-container': 'on-primary-container',
668
- 'on-primary-container-dark': 'on-primary-container..-dark',
669
-
670
- 'on-secondary-container': 'on-secondary-container',
671
- 'on-secondary-container-dark': 'on-secondary-container..-dark',
672
-
673
- 'on-tertiary-container': 'on-tertiary-container',
674
- 'on-tertiary-container-dark': 'on-tertiary-container..-dark',
675
-
676
- 'on-success-container': 'on-success-container',
677
- 'on-success-container-dark': 'on-success-container..-dark',
678
-
679
- 'on-warning-container': 'on-warning-container',
680
- 'on-warning-container-dark': 'on-warning-container..-dark',
681
-
682
- 'on-error-container': 'on-error-container',
683
- 'on-error-container-dark': 'on-error-container..-dark',
684
-
685
- 'on-surface': 'on-surface',
686
- 'on-surface-dark': 'on-surface..-dark',
687
-
688
- 'on-surface-variant': 'on-surface-variant',
689
- 'on-surface-variant-dark': 'on-surface-variant..-dark',
690
-
691
- 'on-surface-inverse': 'inverse-on-surface',
692
- 'on-surface-inverse-dark': 'inverse-on-surface..-dark',
693
-
694
- 'transparent': 'transparent',
695
- 'transparent-dark': 'transparent..-dark',
696
-
697
- 'current': 'current',
698
- 'current-dark': 'current..-dark',
699
-
700
- 'inherit': 'inherit',
701
- 'inherit-dark': 'inherit..-dark',
702
- },
703
- });
704
-
705
- // Backgrounds
706
- matchUtilities({
707
- 'theme-background': (value) => {
708
- const [token, suffix = ''] = value.split('..');
709
-
710
- return {
711
- backgroundColor: theme(`backgroundColor.${token}` + suffix, token),
712
-
713
- '&[disabled]': {
714
- backgroundColor: `${theme('backgroundColor.disabled' + suffix)} !important`,
715
- },
716
- };
717
- },
718
- }, {
719
- values: {
720
- 'base': 'white',
721
- 'base-dark': 'black',
722
-
723
- 'default': 'background',
724
- 'default-dark': 'background..-dark',
725
-
726
- 'disabled': 'disabled',
727
- 'disabled-dark': 'disabled..-dark',
728
-
729
- 'overlay': 'overlay',
730
- 'overlay-dark': 'overlay..-dark',
731
-
732
- 'primary': 'primary',
733
- 'primary-dark': 'primary..-dark',
734
-
735
- 'secondary': 'secondary',
736
- 'secondary-dark': 'secondary..-dark',
737
-
738
- 'tertiary': 'tertiary',
739
- 'tertiary-dark': 'tertiary..-dark',
740
-
741
- 'success': 'success',
742
- 'success-dark': 'success..-dark',
743
-
744
- 'warning': 'warning',
745
- 'warning-dark': 'warning..-dark',
746
-
747
- 'error': 'error',
748
- 'error-dark': 'error..-dark',
749
-
750
- 'primary-hover': 'primary-hover',
751
- 'primary-hover-dark': 'primary-hover..-dark',
752
-
753
- // 'secondary-hover': 'secondary-hover',
754
- // 'secondary-hover-dark': 'secondary-hover..-dark',
755
-
756
- // 'tertiary-hover': 'tertiary-hover',
757
- // 'tertiary-hover-dark': 'tertiary-hover..-dark',
758
-
759
- 'success-hover': 'success-hover',
760
- 'success-hover-dark': 'success-hover..-dark',
761
-
762
- 'warning-hover': 'warning-hover',
763
- 'warning-hover-dark': 'warning-hover..-dark',
764
-
765
- 'error-hover': 'error-hover',
766
- 'error-hover-dark': 'error-hover..-dark',
767
-
768
- 'primary-translucent': 'primary-opacity-0-08',
769
- 'primary-translucent-dark': 'primary-opacity-0-08..-dark',
770
-
771
- // 'secondary-translucent': 'secondary-opacity-0-08',
772
- // 'secondary-translucent-dark': 'secondary-opacity-0-08..-dark',
773
-
774
- // 'tertiary-translucent': 'tertiary-opacity-0-08',
775
- // 'tertiary-translucent-dark': 'tertiary-opacity-0-08..-dark',
776
-
777
- 'success-translucent': 'success-opacity-0-08',
778
- 'success-translucent-dark': 'success-opacity-0-08..-dark',
779
-
780
- 'warning-translucent': 'warning-opacity-0-08',
781
- 'warning-translucent-dark': 'warning-opacity-0-08..-dark',
782
-
783
- 'error-translucent': 'error-opacity-0-08',
784
- 'error-translucent-dark': 'error-opacity-0-08..-dark',
785
-
786
- 'primary-container': 'primary-container',
787
- 'primary-container-dark': 'primary-container..-dark',
788
-
789
- 'secondary-container': 'secondary-container',
790
- 'secondary-container-dark': 'secondary-container..-dark',
791
-
792
- 'tertiary-container': 'tertiary-container',
793
- 'tertiary-container-dark': 'tertiary-container..-dark',
794
-
795
- 'success-container': 'success-container',
796
- 'success-container-dark': 'success-container..-dark',
797
-
798
- 'warning-container': 'warning-container',
799
- 'warning-container-dark': 'warning-container..-dark',
800
-
801
- 'error-container': 'error-container',
802
- 'error-container-dark': 'error-container..-dark',
803
-
804
- 'surface': 'surface',
805
- 'surface-dark': 'surface..-dark',
806
-
807
- 'surface-1': 'surface-1',
808
- 'surface-1-dark': 'surface-1..-dark',
809
-
810
- 'surface-2': 'surface-2',
811
- 'surface-2-dark': 'surface-2..-dark',
812
-
813
- 'surface-3': 'surface-3',
814
- 'surface-3-dark': 'surface-3..-dark',
815
-
816
- 'surface-4': 'surface-4',
817
- 'surface-4-dark': 'surface-4..-dark',
818
-
819
- 'surface-5': 'surface-5',
820
- 'surface-5-dark': 'surface-5..-dark',
821
-
822
- 'surface-variant': 'surface-variant',
823
- 'surface-variant-dark': 'surface-variant..-dark',
824
-
825
- 'surface-inverse': 'inverse-surface',
826
- 'surface-inverse-dark': 'inverse-surface..-dark',
827
-
828
- 'transparent': 'transparent',
829
- 'transparent-dark': 'transparent..-dark',
830
-
831
- 'current': 'current',
832
- 'current-dark': 'current..-dark',
833
-
834
- 'inherit': 'inherit',
835
- 'inherit-dark': 'inherit..-dark',
836
- },
837
- });
838
-
839
- // Borders
840
- matchUtilities({
841
- 'theme-border-1': (value) => {
842
- const [token, suffix = ''] = value.split('..');
843
-
844
- return {
845
- borderWidth: theme('borderWidth.1'),
846
- borderStyle: 'solid',
847
- borderColor: theme(`borderColor.${token}` + suffix, token),
848
-
849
- '&[disabled]': {
850
- borderColor: `${theme('borderColor.disabled' + suffix)} !important`,
851
- },
852
- };
853
- },
854
- }, {
855
- values: {
856
- 'outline': 'outline',
857
- 'outline-dark': 'outline..-dark',
858
-
859
- 'outline-variant': 'outline-variant',
860
- 'outline-variant-dark': 'outline-variant..-dark',
861
-
862
- 'primary': 'primary',
863
- 'primary-dark': 'primary..-dark',
864
-
865
- 'secondary': 'secondary',
866
- 'secondary-dark': 'secondary..-dark',
867
-
868
- 'tertiary': 'tertiary',
869
- 'tertiary-dark': 'tertiary..-dark',
870
-
871
- 'success': 'success',
872
- 'success-dark': 'success..-dark',
873
-
874
- 'warning': 'warning',
875
- 'warning-dark': 'warning..-dark',
876
-
877
- 'error': 'error',
878
- 'error-dark': 'error..-dark',
879
-
880
- 'primary-translucent': 'primary-opacity-0-16',
881
- 'primary-translucent-dark': 'primary-opacity-0-16..-dark',
882
-
883
- // 'secondary-translucent': 'secondary-opacity-0-16',
884
- // 'secondary-translucent-dark': 'secondary-opacity-0-16..-dark',
885
-
886
- // 'tertiary-translucent': 'tertiary-opacity-0-16',
887
- // 'tertiary-translucent-dark': 'tertiary-opacity-0-16..-dark',
888
-
889
- 'success-translucent': 'success-opacity-0-16',
890
- 'success-translucent-dark': 'success-opacity-0-16..-dark',
891
-
892
- 'warning-translucent': 'warning-opacity-0-16',
893
- 'warning-translucent-dark': 'warning-opacity-0-16..-dark',
894
-
895
- 'error-translucent': 'error-opacity-0-16',
896
- 'error-translucent-dark': 'error-opacity-0-16..-dark',
897
-
898
- 'transparent': 'transparent',
899
- 'transparent-dark': 'transparent..-dark',
900
-
901
- 'current': 'current',
902
- 'current-dark': 'current..-dark',
903
-
904
- 'inherit': 'inherit',
905
- 'inherit-dark': 'inherit..-dark',
906
- },
907
- });
908
-
909
- matchUtilities({
910
- 'theme-border-2': (value) => {
911
- const [token, suffix = ''] = value.split('..');
912
-
913
- return {
914
- borderWidth: theme('borderWidth.2'),
915
- borderStyle: 'solid',
916
- borderColor: theme(`borderColor.${token}` + suffix, token),
917
-
918
- '&[disabled]': {
919
- borderColor: `${theme('borderColor.disabled' + suffix)} !important`,
920
- },
921
- };
922
- },
923
- }, {
924
- values: {
925
- 'outline': 'outline',
926
- 'outline-dark': 'outline..-dark',
927
-
928
- 'outline-variant': 'outline-variant',
929
- 'outline-variant-dark': 'outline-variant..-dark',
930
-
931
- 'primary': 'primary',
932
- 'primary-dark': 'primary..-dark',
933
-
934
- 'secondary': 'secondary',
935
- 'secondary-dark': 'secondary..-dark',
936
-
937
- 'tertiary': 'tertiary',
938
- 'tertiary-dark': 'tertiary..-dark',
939
-
940
- 'success': 'success',
941
- 'success-dark': 'success..-dark',
942
-
943
- 'warning': 'warning',
944
- 'warning-dark': 'warning..-dark',
945
-
946
- 'error': 'error',
947
- 'error-dark': 'error..-dark',
948
-
949
- 'primary-translucent': 'primary-opacity-0-16',
950
- 'primary-translucent-dark': 'primary-opacity-0-16..-dark',
951
-
952
- // 'secondary-translucent': 'secondary-opacity-0-16',
953
- // 'secondary-translucent-dark': 'secondary-opacity-0-16..-dark',
954
-
955
- // 'tertiary-translucent': 'tertiary-opacity-0-16',
956
- // 'tertiary-translucent-dark': 'tertiary-opacity-0-16..-dark',
957
-
958
- 'success-translucent': 'success-opacity-0-16',
959
- 'success-translucent-dark': 'success-opacity-0-16..-dark',
960
-
961
- 'warning-translucent': 'warning-opacity-0-16',
962
- 'warning-translucent-dark': 'warning-opacity-0-16..-dark',
963
-
964
- 'error-translucent': 'error-opacity-0-16',
965
- 'error-translucent-dark': 'error-opacity-0-16..-dark',
966
-
967
- 'transparent': 'transparent',
968
- 'transparent-dark': 'transparent..-dark',
969
-
970
- 'current': 'current',
971
- 'current-dark': 'current..-dark',
972
-
973
- 'inherit': 'inherit',
974
- 'inherit-dark': 'inherit..-dark',
975
- },
976
- });
977
-
978
- addUtilities({
979
- '.theme-border-overline': {
980
- borderStyle: 'none !important',
981
- borderTopStyle: 'solid !important',
982
- },
983
-
984
- '.theme-border-underline': {
985
- borderStyle: 'none !important',
986
- borderBottomStyle: 'solid !important',
987
- },
988
- });
989
-
990
- // Outlines
991
- matchUtilities({
992
- 'theme-outline-1': (value) => {
993
- const [token, suffix = ''] = value.split('..');
994
-
995
- return {
996
- // In Safari outline doesn't follow current border-radius
997
- // It seems like this is already fixed in Safari Technology Preview (Release 157)
998
- // Stay tuned for Safari updates
999
- boxShadow: `0 0 0 1px ${theme(`outlineColor.${token}-opacity-0-16` + suffix, token)}`,
1000
- // outlineOffset: '0',
1001
- // outlineWidth: theme('outlineWidth.2'),
1002
- // outlineStyle: 'solid',
1003
- // outlineColor: theme(`outlineColor.${token}-opacity-0-16` + suffix, token),
1004
- };
1005
- },
1006
- }, {
1007
- values: {
1008
- 'primary': 'primary',
1009
- 'primary-dark': 'primary..-dark',
1010
-
1011
- 'secondary': 'secondary',
1012
- 'secondary-dark': 'secondary..-dark',
1013
-
1014
- 'tertiary': 'tertiary',
1015
- 'tertiary-dark': 'tertiary..-dark',
1016
-
1017
- 'success': 'success',
1018
- 'success-dark': 'success..-dark',
1019
-
1020
- 'warning': 'warning',
1021
- 'warning-dark': 'warning..-dark',
1022
-
1023
- 'error': 'error',
1024
- 'error-dark': 'error..-dark',
1025
-
1026
- 'transparent': 'transparent',
1027
- 'transparent-dark': 'transparent..-dark',
1028
-
1029
- 'current': 'current',
1030
- 'current-dark': 'current..-dark',
1031
-
1032
- 'inherit': 'inherit',
1033
- 'inherit-dark': 'inherit..-dark',
1034
- },
1035
- });
1036
-
1037
- matchUtilities({
1038
- 'theme-outline-2': (value) => {
1039
- const [token, suffix = ''] = value.split('..');
1040
-
1041
- return {
1042
- // In Safari outline doesn't follow current border-radius
1043
- // It seems like this is already fixed in Safari Technology Preview (Release 157)
1044
- // Stay tuned for Safari updates
1045
- boxShadow: `0 0 0 2px ${theme(`outlineColor.${token}-opacity-0-16` + suffix, token)}`,
1046
- // outlineOffset: '0',
1047
- // outlineWidth: theme('outlineWidth.2'),
1048
- // outlineStyle: 'solid',
1049
- // outlineColor: theme(`outlineColor.${token}-opacity-0-16` + suffix, token),
1050
- };
1051
- },
1052
- }, {
1053
- values: {
1054
- 'primary': 'primary',
1055
- 'primary-dark': 'primary..-dark',
1056
-
1057
- 'secondary': 'secondary',
1058
- 'secondary-dark': 'secondary..-dark',
1059
-
1060
- 'tertiary': 'tertiary',
1061
- 'tertiary-dark': 'tertiary..-dark',
1062
-
1063
- 'success': 'success',
1064
- 'success-dark': 'success..-dark',
1065
-
1066
- 'warning': 'warning',
1067
- 'warning-dark': 'warning..-dark',
1068
-
1069
- 'error': 'error',
1070
- 'error-dark': 'error..-dark',
1071
-
1072
- 'transparent': 'transparent',
1073
- 'transparent-dark': 'transparent..-dark',
1074
-
1075
- 'current': 'current',
1076
- 'current-dark': 'current..-dark',
1077
-
1078
- 'inherit': 'inherit',
1079
- 'inherit-dark': 'inherit..-dark',
1080
- },
1081
- });
1082
- }),
199
+ core,
200
+ layout,
201
+ interactivity,
202
+ typography,
203
+ iconography,
204
+
205
+ themePreset,
206
+ themeForeground,
207
+ themeBackground,
208
+ themeBorder,
209
+ themeOutline,
1083
210
  ],
1084
211
  };