tailwindcss 0.0.0-insiders.bda8421 → 0.0.0-insiders.bdc87ae

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.
@@ -325,7 +325,7 @@ let variantPlugins = {
325
325
  addVariant("dark", selector);
326
326
  } else if (mode === "class") {
327
327
  // Old behavior
328
- addVariant("dark", `:is(${selector} &)`);
328
+ addVariant("dark", `&:is(${selector} *)`);
329
329
  }
330
330
  },
331
331
  printVariant: ({ addVariant })=>{
@@ -443,7 +443,7 @@ let variantPlugins = {
443
443
  matchVariant("supports", (value = "")=>{
444
444
  let check = (0, _dataTypes.normalize)(value);
445
445
  let isRaw = /^\w*\s*\(/.test(check);
446
- // Chrome has a bug where `(condtion1)or(condition2)` is not valid
446
+ // Chrome has a bug where `(condition1)or(condition2)` is not valid
447
447
  // But `(condition1) or (condition2)` is supported.
448
448
  check = isRaw ? check.replace(/\b(and|or|not)\b/g, " $1 ") : check;
449
449
  if (isRaw) {
@@ -460,15 +460,24 @@ let variantPlugins = {
460
460
  values: (_theme = theme("supports")) !== null && _theme !== void 0 ? _theme : {}
461
461
  });
462
462
  },
463
- hasVariants: ({ matchVariant })=>{
463
+ hasVariants: ({ matchVariant , prefix })=>{
464
464
  matchVariant("has", (value)=>`&:has(${(0, _dataTypes.normalize)(value)})`, {
465
- values: {}
465
+ values: {},
466
+ [_setupContextUtils.INTERNAL_FEATURES]: {
467
+ respectPrefix: false
468
+ }
466
469
  });
467
- matchVariant("group-has", (value, { modifier })=>modifier ? `:merge(.group\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) &` : `:merge(.group):has(${(0, _dataTypes.normalize)(value)}) &`, {
468
- values: {}
470
+ matchVariant("group-has", (value, { modifier })=>modifier ? `:merge(${prefix(".group")}\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) &` : `:merge(${prefix(".group")}):has(${(0, _dataTypes.normalize)(value)}) &`, {
471
+ values: {},
472
+ [_setupContextUtils.INTERNAL_FEATURES]: {
473
+ respectPrefix: false
474
+ }
469
475
  });
470
- matchVariant("peer-has", (value, { modifier })=>modifier ? `:merge(.peer\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) ~ &` : `:merge(.peer):has(${(0, _dataTypes.normalize)(value)}) ~ &`, {
471
- values: {}
476
+ matchVariant("peer-has", (value, { modifier })=>modifier ? `:merge(${prefix(".peer")}\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) ~ &` : `:merge(${prefix(".peer")}):has(${(0, _dataTypes.normalize)(value)}) ~ &`, {
477
+ values: {},
478
+ [_setupContextUtils.INTERNAL_FEATURES]: {
479
+ respectPrefix: false
480
+ }
472
481
  });
473
482
  },
474
483
  ariaVariants: ({ matchVariant , theme })=>{
@@ -794,7 +803,9 @@ let corePlugins = {
794
803
  "gridColumnStart"
795
804
  ]
796
805
  ]
797
- ]),
806
+ ], {
807
+ supportsNegativeValues: true
808
+ }),
798
809
  gridColumnEnd: (0, _createUtilityPlugin.default)("gridColumnEnd", [
799
810
  [
800
811
  "col-end",
@@ -802,7 +813,9 @@ let corePlugins = {
802
813
  "gridColumnEnd"
803
814
  ]
804
815
  ]
805
- ]),
816
+ ], {
817
+ supportsNegativeValues: true
818
+ }),
806
819
  gridRow: (0, _createUtilityPlugin.default)("gridRow", [
807
820
  [
808
821
  "row",
@@ -818,7 +831,9 @@ let corePlugins = {
818
831
  "gridRowStart"
819
832
  ]
820
833
  ]
821
- ]),
834
+ ], {
835
+ supportsNegativeValues: true
836
+ }),
822
837
  gridRowEnd: (0, _createUtilityPlugin.default)("gridRowEnd", [
823
838
  [
824
839
  "row-end",
@@ -826,7 +841,9 @@ let corePlugins = {
826
841
  "gridRowEnd"
827
842
  ]
828
843
  ]
829
- ]),
844
+ ], {
845
+ supportsNegativeValues: true
846
+ }),
830
847
  float: ({ addUtilities })=>{
831
848
  addUtilities({
832
849
  ".float-start": {
@@ -3912,7 +3929,7 @@ let corePlugins = {
3912
3929
  matchUtilities({
3913
3930
  blur: (value)=>{
3914
3931
  return {
3915
- "--tw-blur": `blur(${value})`,
3932
+ "--tw-blur": value.trim() === "" ? " " : `blur(${value})`,
3916
3933
  "@defaults filter": {},
3917
3934
  filter: cssFilterValue
3918
3935
  };
@@ -4052,8 +4069,9 @@ let corePlugins = {
4052
4069
  matchUtilities({
4053
4070
  "backdrop-blur": (value)=>{
4054
4071
  return {
4055
- "--tw-backdrop-blur": `blur(${value})`,
4072
+ "--tw-backdrop-blur": value.trim() === "" ? " " : `blur(${value})`,
4056
4073
  "@defaults backdrop-filter": {},
4074
+ "-webkit-backdrop-filter": cssBackdropFilterValue,
4057
4075
  "backdrop-filter": cssBackdropFilterValue
4058
4076
  };
4059
4077
  }
@@ -4067,6 +4085,7 @@ let corePlugins = {
4067
4085
  return {
4068
4086
  "--tw-backdrop-brightness": `brightness(${value})`,
4069
4087
  "@defaults backdrop-filter": {},
4088
+ "-webkit-backdrop-filter": cssBackdropFilterValue,
4070
4089
  "backdrop-filter": cssBackdropFilterValue
4071
4090
  };
4072
4091
  }
@@ -4080,6 +4099,7 @@ let corePlugins = {
4080
4099
  return {
4081
4100
  "--tw-backdrop-contrast": `contrast(${value})`,
4082
4101
  "@defaults backdrop-filter": {},
4102
+ "-webkit-backdrop-filter": cssBackdropFilterValue,
4083
4103
  "backdrop-filter": cssBackdropFilterValue
4084
4104
  };
4085
4105
  }
@@ -4093,6 +4113,7 @@ let corePlugins = {
4093
4113
  return {
4094
4114
  "--tw-backdrop-grayscale": `grayscale(${value})`,
4095
4115
  "@defaults backdrop-filter": {},
4116
+ "-webkit-backdrop-filter": cssBackdropFilterValue,
4096
4117
  "backdrop-filter": cssBackdropFilterValue
4097
4118
  };
4098
4119
  }
@@ -4106,6 +4127,7 @@ let corePlugins = {
4106
4127
  return {
4107
4128
  "--tw-backdrop-hue-rotate": `hue-rotate(${value})`,
4108
4129
  "@defaults backdrop-filter": {},
4130
+ "-webkit-backdrop-filter": cssBackdropFilterValue,
4109
4131
  "backdrop-filter": cssBackdropFilterValue
4110
4132
  };
4111
4133
  }
@@ -4120,6 +4142,7 @@ let corePlugins = {
4120
4142
  return {
4121
4143
  "--tw-backdrop-invert": `invert(${value})`,
4122
4144
  "@defaults backdrop-filter": {},
4145
+ "-webkit-backdrop-filter": cssBackdropFilterValue,
4123
4146
  "backdrop-filter": cssBackdropFilterValue
4124
4147
  };
4125
4148
  }
@@ -4133,6 +4156,7 @@ let corePlugins = {
4133
4156
  return {
4134
4157
  "--tw-backdrop-opacity": `opacity(${value})`,
4135
4158
  "@defaults backdrop-filter": {},
4159
+ "-webkit-backdrop-filter": cssBackdropFilterValue,
4136
4160
  "backdrop-filter": cssBackdropFilterValue
4137
4161
  };
4138
4162
  }
@@ -4146,6 +4170,7 @@ let corePlugins = {
4146
4170
  return {
4147
4171
  "--tw-backdrop-saturate": `saturate(${value})`,
4148
4172
  "@defaults backdrop-filter": {},
4173
+ "-webkit-backdrop-filter": cssBackdropFilterValue,
4149
4174
  "backdrop-filter": cssBackdropFilterValue
4150
4175
  };
4151
4176
  }
@@ -4159,6 +4184,7 @@ let corePlugins = {
4159
4184
  return {
4160
4185
  "--tw-backdrop-sepia": `sepia(${value})`,
4161
4186
  "@defaults backdrop-filter": {},
4187
+ "-webkit-backdrop-filter": cssBackdropFilterValue,
4162
4188
  "backdrop-filter": cssBackdropFilterValue
4163
4189
  };
4164
4190
  }
@@ -4181,9 +4207,11 @@ let corePlugins = {
4181
4207
  addUtilities({
4182
4208
  ".backdrop-filter": {
4183
4209
  "@defaults backdrop-filter": {},
4210
+ "-webkit-backdrop-filter": cssBackdropFilterValue,
4184
4211
  "backdrop-filter": cssBackdropFilterValue
4185
4212
  },
4186
4213
  ".backdrop-filter-none": {
4214
+ "-webkit-backdrop-filter": "none",
4187
4215
  "backdrop-filter": "none"
4188
4216
  }
4189
4217
  });
@@ -21,6 +21,7 @@ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
21
21
  const _path = /*#__PURE__*/ _interop_require_default(require("path"));
22
22
  const _isglob = /*#__PURE__*/ _interop_require_default(require("is-glob"));
23
23
  const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob"));
24
+ const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path"));
24
25
  const _parseGlob = require("../util/parseGlob");
25
26
  const _sharedState = require("./sharedState");
26
27
  function _interop_require_default(obj) {
@@ -28,42 +29,11 @@ function _interop_require_default(obj) {
28
29
  default: obj
29
30
  };
30
31
  }
31
- /*!
32
- * Modified version of normalize-path, original license below
33
- *
34
- * normalize-path <https://github.com/jonschlinkert/normalize-path>
35
- *
36
- * Copyright (c) 2014-2018, Jon Schlinkert.
37
- * Released under the MIT License.
38
- */ function normalizePath(path) {
39
- if (typeof path !== "string") {
40
- throw new TypeError("expected path to be a string");
41
- }
42
- if (path === "\\" || path === "/") return "/";
43
- var len = path.length;
44
- if (len <= 1) return path;
45
- // ensure that win32 namespaces has two leading slashes, so that the path is
46
- // handled properly by the win32 version of path.parse() after being normalized
47
- // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces
48
- var prefix = "";
49
- if (len > 4 && path[3] === "\\") {
50
- var ch = path[2];
51
- if ((ch === "?" || ch === ".") && path.slice(0, 2) === "\\\\") {
52
- path = path.slice(2);
53
- prefix = "//";
54
- }
55
- }
56
- // Modified part: instead of purely splitting on `\\` and `/`, we split on
57
- // `/` and `\\` that is _not_ followed by any of the following characters: ()[]
58
- // This is to ensure that we keep the escaping of brackets and parentheses
59
- let segs = path.split(/[/\\]+(?![\(\)\[\]])/);
60
- return prefix + segs.join("/");
61
- }
62
32
  function parseCandidateFiles(context, tailwindConfig) {
63
33
  let files = tailwindConfig.content.files;
64
34
  // Normalize the file globs
65
35
  files = files.filter((filePath)=>typeof filePath === "string");
66
- files = files.map(normalizePath);
36
+ files = files.map(_normalizepath.default);
67
37
  // Split into included and excluded globs
68
38
  let tasks = _fastglob.default.generateTasks(files);
69
39
  /** @type {ContentPath[]} */ let included = [];
@@ -90,9 +60,6 @@ function parseCandidateFiles(context, tailwindConfig) {
90
60
  * @param {boolean} ignore
91
61
  * @returns {ContentPath}
92
62
  */ function parseFilePath(filePath, ignore) {
93
- // Escape special characters in the file path such as: ()[]
94
- // But only if the special character isn't already escaped
95
- filePath = filePath.replace(/(?<!\\)([\[\]\(\)])/g, "\\$1");
96
63
  let contentPath = {
97
64
  original: filePath,
98
65
  base: filePath,
@@ -114,7 +81,7 @@ function parseCandidateFiles(context, tailwindConfig) {
114
81
  // Afaik, this technically shouldn't be needed but there's probably
115
82
  // some internal, direct path matching with a normalized path in
116
83
  // a package which can't handle mixed directory separators
117
- let base = normalizePath(contentPath.base);
84
+ let base = (0, _normalizepath.default)(contentPath.base);
118
85
  // If the user's file path contains any special characters (like parens) for instance fast-glob
119
86
  // is like "OOOH SHINY" and treats them as such. So we have to escape the base path to fix this
120
87
  base = _fastglob.default.escapePath(base);
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "defaultExtractor", {
9
9
  }
10
10
  });
11
11
  const _regex = /*#__PURE__*/ _interop_require_wildcard(require("./regex"));
12
+ const _splitAtTopLevelOnly = require("../util/splitAtTopLevelOnly");
12
13
  function _getRequireWildcardCache(nodeInterop) {
13
14
  if (typeof WeakMap !== "function") return null;
14
15
  var cacheBabelInterop = new WeakMap();
@@ -60,6 +61,27 @@ function defaultExtractor(context) {
60
61
  results.push(clipAtBalancedParens(result));
61
62
  }
62
63
  }
64
+ // Extract any subclasses from languages like Slim and Pug, eg:
65
+ // div.flex.px-5.underline
66
+ for (let result of results.slice()){
67
+ let segments = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(result, ".");
68
+ for(let idx = 0; idx < segments.length; idx++){
69
+ let segment = segments[idx];
70
+ if (idx >= segments.length - 1) {
71
+ results.push(segment);
72
+ continue;
73
+ }
74
+ // If the next segment is a number, discard both, for example seeing
75
+ // `px-1` and `5` means the real candidate was `px-1.5` which is already
76
+ // captured.
77
+ let next = Number(segments[idx + 1]);
78
+ if (isNaN(next)) {
79
+ results.push(segment);
80
+ } else {
81
+ idx++;
82
+ }
83
+ }
84
+ }
63
85
  return results;
64
86
  };
65
87
  }
@@ -170,7 +192,7 @@ function* buildRegExps(context) {
170
192
  ]);
171
193
  }
172
194
  // 5. Inner matches
173
- yield /[^<>"'`\s.(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g;
195
+ yield /[^<>"'`\s.(){}[\]#=%$][^<>"'`\s(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g;
174
196
  }
175
197
  // We want to capture any "special" characters
176
198
  // AND the characters immediately following them (if there is one)
@@ -519,7 +519,10 @@ function extractArbitraryProperty(classCandidate, context) {
519
519
  [
520
520
  {
521
521
  sort,
522
- layer: "utilities"
522
+ layer: "utilities",
523
+ options: {
524
+ respectImportant: true
525
+ }
523
526
  },
524
527
  ()=>({
525
528
  [(0, _nameClass.asClass)(classCandidate)]: {
@@ -46,6 +46,10 @@ function lazyJiti() {
46
46
  }
47
47
  function loadConfig(path) {
48
48
  let config = function() {
49
+ // Always use jiti for ESM or TS files
50
+ if (path && (path.endsWith(".mjs") || path.endsWith(".ts") || path.endsWith(".cts") || path.endsWith(".mts"))) {
51
+ return lazyJiti()(path);
52
+ }
49
53
  try {
50
54
  return path ? require(path) : {};
51
55
  } catch {
@@ -18,9 +18,11 @@ function _interop_require_default(obj) {
18
18
  function applyImportantSelector(selector, important) {
19
19
  let sel = (0, _postcssselectorparser.default)().astSync(selector);
20
20
  sel.each((sel)=>{
21
- // Wrap with :is if it's not already wrapped
22
- let isWrapped = sel.nodes[0].type === "pseudo" && sel.nodes[0].value === ":is" && sel.nodes.every((node)=>node.type !== "combinator");
23
- if (!isWrapped) {
21
+ // For nesting, we only need to wrap a selector with :is() if it has a top-level combinator,
22
+ // e.g. `.dark .text-white`, to be independent of DOM order. Any other selector, including
23
+ // combinators inside of pseudos like `:where()`, are ok to nest.
24
+ let shouldWrap = sel.nodes.some((node)=>node.type === "combinator");
25
+ if (shouldWrap) {
24
26
  sel.nodes = [
25
27
  _postcssselectorparser.default.pseudo({
26
28
  value: ":is",
@@ -77,6 +77,7 @@ function isCSSFunction(value) {
77
77
  // More info:
78
78
  // - https://drafts.csswg.org/scroll-animations/#propdef-timeline-scope
79
79
  // - https://developer.mozilla.org/en-US/docs/Web/CSS/timeline-scope#dashed-ident
80
+ // - https://www.w3.org/TR/css-anchor-position-1
80
81
  //
81
82
  const AUTO_VAR_INJECTION_EXCEPTIONS = new Set([
82
83
  // Concrete properties
@@ -84,10 +85,15 @@ const AUTO_VAR_INJECTION_EXCEPTIONS = new Set([
84
85
  "timeline-scope",
85
86
  "view-timeline-name",
86
87
  "font-palette",
88
+ "anchor-name",
89
+ "anchor-scope",
90
+ "position-anchor",
91
+ "position-try-options",
87
92
  // Shorthand properties
88
93
  "scroll-timeline",
89
94
  "animation-timeline",
90
- "view-timeline"
95
+ "view-timeline",
96
+ "position-try"
91
97
  ]);
92
98
  function normalize(value, context = null, isRoot = true) {
93
99
  let isVarException = context && AUTO_VAR_INJECTION_EXCEPTIONS.has(context.property);
@@ -260,8 +260,7 @@ function normalizeConfig(config) {
260
260
  let transformers = {};
261
261
  if (typeof transform === "function") {
262
262
  transformers.DEFAULT = transform;
263
- }
264
- if (typeof transform === "object" && transform !== null) {
263
+ } else if (typeof transform === "object" && transform !== null) {
265
264
  Object.assign(transformers, transform);
266
265
  }
267
266
  return transformers;
@@ -40,7 +40,7 @@ const TIMING_FNS = [
40
40
  "cubic-bezier",
41
41
  "steps"
42
42
  ];
43
- const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubiz-bezier(a, b, c)` these don't count.
43
+ const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubic-bezier(a, b, c)` these don't count.
44
44
  ;
45
45
  const SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces instead.
46
46
  ;
@@ -25,8 +25,7 @@ function parseGlob(pattern) {
25
25
  }
26
26
  if (glob.substr(0, 2) === "./") {
27
27
  glob = glob.substr(2);
28
- }
29
- if (glob.charAt(0) === "/") {
28
+ } else if (glob.charAt(0) === "/") {
30
29
  glob = glob.substr(1);
31
30
  }
32
31
  return {
@@ -129,7 +129,7 @@ function splitUtilityModifier(modifier) {
129
129
  function parseColorFormat(value) {
130
130
  if (typeof value === "string" && value.includes("<alpha-value>")) {
131
131
  let oldValue = value;
132
- return ({ opacityValue =1 })=>oldValue.replace("<alpha-value>", opacityValue);
132
+ return ({ opacityValue =1 })=>oldValue.replace(/<alpha-value>/g, opacityValue);
133
133
  }
134
134
  return value;
135
135
  }
@@ -27,7 +27,9 @@ const defaultConfigFiles = [
27
27
  "./tailwind.config.js",
28
28
  "./tailwind.config.cjs",
29
29
  "./tailwind.config.mjs",
30
- "./tailwind.config.ts"
30
+ "./tailwind.config.ts",
31
+ "./tailwind.config.cts",
32
+ "./tailwind.config.mts"
31
33
  ];
32
34
  function isObject(value) {
33
35
  return typeof value === "object" && value !== null;
@@ -35,11 +35,7 @@ function splitAtTopLevelOnly(input, separator) {
35
35
  lastPos = idx + separator.length;
36
36
  }
37
37
  }
38
- if (isEscaped) {
39
- isEscaped = false;
40
- } else if (char === "\\") {
41
- isEscaped = true;
42
- }
38
+ isEscaped = isEscaped ? false : char === "\\";
43
39
  if (char === "(" || char === "[" || char === "{") {
44
40
  stack.push(char);
45
41
  } else if (char === ")" && stack[stack.length - 1] === "(" || char === "]" && stack[stack.length - 1] === "[" || char === "}" && stack[stack.length - 1] === "{") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "0.0.0-insiders.bda8421",
3
+ "version": "0.0.0-insiders.bdc87ae",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",