tailwindcss 3.0.0-alpha.1 → 3.0.2

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.
Files changed (73) hide show
  1. package/colors.js +2 -1
  2. package/defaultConfig.js +2 -1
  3. package/defaultTheme.js +2 -1
  4. package/lib/cli.js +39 -35
  5. package/lib/constants.js +1 -1
  6. package/lib/corePluginList.js +10 -1
  7. package/lib/corePlugins.js +393 -259
  8. package/lib/css/preflight.css +14 -1
  9. package/lib/featureFlags.js +12 -7
  10. package/lib/lib/collapseDuplicateDeclarations.js +29 -0
  11. package/lib/lib/detectNesting.js +17 -2
  12. package/lib/lib/evaluateTailwindFunctions.js +9 -5
  13. package/lib/lib/expandApplyAtRules.js +26 -9
  14. package/lib/lib/expandTailwindAtRules.js +4 -1
  15. package/lib/lib/generateRules.js +151 -19
  16. package/lib/lib/resolveDefaultsAtRules.js +67 -56
  17. package/lib/lib/setupContextUtils.js +80 -80
  18. package/lib/lib/setupWatchingContext.js +5 -1
  19. package/lib/lib/sharedState.js +2 -2
  20. package/lib/lib/substituteScreenAtRules.js +7 -4
  21. package/lib/processTailwindFeatures.js +4 -0
  22. package/lib/util/buildMediaQuery.js +13 -24
  23. package/lib/util/createUtilityPlugin.js +5 -5
  24. package/lib/util/dataTypes.js +38 -7
  25. package/lib/util/formatVariantSelector.js +186 -0
  26. package/lib/util/isValidArbitraryValue.js +64 -0
  27. package/lib/util/nameClass.js +2 -1
  28. package/lib/util/negateValue.js +3 -1
  29. package/lib/util/normalizeConfig.js +22 -8
  30. package/lib/util/normalizeScreens.js +61 -0
  31. package/lib/util/parseBoxShadowValue.js +77 -0
  32. package/lib/util/pluginUtils.js +62 -158
  33. package/lib/util/prefixSelector.js +1 -3
  34. package/lib/util/resolveConfig.js +17 -13
  35. package/lib/util/transformThemeValue.js +23 -13
  36. package/package.json +15 -15
  37. package/peers/index.js +4456 -5450
  38. package/plugin.js +2 -1
  39. package/resolveConfig.js +2 -1
  40. package/src/.DS_Store +0 -0
  41. package/src/cli.js +9 -2
  42. package/src/corePluginList.js +1 -1
  43. package/src/corePlugins.js +392 -404
  44. package/src/css/preflight.css +14 -1
  45. package/src/featureFlags.js +14 -4
  46. package/src/lib/collapseDuplicateDeclarations.js +28 -0
  47. package/src/lib/detectNesting.js +22 -3
  48. package/src/lib/evaluateTailwindFunctions.js +5 -2
  49. package/src/lib/expandApplyAtRules.js +29 -2
  50. package/src/lib/expandTailwindAtRules.js +5 -2
  51. package/src/lib/generateRules.js +155 -11
  52. package/src/lib/resolveDefaultsAtRules.js +67 -50
  53. package/src/lib/setupContextUtils.js +77 -67
  54. package/src/lib/setupWatchingContext.js +7 -0
  55. package/src/lib/sharedState.js +1 -1
  56. package/src/lib/substituteScreenAtRules.js +6 -3
  57. package/src/processTailwindFeatures.js +5 -0
  58. package/src/util/buildMediaQuery.js +14 -18
  59. package/src/util/createUtilityPlugin.js +2 -2
  60. package/src/util/dataTypes.js +43 -11
  61. package/src/util/formatVariantSelector.js +196 -0
  62. package/src/util/isValidArbitraryValue.js +61 -0
  63. package/src/util/nameClass.js +2 -2
  64. package/src/util/negateValue.js +4 -2
  65. package/src/util/normalizeConfig.js +17 -1
  66. package/src/util/normalizeScreens.js +45 -0
  67. package/src/util/parseBoxShadowValue.js +71 -0
  68. package/src/util/pluginUtils.js +50 -146
  69. package/src/util/prefixSelector.js +1 -4
  70. package/src/util/resolveConfig.js +7 -1
  71. package/src/util/transformThemeValue.js +22 -7
  72. package/stubs/defaultConfig.stub.js +118 -58
  73. package/CHANGELOG.md +0 -1759
@@ -203,14 +203,15 @@ module.exports = {
203
203
  },
204
204
  boxShadow: {
205
205
  sm: '0 1px 2px 0 rgb(0 0 0 / 0.05)',
206
- DEFAULT: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06)',
207
- md: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06)',
208
- lg: '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05)',
209
- xl: '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04)',
206
+ DEFAULT: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)',
207
+ md: '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',
208
+ lg: '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',
209
+ xl: '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',
210
210
  '2xl': '0 25px 50px -12px rgb(0 0 0 / 0.25)',
211
- inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.06)',
211
+ inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 0.05)',
212
212
  none: 'none',
213
213
  },
214
+ boxShadowColor: ({ theme }) => theme('colors'),
214
215
  caretColor: ({ theme }) => theme('colors'),
215
216
  accentColor: ({ theme }) => ({
216
217
  ...theme('colors'),
@@ -238,6 +239,34 @@ module.exports = {
238
239
  move: 'move',
239
240
  help: 'help',
240
241
  'not-allowed': 'not-allowed',
242
+ none: 'none',
243
+ 'context-menu': 'context-menu',
244
+ progress: 'progress',
245
+ cell: 'cell',
246
+ crosshair: 'crosshair',
247
+ 'vertical-text': 'vertical-text',
248
+ alias: 'alias',
249
+ copy: 'copy',
250
+ 'no-drop': 'no-drop',
251
+ grab: 'grab',
252
+ grabbing: 'grabbing',
253
+ 'all-scroll': 'all-scroll',
254
+ 'col-resize': 'col-resize',
255
+ 'row-resize': 'row-resize',
256
+ 'n-resize': 'n-resize',
257
+ 'e-resize': 'e-resize',
258
+ 's-resize': 's-resize',
259
+ 'w-resize': 'w-resize',
260
+ 'ne-resize': 'ne-resize',
261
+ 'nw-resize': 'nw-resize',
262
+ 'se-resize': 'se-resize',
263
+ 'sw-resize': 'sw-resize',
264
+ 'ew-resize': 'ew-resize',
265
+ 'ns-resize': 'ns-resize',
266
+ 'nesw-resize': 'nesw-resize',
267
+ 'nwse-resize': 'nwse-resize',
268
+ 'zoom-in': 'zoom-in',
269
+ 'zoom-out': 'zoom-out',
241
270
  },
242
271
  divideColor: ({ theme }) => theme('borderColor'),
243
272
  divideOpacity: ({ theme }) => theme('borderOpacity'),
@@ -251,17 +280,12 @@ module.exports = {
251
280
  '2xl': '0 25px 25px rgb(0 0 0 / 0.15)',
252
281
  none: '0 0 #0000',
253
282
  },
254
- fill: { current: 'currentColor' },
283
+ fill: ({ theme }) => theme('colors'),
255
284
  grayscale: {
256
285
  0: '0',
257
286
  DEFAULT: '100%',
258
287
  },
259
288
  hueRotate: {
260
- '-180': '-180deg',
261
- '-90': '-90deg',
262
- '-60': '-60deg',
263
- '-30': '-30deg',
264
- '-15': '-15deg',
265
289
  0: '0deg',
266
290
  15: '15deg',
267
291
  30: '30deg',
@@ -279,6 +303,37 @@ module.exports = {
279
303
  initial: '0 1 auto',
280
304
  none: 'none',
281
305
  },
306
+ flexBasis: ({ theme }) => ({
307
+ auto: 'auto',
308
+ ...theme('spacing'),
309
+ '1/2': '50%',
310
+ '1/3': '33.333333%',
311
+ '2/3': '66.666667%',
312
+ '1/4': '25%',
313
+ '2/4': '50%',
314
+ '3/4': '75%',
315
+ '1/5': '20%',
316
+ '2/5': '40%',
317
+ '3/5': '60%',
318
+ '4/5': '80%',
319
+ '1/6': '16.666667%',
320
+ '2/6': '33.333333%',
321
+ '3/6': '50%',
322
+ '4/6': '66.666667%',
323
+ '5/6': '83.333333%',
324
+ '1/12': '8.333333%',
325
+ '2/12': '16.666667%',
326
+ '3/12': '25%',
327
+ '4/12': '33.333333%',
328
+ '5/12': '41.666667%',
329
+ '6/12': '50%',
330
+ '7/12': '58.333333%',
331
+ '8/12': '66.666667%',
332
+ '9/12': '75%',
333
+ '10/12': '83.333333%',
334
+ '11/12': '91.666667%',
335
+ full: '100%',
336
+ }),
282
337
  flexGrow: {
283
338
  0: '0',
284
339
  DEFAULT: '1',
@@ -478,11 +533,13 @@ module.exports = {
478
533
  '5/6': '83.333333%',
479
534
  full: '100%',
480
535
  screen: '100vh',
536
+ min: 'min-content',
537
+ max: 'max-content',
538
+ fit: 'fit-content',
481
539
  }),
482
- inset: ({ theme, negative }) => ({
540
+ inset: ({ theme }) => ({
483
541
  auto: 'auto',
484
542
  ...theme('spacing'),
485
- ...negative(theme('spacing')),
486
543
  '1/2': '50%',
487
544
  '1/3': '33.333333%',
488
545
  '2/3': '66.666667%',
@@ -490,13 +547,6 @@ module.exports = {
490
547
  '2/4': '50%',
491
548
  '3/4': '75%',
492
549
  full: '100%',
493
- '-1/2': '-50%',
494
- '-1/3': '-33.333333%',
495
- '-2/3': '-66.666667%',
496
- '-1/4': '-25%',
497
- '-2/4': '-50%',
498
- '-3/4': '-75%',
499
- '-full': '-100%',
500
550
  }),
501
551
  keyframes: {
502
552
  spin: {
@@ -555,15 +605,17 @@ module.exports = {
555
605
  disc: 'disc',
556
606
  decimal: 'decimal',
557
607
  },
558
- margin: ({ theme, negative }) => ({
608
+ margin: ({ theme }) => ({
559
609
  auto: 'auto',
560
610
  ...theme('spacing'),
561
- ...negative(theme('spacing')),
562
611
  }),
563
612
  maxHeight: ({ theme }) => ({
564
613
  ...theme('spacing'),
565
614
  full: '100%',
566
615
  screen: '100vh',
616
+ min: 'min-content',
617
+ max: 'max-content',
618
+ fit: 'fit-content',
567
619
  }),
568
620
  maxWidth: ({ theme, breakpoints }) => ({
569
621
  none: 'none',
@@ -582,6 +634,7 @@ module.exports = {
582
634
  full: '100%',
583
635
  min: 'min-content',
584
636
  max: 'max-content',
637
+ fit: 'fit-content',
585
638
  prose: '65ch',
586
639
  ...breakpoints(theme('screens')),
587
640
  }),
@@ -589,12 +642,16 @@ module.exports = {
589
642
  0: '0px',
590
643
  full: '100%',
591
644
  screen: '100vh',
645
+ min: 'min-content',
646
+ max: 'max-content',
647
+ fit: 'fit-content',
592
648
  },
593
649
  minWidth: {
594
650
  0: '0px',
595
651
  full: '100%',
596
652
  min: 'min-content',
597
653
  max: 'max-content',
654
+ fit: 'fit-content',
598
655
  },
599
656
  objectPosition: {
600
657
  bottom: 'bottom',
@@ -641,14 +698,24 @@ module.exports = {
641
698
  11: '11',
642
699
  12: '12',
643
700
  },
644
- outline: {
645
- none: ['2px solid transparent', '2px'],
646
- white: ['2px dotted white', '2px'],
647
- black: ['2px dotted black', '2px'],
648
- },
649
701
  padding: ({ theme }) => theme('spacing'),
650
702
  placeholderColor: ({ theme }) => theme('colors'),
651
703
  placeholderOpacity: ({ theme }) => theme('opacity'),
704
+ outlineColor: ({ theme }) => theme('colors'),
705
+ outlineOffset: {
706
+ 0: '0px',
707
+ 1: '1px',
708
+ 2: '2px',
709
+ 4: '4px',
710
+ 8: '8px',
711
+ },
712
+ outlineWidth: {
713
+ 0: '0px',
714
+ 1: '1px',
715
+ 2: '2px',
716
+ 4: '4px',
717
+ 8: '8px',
718
+ },
652
719
  ringColor: ({ theme }) => ({
653
720
  DEFAULT: theme('colors.blue.500', '#3b82f6'),
654
721
  ...theme('colors'),
@@ -674,14 +741,6 @@ module.exports = {
674
741
  8: '8px',
675
742
  },
676
743
  rotate: {
677
- '-180': '-180deg',
678
- '-90': '-90deg',
679
- '-45': '-45deg',
680
- '-12': '-12deg',
681
- '-6': '-6deg',
682
- '-3': '-3deg',
683
- '-2': '-2deg',
684
- '-1': '-1deg',
685
744
  0: '0deg',
686
745
  1: '1deg',
687
746
  2: '2deg',
@@ -711,9 +770,8 @@ module.exports = {
711
770
  125: '1.25',
712
771
  150: '1.5',
713
772
  },
714
- scrollMargin: ({ theme, negative }) => ({
773
+ scrollMargin: ({ theme }) => ({
715
774
  ...theme('spacing'),
716
- ...negative(theme('spacing')),
717
775
  }),
718
776
  scrollPadding: ({ theme }) => theme('spacing'),
719
777
  sepia: {
@@ -721,11 +779,6 @@ module.exports = {
721
779
  DEFAULT: '100%',
722
780
  },
723
781
  skew: {
724
- '-12': '-12deg',
725
- '-6': '-6deg',
726
- '-3': '-3deg',
727
- '-2': '-2deg',
728
- '-1': '-1deg',
729
782
  0: '0deg',
730
783
  1: '1deg',
731
784
  2: '2deg',
@@ -733,22 +786,36 @@ module.exports = {
733
786
  6: '6deg',
734
787
  12: '12deg',
735
788
  },
736
- space: ({ theme, negative }) => ({
789
+ space: ({ theme }) => ({
737
790
  ...theme('spacing'),
738
- ...negative(theme('spacing')),
739
791
  }),
740
- stroke: {
741
- current: 'currentColor',
742
- },
792
+ stroke: ({ theme }) => theme('colors'),
743
793
  strokeWidth: {
744
794
  0: '0',
745
795
  1: '1',
746
796
  2: '2',
747
797
  },
748
798
  textColor: ({ theme }) => theme('colors'),
749
- textIndent: ({ theme, negative }) => ({
799
+ textDecorationColor: ({ theme }) => theme('colors'),
800
+ textDecorationThickness: {
801
+ auto: 'auto',
802
+ 'from-font': 'from-font',
803
+ 0: '0px',
804
+ 1: '1px',
805
+ 2: '2px',
806
+ 4: '4px',
807
+ 8: '8px',
808
+ },
809
+ textUnderlineOffset: {
810
+ auto: 'auto',
811
+ 0: '0px',
812
+ 1: '1px',
813
+ 2: '2px',
814
+ 4: '4px',
815
+ 8: '8px',
816
+ },
817
+ textIndent: ({ theme }) => ({
750
818
  ...theme('spacing'),
751
- ...negative(theme('spacing')),
752
819
  }),
753
820
  textOpacity: ({ theme }) => theme('opacity'),
754
821
  transformOrigin: {
@@ -800,9 +867,8 @@ module.exports = {
800
867
  out: 'cubic-bezier(0, 0, 0.2, 1)',
801
868
  'in-out': 'cubic-bezier(0.4, 0, 0.2, 1)',
802
869
  },
803
- translate: ({ theme, negative }) => ({
870
+ translate: ({ theme }) => ({
804
871
  ...theme('spacing'),
805
- ...negative(theme('spacing')),
806
872
  '1/2': '50%',
807
873
  '1/3': '33.333333%',
808
874
  '2/3': '66.666667%',
@@ -810,13 +876,6 @@ module.exports = {
810
876
  '2/4': '50%',
811
877
  '3/4': '75%',
812
878
  full: '100%',
813
- '-1/2': '-50%',
814
- '-1/3': '-33.333333%',
815
- '-2/3': '-66.666667%',
816
- '-1/4': '-25%',
817
- '-2/4': '-50%',
818
- '-3/4': '-75%',
819
- '-full': '-100%',
820
879
  }),
821
880
  width: ({ theme }) => ({
822
881
  auto: 'auto',
@@ -851,6 +910,7 @@ module.exports = {
851
910
  screen: '100vw',
852
911
  min: 'min-content',
853
912
  max: 'max-content',
913
+ fit: 'fit-content',
854
914
  }),
855
915
  willChange: {
856
916
  auto: 'auto',