tailwindcss 0.0.0-insiders.ea6f14a → 0.0.0-insiders.ec1f7b0

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/CHANGELOG.md CHANGED
@@ -30,6 +30,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
30
30
  - Fix CLI `--content` option ([#5775](https://github.com/tailwindlabs/tailwindcss/pull/5775))
31
31
  - Fix before/after utilities overriding custom content values at larger breakpoints ([#5820](https://github.com/tailwindlabs/tailwindcss/pull/5820))
32
32
  - Cleanup duplicate properties ([#5830](https://github.com/tailwindlabs/tailwindcss/pull/5830))
33
+ - Allow `_` inside `url()` when using arbitrary values ([#5853](https://github.com/tailwindlabs/tailwindcss/pull/5853))
34
+ - Prevent crashes when using comments in `@layer` AtRules ([#5854](https://github.com/tailwindlabs/tailwindcss/pull/5854))
35
+ - Handle color transformations properly with `theme(...)` for all relevant plugins ([#4533](https://github.com/tailwindlabs/tailwindcss/pull/4533), [#5871](https://github.com/tailwindlabs/tailwindcss/pull/5871))
33
36
 
34
37
  ## [3.0.0-alpha.1] - 2021-10-01
35
38
 
@@ -70,6 +73,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
70
73
  - Fix using negated `content` globs ([#5625](https://github.com/tailwindlabs/tailwindcss/pull/5625))
71
74
  - Fix using backslashes in `content` globs ([#5628](https://github.com/tailwindlabs/tailwindcss/pull/5628))
72
75
 
76
+ ## [2.2.19] - 2021-10-29
77
+
78
+ ### Fixed
79
+
80
+ - Ensure `corePlugins` order is consisent in AOT mode ([#5928](https://github.com/tailwindlabs/tailwindcss/pull/5928))
81
+
82
+ ## [2.2.18] - 2021-10-29
83
+
84
+ ### Fixed
85
+
86
+ - Bump versions for security vulnerabilities ([#5924](https://github.com/tailwindlabs/tailwindcss/pull/5924))
87
+
88
+ ## [2.2.17] - 2021-10-13
89
+
90
+ ### Fixed
91
+
92
+ - Configure chokidar's `awaitWriteFinish` setting to avoid occasional stale builds on Windows ([#5758](https://github.com/tailwindlabs/tailwindcss/pull/5758))
93
+
73
94
  ## [2.2.16] - 2021-09-26
74
95
 
75
96
  ### Fixed
@@ -1629,7 +1650,10 @@ No release notes
1629
1650
  - Everything!
1630
1651
 
1631
1652
  [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.0.0-alpha.1...HEAD
1632
- [3.0.0-alpha.1]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.16...v3.0.0-alpha.1
1653
+ [3.0.0-alpha.1]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.19...v3.0.0-alpha.1
1654
+ [2.2.19]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.18...v2.2.19
1655
+ [2.2.18]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.17...v2.2.18
1656
+ [2.2.17]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.16...v2.2.17
1633
1657
  [2.2.16]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.15...v2.2.16
1634
1658
  [2.2.15]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.14...v2.2.15
1635
1659
  [2.2.14]: https://github.com/tailwindlabs/tailwindcss/compare/v2.2.13...v2.2.14
package/lib/cli.js CHANGED
@@ -22,7 +22,7 @@ function _interopRequireDefault(obj) {
22
22
  };
23
23
  }
24
24
  let env = {
25
- DEBUG: process.env.DEBUG !== undefined
25
+ DEBUG: process.env.DEBUG !== undefined && process.env.DEBUG !== '0'
26
26
  };
27
27
  // ---
28
28
  function indentRecursive(node, indent = 0) {
@@ -135,7 +135,10 @@ var _default = [
135
135
  "backgroundBlendMode",
136
136
  "mixBlendMode",
137
137
  "boxShadow",
138
- "outline",
138
+ "outlineStyle",
139
+ "outlineWidth",
140
+ "outlineOffset",
141
+ "outlineColor",
139
142
  "ringWidth",
140
143
  "ringColor",
141
144
  "ringOpacity",
@@ -192,6 +192,9 @@ let variantPlugins = {
192
192
  addVariant('dark', '@media (prefers-color-scheme: dark)');
193
193
  }
194
194
  },
195
+ printVariant: ({ addVariant })=>{
196
+ addVariant('print', '@media print');
197
+ },
195
198
  screenVariants: ({ theme , addVariant })=>{
196
199
  for(let screen in theme('screens')){
197
200
  let size = theme('screens')[screen];
@@ -3010,20 +3013,69 @@ let corePlugins = {
3010
3013
  });
3011
3014
  };
3012
3015
  })(),
3013
- outline: ({ matchUtilities , theme })=>{
3016
+ outlineStyle: ({ addUtilities })=>{
3017
+ addUtilities({
3018
+ '.outline-none': {
3019
+ outline: '2px solid transparent',
3020
+ 'outline-offset': '2px'
3021
+ },
3022
+ '.outline': {
3023
+ 'outline-style': 'solid'
3024
+ },
3025
+ '.outline-dashed': {
3026
+ 'outline-style': 'dashed'
3027
+ },
3028
+ '.outline-dotted': {
3029
+ 'outline-style': 'dotted'
3030
+ },
3031
+ '.outline-double': {
3032
+ 'outline-style': 'double'
3033
+ },
3034
+ '.outline-hidden': {
3035
+ 'outline-style': 'hidden'
3036
+ }
3037
+ });
3038
+ },
3039
+ outlineWidth: (0, _createUtilityPlugin).default('outlineWidth', [
3040
+ [
3041
+ 'outline',
3042
+ [
3043
+ 'outline-width'
3044
+ ]
3045
+ ]
3046
+ ], {
3047
+ type: [
3048
+ 'length',
3049
+ 'number',
3050
+ 'percentage'
3051
+ ]
3052
+ }),
3053
+ outlineOffset: (0, _createUtilityPlugin).default('outlineOffset', [
3054
+ [
3055
+ 'outline-offset',
3056
+ [
3057
+ 'outline-offset'
3058
+ ]
3059
+ ]
3060
+ ], {
3061
+ type: [
3062
+ 'length',
3063
+ 'number',
3064
+ 'percentage'
3065
+ ]
3066
+ }),
3067
+ outlineColor: ({ matchUtilities , theme })=>{
3014
3068
  matchUtilities({
3015
3069
  outline: (value)=>{
3016
- value = Array.isArray(value) ? value : value.split(',');
3017
- let [outline, outlineOffset = '0'] = Array.isArray(value) ? value : [
3018
- value
3019
- ];
3020
3070
  return {
3021
- outline,
3022
- 'outline-offset': outlineOffset
3071
+ 'outline-color': (0, _toColorValue).default(value)
3023
3072
  };
3024
3073
  }
3025
3074
  }, {
3026
- values: theme('outline')
3075
+ values: (0, _flattenColorPalette).default(theme('outlineColor')),
3076
+ type: [
3077
+ 'color'
3078
+ ]
3027
3079
  });
3028
3080
  },
3029
3081
  ringWidth: ({ matchUtilities , addBase , addUtilities , theme })=>{
@@ -42,6 +42,8 @@ const PATTERNS = [
42
42
  /([^<>"'`\s]*\[\w*"[^"`\s]*"?\])/.source,
43
43
  /([^<>"'`\s]*\[\w*\('[^"'`\s]*'\)\])/.source,
44
44
  /([^<>"'`\s]*\[\w*\("[^"'`\s]*"\)\])/.source,
45
+ /([^<>"'`\s]*\[\w*\('[^"`\s]*'\)\])/.source,
46
+ /([^<>"'`\s]*\[\w*\("[^'`\s]*"\)\])/.source,
45
47
  /([^<>"'`\s]*\['[^"'`\s]*'\])/.source,
46
48
  /([^<>"'`\s]*\["[^"'`\s]*"\])/.source,
47
49
  /([^<>"'`\s]*\[[^"'`\s]+\][^<>"'`\s]*)/.source,
@@ -444,15 +444,28 @@ function generateRules(candidates, context) {
444
444
  context.classCache.set(candidate, matches);
445
445
  allRules.push(matches);
446
446
  }
447
- return allRules.flat(1).map(([{ sort , layer , options }, rule])=>{
448
- if (options.respectImportant) {
449
- if (context.tailwindConfig.important === true) {
447
+ // Strategy based on `tailwindConfig.important`
448
+ let strategy = ((important)=>{
449
+ if (important === true) {
450
+ return (rule)=>{
450
451
  rule.walkDecls((d)=>{
451
452
  if (d.parent.type === 'rule' && !inKeyframes(d.parent)) {
452
453
  d.important = true;
453
454
  }
454
455
  });
455
- } else if (typeof context.tailwindConfig.important === 'string') {
456
+ };
457
+ }
458
+ if (typeof important === 'string') {
459
+ return (rule)=>{
460
+ rule.selectors = rule.selectors.map((selector)=>{
461
+ return `${important} ${selector}`;
462
+ });
463
+ };
464
+ }
465
+ })(context.tailwindConfig.important);
466
+ return allRules.flat(1).map(([{ sort , layer , options }, rule])=>{
467
+ if (options.respectImportant) {
468
+ if (strategy) {
456
469
  let container = _postcss.default.root({
457
470
  nodes: [
458
471
  rule.clone()
@@ -462,9 +475,7 @@ function generateRules(candidates, context) {
462
475
  if (inKeyframes(r)) {
463
476
  return;
464
477
  }
465
- r.selectors = r.selectors.map((selector)=>{
466
- return `${context.tailwindConfig.important} ${selector}`;
467
- });
478
+ strategy(r);
468
479
  });
469
480
  rule = container.nodes[0];
470
481
  }
@@ -258,7 +258,7 @@ function buildPluginApi(tailwindConfig, context, { variantList , variantMap , of
258
258
  return ({ format })=>format(str)
259
259
  ;
260
260
  }
261
- let [, name, params] = /@(.*?) (\(.*\))/g.exec(str);
261
+ let [, name, params] = /@(.*?) (.*)/g.exec(str);
262
262
  return ({ wrap })=>wrap(_postcss.default.atRule({
263
263
  name,
264
264
  params
@@ -607,6 +607,7 @@ function resolvePlugins(context, root) {
607
607
  _corePlugins.variantPlugins['directionVariants'],
608
608
  _corePlugins.variantPlugins['reducedMotionVariants'],
609
609
  _corePlugins.variantPlugins['darkVariants'],
610
+ _corePlugins.variantPlugins['printVariant'],
610
611
  _corePlugins.variantPlugins['screenVariants'],
611
612
  ];
612
613
  return [
@@ -6,7 +6,7 @@ exports.contextSourcesMap = exports.configContextMap = exports.env = exports.con
6
6
  const env = {
7
7
  TAILWIND_MODE: process.env.TAILWIND_MODE,
8
8
  NODE_ENV: process.env.NODE_ENV,
9
- DEBUG: process.env.DEBUG !== undefined,
9
+ DEBUG: process.env.DEBUG !== undefined && process.env.DEBUG !== '0',
10
10
  TAILWIND_DISABLE_TOUCH: process.env.TAILWIND_DISABLE_TOUCH !== undefined,
11
11
  TAILWIND_TOUCH_DIR: process.env.TAILWIND_TOUCH_DIR
12
12
  };
@@ -22,14 +22,23 @@ let COMMA = /,(?![^(]*\))/g // Comma separator that is not located between brack
22
22
  ;
23
23
  let UNDERSCORE = /_(?![^(]*\))/g // Underscore separator that is not located between brackets. E.g.: `rgba(255,_255,_255)_black` these don't count.
24
24
  ;
25
- function normalize(value) {
25
+ function normalize(value, isRoot = true) {
26
+ // Keep raw strings if it starts with `url(`
27
+ if (value.includes('url(')) {
28
+ return value.split(/(url\(.*?\))/g).filter(Boolean).map((part)=>{
29
+ if (/^url\(.*?\)$/.test(part)) {
30
+ return part;
31
+ }
32
+ return normalize(part, false);
33
+ }).join('');
34
+ }
26
35
  // Convert `_` to ` `, except for escaped underscores `\_`
27
36
  value = value.replace(/([^\\])_+/g, (fullMatch, characterBefore)=>characterBefore + ' '.repeat(fullMatch.length - 1)
28
37
  ).replace(/^_/g, ' ').replace(/\\_/g, '_');
29
38
  // Remove leftover whitespace
30
- value = value.trim();
31
- // Keep raw strings if it starts with `url(`
32
- if (value.startsWith('url(')) return value;
39
+ if (isRoot) {
40
+ value = value.trim();
41
+ }
33
42
  // Add spaces around operators inside calc() that do not follow an operator
34
43
  // or '('.
35
44
  return value.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, '$1 $2 ');
@@ -154,8 +154,14 @@ function splitAtFirst(input, delim) {
154
154
  }
155
155
  function coerceValue(types, modifier, options, tailwindConfig) {
156
156
  if (isArbitraryValue(modifier)) {
157
- let [explicitType, value] = splitAtFirst(modifier.slice(1, -1), ':');
158
- if (explicitType !== undefined && !supportedTypes.includes(explicitType)) {
157
+ let arbitraryValue = modifier.slice(1, -1);
158
+ let [explicitType, value] = splitAtFirst(arbitraryValue, ':');
159
+ // It could be that this resolves to `url(https` which is not a valid
160
+ // identifier. We currently only support "simple" words with dashes or
161
+ // underscores. E.g.: family-name
162
+ if (!/^[\w-_]+$/g.test(explicitType)) {
163
+ value = arbitraryValue;
164
+ } else if (explicitType !== undefined && !supportedTypes.includes(explicitType)) {
159
165
  return [];
160
166
  }
161
167
  if (value.length > 0 && supportedTypes.includes(explicitType)) {
@@ -14,8 +14,12 @@ function transformThemeValue(themeSection) {
14
14
  'fontSize',
15
15
  'outline'
16
16
  ].includes(themeSection)) {
17
- return (value)=>Array.isArray(value) ? value[0] : value
18
- ;
17
+ return (value)=>{
18
+ if (typeof value === 'function') value = value({
19
+ });
20
+ if (Array.isArray(value)) value = value[0];
21
+ return value;
22
+ };
19
23
  }
20
24
  if ([
21
25
  'fontFamily',
@@ -30,8 +34,12 @@ function transformThemeValue(themeSection) {
30
34
  'cursor',
31
35
  'animation',
32
36
  ].includes(themeSection)) {
33
- return (value)=>Array.isArray(value) ? value.join(', ') : value
34
- ;
37
+ return (value)=>{
38
+ if (typeof value === 'function') value = value({
39
+ });
40
+ if (Array.isArray(value)) value = value.join(', ');
41
+ return value;
42
+ };
35
43
  }
36
44
  // For backwards compatibility reasons, before we switched to underscores
37
45
  // instead of commas for arbitrary values.
@@ -40,14 +48,16 @@ function transformThemeValue(themeSection) {
40
48
  'gridTemplateRows',
41
49
  'objectPosition'
42
50
  ].includes(themeSection)) {
43
- return (value)=>typeof value === 'string' ? _postcss.default.list.comma(value).join(' ') : value
44
- ;
51
+ return (value)=>{
52
+ if (typeof value === 'function') value = value({
53
+ });
54
+ if (typeof value === 'string') value = _postcss.default.list.comma(value).join(' ');
55
+ return value;
56
+ };
45
57
  }
46
- if (themeSection === 'colors') {
47
- return (value)=>typeof value === 'function' ? value({
48
- }) : value
49
- ;
50
- }
51
- return (value)=>value
52
- ;
58
+ return (value)=>{
59
+ if (typeof value === 'function') value = value({
60
+ });
61
+ return value;
62
+ };
53
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "0.0.0-insiders.ea6f14a",
3
+ "version": "0.0.0-insiders.ec1f7b0",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -47,16 +47,16 @@
47
47
  "@swc/core": "^1.2.92",
48
48
  "@swc/jest": "^0.1.5",
49
49
  "@swc/register": "^0.1.7",
50
- "autoprefixer": "^10.3.6",
50
+ "autoprefixer": "^10.3.7",
51
51
  "cross-env": "^7.0.3",
52
52
  "cssnano": "^5.0.8",
53
53
  "esbuild": "^0.13.4",
54
- "eslint": "^7.32.0",
54
+ "eslint": "^8.0.1",
55
55
  "eslint-config-prettier": "^8.3.0",
56
56
  "eslint-plugin-prettier": "^4.0.0",
57
- "jest": "^27.2.4",
57
+ "jest": "^27.3.1",
58
58
  "jest-diff": "^27.2.5",
59
- "postcss": "^8.3.8",
59
+ "postcss": "^8.3.11",
60
60
  "postcss-cli": "^8.3.1",
61
61
  "prettier": "^2.4.1",
62
62
  "rimraf": "^3.0.0"