tailwindcss 3.0.0-alpha.2 → 3.0.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.
Files changed (42) hide show
  1. package/lib/cli.js +58 -58
  2. package/lib/corePluginList.js +3 -0
  3. package/lib/corePlugins.js +138 -65
  4. package/lib/css/preflight.css +2 -1
  5. package/lib/lib/detectNesting.js +17 -2
  6. package/lib/lib/evaluateTailwindFunctions.js +6 -2
  7. package/lib/lib/expandApplyAtRules.js +4 -4
  8. package/lib/lib/expandTailwindAtRules.js +2 -0
  9. package/lib/lib/generateRules.js +36 -0
  10. package/lib/lib/setupContextUtils.js +8 -65
  11. package/lib/lib/substituteScreenAtRules.js +7 -4
  12. package/lib/util/buildMediaQuery.js +13 -24
  13. package/lib/util/dataTypes.js +14 -3
  14. package/lib/util/formatVariantSelector.js +88 -4
  15. package/lib/util/isValidArbitraryValue.js +64 -0
  16. package/lib/util/nameClass.js +1 -0
  17. package/lib/util/normalizeScreens.js +61 -0
  18. package/lib/util/resolveConfig.js +8 -8
  19. package/package.json +10 -10
  20. package/peers/.svgo.yml +75 -0
  21. package/peers/index.js +3784 -3146
  22. package/peers/orders/concentric-css.json +299 -0
  23. package/peers/orders/smacss.json +299 -0
  24. package/peers/orders/source.json +295 -0
  25. package/src/.DS_Store +0 -0
  26. package/src/corePluginList.js +1 -1
  27. package/src/corePlugins.js +114 -60
  28. package/src/css/preflight.css +2 -1
  29. package/src/lib/detectNesting.js +22 -3
  30. package/src/lib/evaluateTailwindFunctions.js +5 -2
  31. package/src/lib/expandTailwindAtRules.js +2 -0
  32. package/src/lib/generateRules.js +34 -0
  33. package/src/lib/setupContextUtils.js +6 -58
  34. package/src/lib/substituteScreenAtRules.js +6 -3
  35. package/src/util/buildMediaQuery.js +14 -18
  36. package/src/util/dataTypes.js +11 -6
  37. package/src/util/formatVariantSelector.js +92 -1
  38. package/src/util/isValidArbitraryValue.js +61 -0
  39. package/src/util/nameClass.js +1 -1
  40. package/src/util/normalizeScreens.js +45 -0
  41. package/stubs/defaultConfig.stub.js +17 -0
  42. package/CHANGELOG.md +0 -1825
@@ -0,0 +1,295 @@
1
+ [
2
+ "align-content",
3
+ "align-items",
4
+ "align-self",
5
+ "all",
6
+ "animation",
7
+ "animation-delay",
8
+ "animation-direction",
9
+ "animation-duration",
10
+ "animation-fill-mode",
11
+ "animation-iteration-count",
12
+ "animation-name",
13
+ "animation-play-state",
14
+ "animation-timing-function",
15
+ "backdrop-filter",
16
+ "backface-visibility",
17
+ "background",
18
+ "background-attachment",
19
+ "background-blend-mode",
20
+ "background-clip",
21
+ "background-color",
22
+ "background-image",
23
+ "background-origin",
24
+ "background-position",
25
+ "background-position-x",
26
+ "background-position-y",
27
+ "background-repeat",
28
+ "background-size",
29
+ "block-size",
30
+ "border",
31
+ "border-block-end",
32
+ "border-block-end-color",
33
+ "border-block-end-style",
34
+ "border-block-end-width",
35
+ "border-block-start",
36
+ "border-block-start-color",
37
+ "border-block-start-style",
38
+ "border-block-start-width",
39
+ "border-bottom",
40
+ "border-bottom-color",
41
+ "border-bottom-left-radius",
42
+ "border-bottom-right-radius",
43
+ "border-bottom-style",
44
+ "border-bottom-width",
45
+ "border-collapse",
46
+ "border-color",
47
+ "border-image",
48
+ "border-image-outset",
49
+ "border-image-repeat",
50
+ "border-image-slice",
51
+ "border-image-source",
52
+ "border-image-width",
53
+ "border-inline-end",
54
+ "border-inline-end-color",
55
+ "border-inline-end-style",
56
+ "border-inline-end-width",
57
+ "border-inline-start",
58
+ "border-inline-start-color",
59
+ "border-inline-start-style",
60
+ "border-inline-start-width",
61
+ "border-left",
62
+ "border-left-color",
63
+ "border-left-style",
64
+ "border-left-width",
65
+ "border-radius",
66
+ "border-right",
67
+ "border-right-color",
68
+ "border-right-style",
69
+ "border-right-width",
70
+ "border-spacing",
71
+ "border-style",
72
+ "border-top",
73
+ "border-top-color",
74
+ "border-top-left-radius",
75
+ "border-top-right-radius",
76
+ "border-top-style",
77
+ "border-top-width",
78
+ "border-width",
79
+ "bottom",
80
+ "box-decoration-break",
81
+ "box-shadow",
82
+ "box-sizing",
83
+ "break-after",
84
+ "break-before",
85
+ "break-inside",
86
+ "caption-side",
87
+ "caret-color",
88
+ "clear",
89
+ "clip-path",
90
+ "color",
91
+ "column-count",
92
+ "column-fill",
93
+ "column-gap",
94
+ "column-rule",
95
+ "column-rule-color",
96
+ "column-rule-style",
97
+ "column-rule-width",
98
+ "column-span",
99
+ "column-width",
100
+ "columns",
101
+ "content",
102
+ "counter-increment",
103
+ "counter-reset",
104
+ "cursor",
105
+ "direction",
106
+ "display",
107
+ "empty-cells",
108
+ "filter",
109
+ "flex",
110
+ "flex-basis",
111
+ "flex-direction",
112
+ "flex-flow",
113
+ "flex-grow",
114
+ "flex-shrink",
115
+ "flex-wrap",
116
+ "float",
117
+ "font",
118
+ "font-family",
119
+ "font-feature-settings",
120
+ "font-kerning",
121
+ "font-language-override",
122
+ "font-optical-sizing",
123
+ "font-size",
124
+ "font-size-adjust",
125
+ "font-stretch",
126
+ "font-style",
127
+ "font-synthesis",
128
+ "font-variant",
129
+ "font-variant-alternates",
130
+ "font-variant-caps",
131
+ "font-variant-east-asian",
132
+ "font-variant-ligatures",
133
+ "font-variant-numeric",
134
+ "font-variant-position",
135
+ "font-weight",
136
+ "grid",
137
+ "grid-area",
138
+ "grid-auto-columns",
139
+ "grid-auto-flow",
140
+ "grid-auto-rows",
141
+ "grid-column",
142
+ "grid-column-end",
143
+ "grid-column-start",
144
+ "grid-row",
145
+ "grid-row-end",
146
+ "grid-row-start",
147
+ "grid-template",
148
+ "grid-template-areas",
149
+ "grid-template-columns",
150
+ "grid-template-rows",
151
+ "height",
152
+ "hyphens",
153
+ "image-orientation",
154
+ "image-rendering",
155
+ "initial-letter",
156
+ "initial-letter-align",
157
+ "inline-size",
158
+ "isolation",
159
+ "justify-content",
160
+ "justify-items",
161
+ "justify-self",
162
+ "left",
163
+ "letter-spacing",
164
+ "line-break",
165
+ "line-height",
166
+ "list-style",
167
+ "list-style-image",
168
+ "list-style-position",
169
+ "list-style-type",
170
+ "margin",
171
+ "margin-block-end",
172
+ "margin-block-start",
173
+ "margin-bottom",
174
+ "margin-inline-end",
175
+ "margin-inline-start",
176
+ "margin-left",
177
+ "margin-right",
178
+ "margin-top",
179
+ "mask",
180
+ "mask-clip",
181
+ "mask-image",
182
+ "mask-origin",
183
+ "mask-position",
184
+ "mask-repeat",
185
+ "mask-size",
186
+ "mask-type",
187
+ "max-block-size",
188
+ "max-height",
189
+ "max-inline-size",
190
+ "max-width",
191
+ "min-block-size",
192
+ "min-height",
193
+ "min-inline-size",
194
+ "min-width",
195
+ "mix-blend-mode",
196
+ "object-fit",
197
+ "object-position",
198
+ "offset-block-end",
199
+ "offset-block-start",
200
+ "offset-inline-end",
201
+ "offset-inline-start",
202
+ "opacity",
203
+ "order",
204
+ "orphans",
205
+ "outline",
206
+ "outline-color",
207
+ "outline-offset",
208
+ "outline-style",
209
+ "outline-width",
210
+ "overflow",
211
+ "overflow-wrap",
212
+ "overflow-x",
213
+ "overflow-y",
214
+ "padding",
215
+ "padding-block-end",
216
+ "padding-block-start",
217
+ "padding-bottom",
218
+ "padding-inline-end",
219
+ "padding-inline-start",
220
+ "padding-left",
221
+ "padding-right",
222
+ "padding-top",
223
+ "page-break-after",
224
+ "page-break-before",
225
+ "page-break-inside",
226
+ "perspective",
227
+ "perspective-origin",
228
+ "place-content",
229
+ "place-items",
230
+ "place-self",
231
+ "pointer-events",
232
+ "position",
233
+ "quotes",
234
+ "resize",
235
+ "right",
236
+ "rotate",
237
+ "ruby-align",
238
+ "ruby-position",
239
+ "scale",
240
+ "scroll-behavior",
241
+ "scroll-snap-coordinate",
242
+ "scroll-snap-destination",
243
+ "scroll-snap-type",
244
+ "shape-image-threshold",
245
+ "shape-margin",
246
+ "shape-outside",
247
+ "tab-size",
248
+ "table-layout",
249
+ "text-align",
250
+ "text-align-last",
251
+ "text-combine-upright",
252
+ "text-decoration",
253
+ "text-decoration-color",
254
+ "text-decoration-line",
255
+ "text-decoration-skip",
256
+ "text-decoration-skip-ink",
257
+ "text-decoration-style",
258
+ "text-emphasis",
259
+ "text-emphasis-color",
260
+ "text-emphasis-position",
261
+ "text-emphasis-style",
262
+ "text-indent",
263
+ "text-justify",
264
+ "text-orientation",
265
+ "text-overflow",
266
+ "text-rendering",
267
+ "text-shadow",
268
+ "text-size-adjust",
269
+ "text-transform",
270
+ "text-underline-position",
271
+ "top",
272
+ "touch-action",
273
+ "transform",
274
+ "transform-box",
275
+ "transform-origin",
276
+ "transform-style",
277
+ "transition",
278
+ "transition-delay",
279
+ "transition-duration",
280
+ "transition-property",
281
+ "transition-timing-function",
282
+ "unicode-bidi",
283
+ "unicode-range",
284
+ "user-select",
285
+ "vertical-align",
286
+ "visibility",
287
+ "white-space",
288
+ "widows",
289
+ "width",
290
+ "will-change",
291
+ "word-break",
292
+ "word-spacing",
293
+ "writing-mode",
294
+ "z-index"
295
+ ]
package/src/.DS_Store ADDED
Binary file
@@ -1 +1 @@
1
- export default ["preflight","container","accessibility","pointerEvents","visibility","position","inset","isolation","zIndex","order","gridColumn","gridColumnStart","gridColumnEnd","gridRow","gridRowStart","gridRowEnd","float","clear","margin","boxSizing","display","aspectRatio","height","maxHeight","minHeight","width","minWidth","maxWidth","flex","flexShrink","flexGrow","flexBasis","tableLayout","borderCollapse","transformOrigin","translate","rotate","skew","scale","transform","animation","cursor","touchAction","userSelect","resize","scrollSnapType","scrollSnapAlign","scrollSnapStop","scrollMargin","scrollPadding","listStylePosition","listStyleType","appearance","columns","breakBefore","breakInside","breakAfter","gridAutoColumns","gridAutoFlow","gridAutoRows","gridTemplateColumns","gridTemplateRows","flexDirection","flexWrap","placeContent","placeItems","alignContent","alignItems","justifyContent","justifyItems","gap","space","divideWidth","divideStyle","divideColor","divideOpacity","placeSelf","alignSelf","justifySelf","overflow","overscrollBehavior","scrollBehavior","textOverflow","whitespace","wordBreak","borderRadius","borderWidth","borderStyle","borderColor","borderOpacity","backgroundColor","backgroundOpacity","backgroundImage","gradientColorStops","boxDecorationBreak","backgroundSize","backgroundAttachment","backgroundClip","backgroundPosition","backgroundRepeat","backgroundOrigin","fill","stroke","strokeWidth","objectFit","objectPosition","padding","textAlign","textIndent","verticalAlign","fontFamily","fontSize","fontWeight","textTransform","fontStyle","fontVariantNumeric","lineHeight","letterSpacing","textColor","textOpacity","textDecoration","textDecorationColor","fontSmoothing","placeholderColor","placeholderOpacity","caretColor","accentColor","opacity","backgroundBlendMode","mixBlendMode","boxShadow","boxShadowColor","outlineStyle","outlineWidth","outlineOffset","outlineColor","ringWidth","ringColor","ringOpacity","ringOffsetWidth","ringOffsetColor","blur","brightness","contrast","dropShadow","grayscale","hueRotate","invert","saturate","sepia","filter","backdropBlur","backdropBrightness","backdropContrast","backdropGrayscale","backdropHueRotate","backdropInvert","backdropOpacity","backdropSaturate","backdropSepia","backdropFilter","transitionProperty","transitionDelay","transitionDuration","transitionTimingFunction","willChange","content"]
1
+ export default ["preflight","container","accessibility","pointerEvents","visibility","position","inset","isolation","zIndex","order","gridColumn","gridColumnStart","gridColumnEnd","gridRow","gridRowStart","gridRowEnd","float","clear","margin","boxSizing","display","aspectRatio","height","maxHeight","minHeight","width","minWidth","maxWidth","flex","flexShrink","flexGrow","flexBasis","tableLayout","borderCollapse","transformOrigin","translate","rotate","skew","scale","transform","animation","cursor","touchAction","userSelect","resize","scrollSnapType","scrollSnapAlign","scrollSnapStop","scrollMargin","scrollPadding","listStylePosition","listStyleType","appearance","columns","breakBefore","breakInside","breakAfter","gridAutoColumns","gridAutoFlow","gridAutoRows","gridTemplateColumns","gridTemplateRows","flexDirection","flexWrap","placeContent","placeItems","alignContent","alignItems","justifyContent","justifyItems","gap","space","divideWidth","divideStyle","divideColor","divideOpacity","placeSelf","alignSelf","justifySelf","overflow","overscrollBehavior","scrollBehavior","textOverflow","whitespace","wordBreak","borderRadius","borderWidth","borderStyle","borderColor","borderOpacity","backgroundColor","backgroundOpacity","backgroundImage","gradientColorStops","boxDecorationBreak","backgroundSize","backgroundAttachment","backgroundClip","backgroundPosition","backgroundRepeat","backgroundOrigin","fill","stroke","strokeWidth","objectFit","objectPosition","padding","textAlign","textIndent","verticalAlign","fontFamily","fontSize","fontWeight","textTransform","fontStyle","fontVariantNumeric","lineHeight","letterSpacing","textColor","textOpacity","textDecoration","textDecorationColor","textDecorationStyle","textDecorationThickness","textUnderlineOffset","fontSmoothing","placeholderColor","placeholderOpacity","caretColor","accentColor","opacity","backgroundBlendMode","mixBlendMode","boxShadow","boxShadowColor","outlineStyle","outlineWidth","outlineOffset","outlineColor","ringWidth","ringColor","ringOpacity","ringOffsetWidth","ringOffsetColor","blur","brightness","contrast","dropShadow","grayscale","hueRotate","invert","saturate","sepia","filter","backdropBlur","backdropBrightness","backdropContrast","backdropGrayscale","backdropHueRotate","backdropInvert","backdropOpacity","backdropSaturate","backdropSepia","backdropFilter","transitionProperty","transitionDelay","transitionDuration","transitionTimingFunction","willChange","content"]
@@ -11,6 +11,7 @@ import isPlainObject from './util/isPlainObject'
11
11
  import transformThemeValue from './util/transformThemeValue'
12
12
  import { version as tailwindVersion } from '../package.json'
13
13
  import log from './util/log'
14
+ import { normalizeScreens } from './util/normalizeScreens'
14
15
  import { formatBoxShadowValue, parseBoxShadowValue } from './util/parseBoxShadowValue'
15
16
 
16
17
  export let variantPlugins = {
@@ -23,6 +24,8 @@ export let variantPlugins = {
23
24
 
24
25
  addVariant('file', '&::file-selector-button')
25
26
 
27
+ addVariant('placeholder', '&::placeholder')
28
+
26
29
  addVariant('before', ({ container }) => {
27
30
  container.walkRules((rule) => {
28
31
  let foundContent = false
@@ -156,13 +159,17 @@ export let variantPlugins = {
156
159
  },
157
160
 
158
161
  screenVariants: ({ theme, addVariant }) => {
159
- for (let screen in theme('screens')) {
160
- let size = theme('screens')[screen]
161
- let query = buildMediaQuery(size)
162
+ for (let screen of normalizeScreens(theme('screens'))) {
163
+ let query = buildMediaQuery(screen)
162
164
 
163
- addVariant(screen, `@media ${query}`)
165
+ addVariant(screen.name, `@media ${query}`)
164
166
  }
165
167
  },
168
+
169
+ orientationVariants: ({ addVariant }) => {
170
+ addVariant('portrait', '@media (orientation: portrait)')
171
+ addVariant('landscape', '@media (orientation: landscape)')
172
+ },
166
173
  }
167
174
 
168
175
  export let corePlugins = {
@@ -180,24 +187,10 @@ export let corePlugins = {
180
187
  },
181
188
 
182
189
  container: (() => {
183
- function extractMinWidths(breakpoints) {
184
- return Object.values(breakpoints ?? {}).flatMap((breakpoints) => {
185
- if (typeof breakpoints === 'string') {
186
- breakpoints = { min: breakpoints }
187
- }
188
-
189
- if (!Array.isArray(breakpoints)) {
190
- breakpoints = [breakpoints]
191
- }
192
-
193
- return breakpoints
194
- .filter((breakpoint) => {
195
- return breakpoint?.hasOwnProperty?.('min') || breakpoint?.hasOwnProperty('min-width')
196
- })
197
- .map((breakpoint) => {
198
- return breakpoint['min-width'] ?? breakpoint.min
199
- })
200
- })
190
+ function extractMinWidths(breakpoints = []) {
191
+ return breakpoints
192
+ .flatMap((breakpoint) => breakpoint.values.map((breakpoint) => breakpoint.min))
193
+ .filter((v) => v !== undefined)
201
194
  }
202
195
 
203
196
  function mapMinWidthsToPadding(minWidths, screens, paddings) {
@@ -226,16 +219,11 @@ export let corePlugins = {
226
219
  }
227
220
 
228
221
  for (let minWidth of minWidths) {
229
- for (let [screen, value] of Object.entries(screens)) {
230
- let screenMinWidth =
231
- typeof value === 'object' && value !== null ? value.min || value['min-width'] : value
232
-
233
- if (`${screenMinWidth}` === `${minWidth}`) {
234
- mapping.push({
235
- screen,
236
- minWidth,
237
- padding: paddings[screen],
238
- })
222
+ for (let screen of screens) {
223
+ for (let { min } of screen.values) {
224
+ if (min === minWidth) {
225
+ mapping.push({ minWidth, padding: paddings[screen.name] })
226
+ }
239
227
  }
240
228
  }
241
229
  }
@@ -244,12 +232,12 @@ export let corePlugins = {
244
232
  }
245
233
 
246
234
  return function ({ addComponents, theme }) {
247
- let screens = theme('container.screens', theme('screens'))
235
+ let screens = normalizeScreens(theme('container.screens', theme('screens')))
248
236
  let minWidths = extractMinWidths(screens)
249
237
  let paddings = mapMinWidthsToPadding(minWidths, screens, theme('container.padding'))
250
238
 
251
239
  let generatePaddingFor = (minWidth) => {
252
- let paddingConfig = paddings.find((padding) => `${padding.minWidth}` === `${minWidth}`)
240
+ let paddingConfig = paddings.find((padding) => padding.minWidth === minWidth)
253
241
 
254
242
  if (!paddingConfig) {
255
243
  return {}
@@ -515,27 +503,31 @@ export let corePlugins = {
515
503
  ],
516
504
  { supportsNegativeValues: true }
517
505
  ),
518
- scale: createUtilityPlugin('scale', [
519
- [
520
- 'scale',
521
- [
522
- ['@defaults transform', {}],
523
- '--tw-scale-x',
524
- '--tw-scale-y',
525
- ['transform', 'var(--tw-transform)'],
526
- ],
527
- ],
506
+ scale: createUtilityPlugin(
507
+ 'scale',
528
508
  [
529
509
  [
530
- 'scale-x',
531
- [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
510
+ 'scale',
511
+ [
512
+ ['@defaults transform', {}],
513
+ '--tw-scale-x',
514
+ '--tw-scale-y',
515
+ ['transform', 'var(--tw-transform)'],
516
+ ],
532
517
  ],
533
518
  [
534
- 'scale-y',
535
- [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
519
+ [
520
+ 'scale-x',
521
+ [['@defaults transform', {}], '--tw-scale-x', ['transform', 'var(--tw-transform)']],
522
+ ],
523
+ [
524
+ 'scale-y',
525
+ [['@defaults transform', {}], '--tw-scale-y', ['transform', 'var(--tw-transform)']],
526
+ ],
536
527
  ],
537
528
  ],
538
- ]),
529
+ { supportsNegativeValues: true }
530
+ ),
539
531
 
540
532
  transform: ({ addBase, addUtilities }) => {
541
533
  addBase({
@@ -619,17 +611,54 @@ export let corePlugins = {
619
611
 
620
612
  cursor: createUtilityPlugin('cursor'),
621
613
 
622
- touchAction: ({ addUtilities }) => {
614
+ touchAction: ({ addBase, addUtilities }) => {
615
+ addBase({
616
+ '@defaults touch-action': {
617
+ '--tw-pan-x': 'var(--tw-empty,/*!*/ /*!*/)',
618
+ '--tw-pan-y': 'var(--tw-empty,/*!*/ /*!*/)',
619
+ '--tw-pinch-zoom': 'var(--tw-empty,/*!*/ /*!*/)',
620
+ '--tw-touch-action': 'var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)',
621
+ },
622
+ })
623
+
623
624
  addUtilities({
624
625
  '.touch-auto': { 'touch-action': 'auto' },
625
626
  '.touch-none': { 'touch-action': 'none' },
626
- '.touch-pan-x': { 'touch-action': 'pan-x' },
627
- '.touch-pan-left': { 'touch-action': 'pan-left' },
628
- '.touch-pan-right': { 'touch-action': 'pan-right' },
629
- '.touch-pan-y': { 'touch-action': 'pan-y' },
630
- '.touch-pan-up': { 'touch-action': 'pan-up' },
631
- '.touch-pan-down': { 'touch-action': 'pan-down' },
632
- '.touch-pinch-zoom': { 'touch-action': 'pinch-zoom' },
627
+ '.touch-pan-x': {
628
+ '@defaults touch-action': {},
629
+ '--tw-pan-x': 'pan-x',
630
+ 'touch-action': 'var(--tw-touch-action)',
631
+ },
632
+ '.touch-pan-left': {
633
+ '@defaults touch-action': {},
634
+ '--tw-pan-x': 'pan-left',
635
+ 'touch-action': 'var(--tw-touch-action)',
636
+ },
637
+ '.touch-pan-right': {
638
+ '@defaults touch-action': {},
639
+ '--tw-pan-x': 'pan-right',
640
+ 'touch-action': 'var(--tw-touch-action)',
641
+ },
642
+ '.touch-pan-y': {
643
+ '@defaults touch-action': {},
644
+ '--tw-pan-y': 'pan-y',
645
+ 'touch-action': 'var(--tw-touch-action)',
646
+ },
647
+ '.touch-pan-up': {
648
+ '@defaults touch-action': {},
649
+ '--tw-pan-y': 'pan-up',
650
+ 'touch-action': 'var(--tw-touch-action)',
651
+ },
652
+ '.touch-pan-down': {
653
+ '@defaults touch-action': {},
654
+ '--tw-pan-y': 'pan-down',
655
+ 'touch-action': 'var(--tw-touch-action)',
656
+ },
657
+ '.touch-pinch-zoom': {
658
+ '@defaults touch-action': {},
659
+ '--tw-pinch-zoom': 'pinch-zoom',
660
+ 'touch-action': 'var(--tw-touch-action)',
661
+ },
633
662
  '.touch-manipulation': { 'touch-action': 'manipulation' },
634
663
  })
635
664
  },
@@ -1371,8 +1400,10 @@ export let corePlugins = {
1371
1400
 
1372
1401
  boxDecorationBreak: ({ addUtilities }) => {
1373
1402
  addUtilities({
1374
- '.decoration-slice': { 'box-decoration-break': 'slice' },
1375
- '.decoration-clone': { 'box-decoration-break': 'clone' },
1403
+ '.decoration-slice': { 'box-decoration-break': 'slice' }, // Deprecated
1404
+ '.decoration-clone': { 'box-decoration-break': 'clone' }, // Deprecated
1405
+ '.box-decoration-slice': { 'box-decoration-break': 'slice' },
1406
+ '.box-decoration-clone': { 'box-decoration-break': 'clone' },
1376
1407
  })
1377
1408
  },
1378
1409
 
@@ -1630,6 +1661,7 @@ export let corePlugins = {
1630
1661
  textDecoration: ({ addUtilities }) => {
1631
1662
  addUtilities({
1632
1663
  '.underline': { 'text-decoration': 'underline' },
1664
+ '.overline': { 'text-decoration': 'overline' },
1633
1665
  '.line-through': { 'text-decoration': 'line-through' },
1634
1666
  '.no-underline': { 'text-decoration': 'none' },
1635
1667
  })
@@ -1642,10 +1674,32 @@ export let corePlugins = {
1642
1674
  return { 'text-decoration-color': toColorValue(value) }
1643
1675
  },
1644
1676
  },
1645
- { values: flattenColorPalette(theme('textDecorationColor')), type: ['color', 'any'] }
1677
+ { values: flattenColorPalette(theme('textDecorationColor')), type: ['color'] }
1646
1678
  )
1647
1679
  },
1648
1680
 
1681
+ textDecorationStyle: ({ addUtilities }) => {
1682
+ addUtilities({
1683
+ '.decoration-solid': { 'text-decoration-style': 'solid' },
1684
+ '.decoration-double': { 'text-decoration-style': 'double' },
1685
+ '.decoration-dotted': { 'text-decoration-style': 'dotted' },
1686
+ '.decoration-dashed': { 'text-decoration-style': 'dashed' },
1687
+ '.decoration-wavy': { 'text-decoration-style': 'wavy' },
1688
+ })
1689
+ },
1690
+
1691
+ textDecorationThickness: createUtilityPlugin(
1692
+ 'textDecorationThickness',
1693
+ [['decoration', ['text-decoration-thickness']]],
1694
+ { type: ['length', 'percentage'] }
1695
+ ),
1696
+
1697
+ textUnderlineOffset: createUtilityPlugin(
1698
+ 'textUnderlineOffset',
1699
+ [['underline-offset', ['text-underline-offset']]],
1700
+ { type: ['length', 'percentage'] }
1701
+ ),
1702
+
1649
1703
  fontSmoothing: ({ addUtilities }) => {
1650
1704
  addUtilities({
1651
1705
  '.antialiased': {
@@ -288,7 +288,8 @@ legend {
288
288
  }
289
289
 
290
290
  ol,
291
- ul {
291
+ ul,
292
+ menu {
292
293
  list-style: none;
293
294
  margin: 0;
294
295
  padding: 0;
@@ -2,6 +2,23 @@ export default function (_context) {
2
2
  return (root, result) => {
3
3
  let found = false
4
4
 
5
+ root.walkAtRules('tailwind', (node) => {
6
+ if (found) return false
7
+
8
+ if (node.parent && node.parent.type !== 'root') {
9
+ found = true
10
+ node.warn(
11
+ result,
12
+ [
13
+ 'Nested @tailwind rules were detected, but are not supported.',
14
+ "Consider using a prefix to scope Tailwind's classes: https://tailwindcss.com/docs/configuration#prefix",
15
+ 'Alternatively, use the important selector strategy: https://tailwindcss.com/docs/configuration#selector-strategy',
16
+ ].join('\n')
17
+ )
18
+ return false
19
+ }
20
+ })
21
+
5
22
  root.walkRules((rule) => {
6
23
  if (found) return false
7
24
 
@@ -9,10 +26,12 @@ export default function (_context) {
9
26
  found = true
10
27
  nestedRule.warn(
11
28
  result,
12
- // TODO: Improve this warning message
13
- 'Nested CSS detected, checkout the docs on how to support nesting: https://tailwindcss.com/docs/using-with-preprocessors#nesting'
29
+ [
30
+ 'Nested CSS was detected, but CSS nesting has not been configured correctly.',
31
+ 'Please enable a CSS nesting plugin *before* Tailwind in your configuration.',
32
+ 'See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting',
33
+ ].join('\n')
14
34
  )
15
-
16
35
  return false
17
36
  })
18
37
  })
@@ -2,6 +2,7 @@ import dlv from 'dlv'
2
2
  import didYouMean from 'didyoumean'
3
3
  import transformThemeValue from '../util/transformThemeValue'
4
4
  import parseValue from 'postcss-value-parser'
5
+ import { normalizeScreens } from '../util/normalizeScreens'
5
6
  import buildMediaQuery from '../util/buildMediaQuery'
6
7
  import { toPath } from '../util/toPath'
7
8
 
@@ -173,12 +174,14 @@ export default function ({ tailwindConfig: config }) {
173
174
  },
174
175
  screen: (node, screen) => {
175
176
  screen = screen.replace(/^['"]+/g, '').replace(/['"]+$/g, '')
177
+ let screens = normalizeScreens(config.theme.screens)
178
+ let screenDefinition = screens.find(({ name }) => name === screen)
176
179
 
177
- if (config.theme.screens[screen] === undefined) {
180
+ if (!screenDefinition) {
178
181
  throw node.error(`The '${screen}' screen does not exist in your theme.`)
179
182
  }
180
183
 
181
- return buildMediaQuery(config.theme.screens[screen])
184
+ return buildMediaQuery(screenDefinition)
182
185
  },
183
186
  }
184
187
  return (root) => {
@@ -15,6 +15,8 @@ const PATTERNS = [
15
15
  /([^<>"'`\s]*\[\w*\("[^'`\s]*"\)\])/.source, // bg-[url("..."),url("...")]
16
16
  /([^<>"'`\s]*\['[^"'`\s]*'\])/.source, // `content-['hello']` but not `content-['hello']']`
17
17
  /([^<>"'`\s]*\["[^"'`\s]*"\])/.source, // `content-["hello"]` but not `content-["hello"]"]`
18
+ /([^<>"'`\s]*\[[^<>"'`\s]*:'[^"'`\s]*'\])/.source, // `[content:'hello']` but not `[content:"hello"]`
19
+ /([^<>"'`\s]*\[[^<>"'`\s]*:"[^"'`\s]*"\])/.source, // `[content:"hello"]` but not `[content:'hello']`
18
20
  /([^<>"'`\s]*\[[^"'`\s]+\][^<>"'`\s]*)/.source, // `fill-[#bada55]`, `fill-[#bada55]/50`
19
21
  /([^<>"'`\s]*[^"'`\s:])/.source, // `px-1.5`, `uppercase` but not `uppercase:`
20
22
  ].join('|')