tailwindcss 0.0.0-insiders.afd159d → 0.0.0-insiders.aff715e

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.
@@ -15,7 +15,6 @@ _export(exports, {
15
15
  const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
16
16
  const _path = /*#__PURE__*/ _interopRequireWildcard(require("path"));
17
17
  const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
18
- const _sharedState = require("./lib/sharedState");
19
18
  const _createUtilityPlugin = /*#__PURE__*/ _interopRequireDefault(require("./util/createUtilityPlugin"));
20
19
  const _buildMediaQuery = /*#__PURE__*/ _interopRequireDefault(require("./util/buildMediaQuery"));
21
20
  const _escapeClassName = /*#__PURE__*/ _interopRequireDefault(require("./util/escapeClassName"));
@@ -669,18 +668,6 @@ let corePlugins = {
669
668
  ]
670
669
  ],
671
670
  [
672
- [
673
- "start",
674
- [
675
- "inset-inline-start"
676
- ]
677
- ],
678
- [
679
- "end",
680
- [
681
- "inset-inline-end"
682
- ]
683
- ],
684
671
  [
685
672
  "top",
686
673
  [
@@ -833,18 +820,6 @@ let corePlugins = {
833
820
  ]
834
821
  ],
835
822
  [
836
- [
837
- "ms",
838
- [
839
- "margin-inline-start"
840
- ]
841
- ],
842
- [
843
- "me",
844
- [
845
- "margin-inline-end"
846
- ]
847
- ],
848
823
  [
849
824
  "mt",
850
825
  [
@@ -1459,18 +1434,6 @@ let corePlugins = {
1459
1434
  ]
1460
1435
  ],
1461
1436
  [
1462
- [
1463
- "scroll-ms",
1464
- [
1465
- "scroll-margin-inline-start"
1466
- ]
1467
- ],
1468
- [
1469
- "scroll-me",
1470
- [
1471
- "scroll-margin-inline-end"
1472
- ]
1473
- ],
1474
1437
  [
1475
1438
  "scroll-mt",
1476
1439
  [
@@ -1523,18 +1486,6 @@ let corePlugins = {
1523
1486
  ]
1524
1487
  ],
1525
1488
  [
1526
- [
1527
- "scroll-ps",
1528
- [
1529
- "scroll-padding-inline-start"
1530
- ]
1531
- ],
1532
- [
1533
- "scroll-pe",
1534
- [
1535
- "scroll-padding-inline-end"
1536
- ]
1537
- ],
1538
1489
  [
1539
1490
  "scroll-pt",
1540
1491
  [
@@ -1901,15 +1852,6 @@ let corePlugins = {
1901
1852
  matchUtilities({
1902
1853
  "space-x": (value)=>{
1903
1854
  value = value === "0" ? "0px" : value;
1904
- if (_sharedState.env.OXIDE) {
1905
- return {
1906
- "& > :not([hidden]) ~ :not([hidden])": {
1907
- "--tw-space-x-reverse": "0",
1908
- "margin-inline-end": `calc(${value} * var(--tw-space-x-reverse))`,
1909
- "margin-inline-start": `calc(${value} * calc(1 - var(--tw-space-x-reverse)))`
1910
- }
1911
- };
1912
- }
1913
1855
  return {
1914
1856
  "& > :not([hidden]) ~ :not([hidden])": {
1915
1857
  "--tw-space-x-reverse": "0",
@@ -1945,16 +1887,6 @@ let corePlugins = {
1945
1887
  matchUtilities({
1946
1888
  "divide-x": (value)=>{
1947
1889
  value = value === "0" ? "0px" : value;
1948
- if (_sharedState.env.OXIDE) {
1949
- return {
1950
- "& > :not([hidden]) ~ :not([hidden])": {
1951
- "@defaults border-width": {},
1952
- "--tw-divide-x-reverse": "0",
1953
- "border-inline-end-width": `calc(${value} * var(--tw-divide-x-reverse))`,
1954
- "border-inline-start-width": `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))`
1955
- }
1956
- };
1957
- }
1958
1890
  return {
1959
1891
  "& > :not([hidden]) ~ :not([hidden])": {
1960
1892
  "@defaults border-width": {},
@@ -2264,20 +2196,6 @@ let corePlugins = {
2264
2196
  ]
2265
2197
  ],
2266
2198
  [
2267
- [
2268
- "rounded-s",
2269
- [
2270
- "border-start-start-radius",
2271
- "border-end-start-radius"
2272
- ]
2273
- ],
2274
- [
2275
- "rounded-e",
2276
- [
2277
- "border-start-end-radius",
2278
- "border-end-end-radius"
2279
- ]
2280
- ],
2281
2199
  [
2282
2200
  "rounded-t",
2283
2201
  [
@@ -2308,30 +2226,6 @@ let corePlugins = {
2308
2226
  ]
2309
2227
  ],
2310
2228
  [
2311
- [
2312
- "rounded-ss",
2313
- [
2314
- "border-start-start-radius"
2315
- ]
2316
- ],
2317
- [
2318
- "rounded-se",
2319
- [
2320
- "border-start-end-radius"
2321
- ]
2322
- ],
2323
- [
2324
- "rounded-ee",
2325
- [
2326
- "border-end-end-radius"
2327
- ]
2328
- ],
2329
- [
2330
- "rounded-es",
2331
- [
2332
- "border-end-start-radius"
2333
- ]
2334
- ],
2335
2229
  [
2336
2230
  "rounded-tl",
2337
2231
  [
@@ -2394,26 +2288,6 @@ let corePlugins = {
2394
2288
  ]
2395
2289
  ],
2396
2290
  [
2397
- [
2398
- "border-s",
2399
- [
2400
- [
2401
- "@defaults border-width",
2402
- {}
2403
- ],
2404
- "border-inline-start-width"
2405
- ]
2406
- ],
2407
- [
2408
- "border-e",
2409
- [
2410
- [
2411
- "@defaults border-width",
2412
- {}
2413
- ],
2414
- "border-inline-end-width"
2415
- ]
2416
- ],
2417
2291
  [
2418
2292
  "border-t",
2419
2293
  [
@@ -2545,30 +2419,6 @@ let corePlugins = {
2545
2419
  ]
2546
2420
  });
2547
2421
  matchUtilities({
2548
- "border-s": (value)=>{
2549
- if (!corePlugins("borderOpacity")) {
2550
- return {
2551
- "border-inline-start-color": (0, _toColorValue.default)(value)
2552
- };
2553
- }
2554
- return (0, _withAlphaVariable.default)({
2555
- color: value,
2556
- property: "border-inline-start-color",
2557
- variable: "--tw-border-opacity"
2558
- });
2559
- },
2560
- "border-e": (value)=>{
2561
- if (!corePlugins("borderOpacity")) {
2562
- return {
2563
- "border-inline-end-color": (0, _toColorValue.default)(value)
2564
- };
2565
- }
2566
- return (0, _withAlphaVariable.default)({
2567
- color: value,
2568
- property: "border-inline-end-color",
2569
- variable: "--tw-border-opacity"
2570
- });
2571
- },
2572
2422
  "border-t": (value)=>{
2573
2423
  if (!corePlugins("borderOpacity")) {
2574
2424
  return {
@@ -2924,18 +2774,6 @@ let corePlugins = {
2924
2774
  ]
2925
2775
  ],
2926
2776
  [
2927
- [
2928
- "ps",
2929
- [
2930
- "padding-inline-start"
2931
- ]
2932
- ],
2933
- [
2934
- "pe",
2935
- [
2936
- "padding-inline-end"
2937
- ]
2938
- ],
2939
2777
  [
2940
2778
  "pt",
2941
2779
  [
@@ -3052,16 +2890,10 @@ let corePlugins = {
3052
2890
  },
3053
2891
  fontSize: ({ matchUtilities , theme })=>{
3054
2892
  matchUtilities({
3055
- text: (value, { modifier })=>{
2893
+ text: (value)=>{
3056
2894
  let [fontSize, options] = Array.isArray(value) ? value : [
3057
2895
  value
3058
2896
  ];
3059
- if (modifier) {
3060
- return {
3061
- "font-size": fontSize,
3062
- "line-height": modifier
3063
- };
3064
- }
3065
2897
  let { lineHeight , letterSpacing , fontWeight } = (0, _isPlainObject.default)(options) ? options : {
3066
2898
  lineHeight: options
3067
2899
  };
@@ -3080,7 +2912,6 @@ let corePlugins = {
3080
2912
  }
3081
2913
  }, {
3082
2914
  values: theme("fontSize"),
3083
- modifiers: theme("lineHeight"),
3084
2915
  type: [
3085
2916
  "absolute-size",
3086
2917
  "relative-size",
@@ -167,6 +167,11 @@ class Offsets {
167
167
  if (a.layer !== b.layer) {
168
168
  return this.layerPositions[a.layer] - this.layerPositions[b.layer];
169
169
  }
170
+ // When sorting the `variants` layer, we need to sort based on the parent layer as well within
171
+ // this variants layer.
172
+ if (a.parentLayer !== b.parentLayer) {
173
+ return this.layerPositions[a.parentLayer] - this.layerPositions[b.parentLayer];
174
+ }
170
175
  // Sort based on the sorting function
171
176
  for (let aOptions of a.options){
172
177
  for (let bOptions of b.options){
package/lib/util/color.js CHANGED
@@ -24,8 +24,8 @@ let VALUE = /(?:\d+|\d*\.\d+)%?/;
24
24
  let SEP = /(?:\s*,\s*|\s+)/;
25
25
  let ALPHA_SEP = /\s*[,/]\s*/;
26
26
  let CUSTOM_PROPERTY = /var\(--(?:[^ )]*?)\)/;
27
- let RGB = new RegExp(`^(rgb)a?\\(\\s*(${VALUE.source}|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`);
28
- let HSL = new RegExp(`^(hsl)a?\\(\\s*((?:${VALUE.source})(?:deg|rad|grad|turn)?|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`);
27
+ let RGB = new RegExp(`^(rgba?)\\(\\s*(${VALUE.source}|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`);
28
+ let HSL = new RegExp(`^(hsla?)\\(\\s*((?:${VALUE.source})(?:deg|rad|grad|turn)?|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`);
29
29
  function parseColor(value, { loose =false } = {}) {
30
30
  var _match_, _match__toString;
31
31
  if (typeof value !== "string") {
@@ -80,6 +80,17 @@ function parseColor(value, { loose =false } = {}) {
80
80
  match[3],
81
81
  match[4]
82
82
  ].filter(Boolean).map((v)=>v.toString());
83
+ // rgba(var(--my-color), 0.1)
84
+ // hsla(var(--my-color), 0.1)
85
+ if (color.length === 2 && color[0].startsWith("var(")) {
86
+ return {
87
+ mode: match[1],
88
+ color: [
89
+ color[0]
90
+ ],
91
+ alpha: color[1]
92
+ };
93
+ }
83
94
  if (!loose && color.length !== 3) {
84
95
  return null;
85
96
  }
@@ -94,5 +105,8 @@ function parseColor(value, { loose =false } = {}) {
94
105
  }
95
106
  function formatColor({ mode , color , alpha }) {
96
107
  let hasAlpha = alpha !== undefined;
108
+ if (mode === "rgba" || mode === "hsla") {
109
+ return `${mode}(${color.join(", ")}${hasAlpha ? `, ${alpha}` : ""})`;
110
+ }
97
111
  return `${mode}(${color.join(" ")}${hasAlpha ? ` / ${alpha}` : ""})`;
98
112
  }
@@ -41,9 +41,6 @@ function isCSSFunction(value) {
41
41
  const placeholder = "--tw-placeholder";
42
42
  const placeholderRe = new RegExp(placeholder, "g");
43
43
  function normalize(value, isRoot = true) {
44
- if (value.startsWith("--")) {
45
- return `var(${value})`;
46
- }
47
44
  // Keep raw strings if it starts with `url(`
48
45
  if (value.includes("url(")) {
49
46
  return value.split(/(url\(.*?\))/g).filter(Boolean).map((part)=>{
@@ -123,13 +123,6 @@ function parseColorFormat(value) {
123
123
  }
124
124
  return value;
125
125
  }
126
- function unwrapArbitraryModifier(modifier) {
127
- modifier = modifier.slice(1, -1);
128
- if (modifier.startsWith("--")) {
129
- modifier = `var(${modifier})`;
130
- }
131
- return modifier;
132
- }
133
126
  function asColor(modifier, options = {}, { tailwindConfig ={} } = {}) {
134
127
  var _options_values;
135
128
  if (((_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier]) !== undefined) {
@@ -148,7 +141,7 @@ function asColor(modifier, options = {}, { tailwindConfig ={} } = {}) {
148
141
  }
149
142
  normalizedColor = parseColorFormat(normalizedColor);
150
143
  if (isArbitraryValue(alpha)) {
151
- return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, unwrapArbitraryModifier(alpha));
144
+ return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, alpha.slice(1, -1));
152
145
  }
153
146
  if (((_tailwindConfig_theme = tailwindConfig.theme) === null || _tailwindConfig_theme === void 0 ? void 0 : (_tailwindConfig_theme_opacity = _tailwindConfig_theme.opacity) === null || _tailwindConfig_theme_opacity === void 0 ? void 0 : _tailwindConfig_theme_opacity[alpha]) === undefined) {
154
147
  return undefined;
@@ -263,7 +256,7 @@ function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
263
256
  if (configValue !== null) {
264
257
  utilityModifier = configValue;
265
258
  } else if (isArbitraryValue(utilityModifier)) {
266
- utilityModifier = unwrapArbitraryModifier(utilityModifier);
259
+ utilityModifier = utilityModifier.slice(1, -1);
267
260
  }
268
261
  }
269
262
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "0.0.0-insiders.afd159d",
3
+ "version": "0.0.0-insiders.aff715e",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -1,7 +1,6 @@
1
1
  import fs from 'fs'
2
2
  import * as path from 'path'
3
3
  import postcss from 'postcss'
4
- import { env } from './lib/sharedState'
5
4
  import createUtilityPlugin from './util/createUtilityPlugin'
6
5
  import buildMediaQuery from './util/buildMediaQuery'
7
6
  import escapeClassName from './util/escapeClassName'
@@ -647,8 +646,6 @@ export let corePlugins = {
647
646
  ['inset-y', ['top', 'bottom']],
648
647
  ],
649
648
  [
650
- ['start', ['inset-inline-start']],
651
- ['end', ['inset-inline-end']],
652
649
  ['top', ['top']],
653
650
  ['right', ['right']],
654
651
  ['bottom', ['bottom']],
@@ -700,8 +697,6 @@ export let corePlugins = {
700
697
  ['my', ['margin-top', 'margin-bottom']],
701
698
  ],
702
699
  [
703
- ['ms', ['margin-inline-start']],
704
- ['me', ['margin-inline-end']],
705
700
  ['mt', ['margin-top']],
706
701
  ['mr', ['margin-right']],
707
702
  ['mb', ['margin-bottom']],
@@ -1050,8 +1045,6 @@ export let corePlugins = {
1050
1045
  ['scroll-my', ['scroll-margin-top', 'scroll-margin-bottom']],
1051
1046
  ],
1052
1047
  [
1053
- ['scroll-ms', ['scroll-margin-inline-start']],
1054
- ['scroll-me', ['scroll-margin-inline-end']],
1055
1048
  ['scroll-mt', ['scroll-margin-top']],
1056
1049
  ['scroll-mr', ['scroll-margin-right']],
1057
1050
  ['scroll-mb', ['scroll-margin-bottom']],
@@ -1068,8 +1061,6 @@ export let corePlugins = {
1068
1061
  ['scroll-py', ['scroll-padding-top', 'scroll-padding-bottom']],
1069
1062
  ],
1070
1063
  [
1071
- ['scroll-ps', ['scroll-padding-inline-start']],
1072
- ['scroll-pe', ['scroll-padding-inline-end']],
1073
1064
  ['scroll-pt', ['scroll-padding-top']],
1074
1065
  ['scroll-pr', ['scroll-padding-right']],
1075
1066
  ['scroll-pb', ['scroll-padding-bottom']],
@@ -1243,16 +1234,6 @@ export let corePlugins = {
1243
1234
  'space-x': (value) => {
1244
1235
  value = value === '0' ? '0px' : value
1245
1236
 
1246
- if (env.OXIDE) {
1247
- return {
1248
- '& > :not([hidden]) ~ :not([hidden])': {
1249
- '--tw-space-x-reverse': '0',
1250
- 'margin-inline-end': `calc(${value} * var(--tw-space-x-reverse))`,
1251
- 'margin-inline-start': `calc(${value} * calc(1 - var(--tw-space-x-reverse)))`,
1252
- },
1253
- }
1254
- }
1255
-
1256
1237
  return {
1257
1238
  '& > :not([hidden]) ~ :not([hidden])': {
1258
1239
  '--tw-space-x-reverse': '0',
@@ -1288,17 +1269,6 @@ export let corePlugins = {
1288
1269
  'divide-x': (value) => {
1289
1270
  value = value === '0' ? '0px' : value
1290
1271
 
1291
- if (env.OXIDE) {
1292
- return {
1293
- '& > :not([hidden]) ~ :not([hidden])': {
1294
- '@defaults border-width': {},
1295
- '--tw-divide-x-reverse': '0',
1296
- 'border-inline-end-width': `calc(${value} * var(--tw-divide-x-reverse))`,
1297
- 'border-inline-start-width': `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))`,
1298
- },
1299
- }
1300
- }
1301
-
1302
1272
  return {
1303
1273
  '& > :not([hidden]) ~ :not([hidden])': {
1304
1274
  '@defaults border-width': {},
@@ -1488,18 +1458,12 @@ export let corePlugins = {
1488
1458
  borderRadius: createUtilityPlugin('borderRadius', [
1489
1459
  ['rounded', ['border-radius']],
1490
1460
  [
1491
- ['rounded-s', ['border-start-start-radius', 'border-end-start-radius']],
1492
- ['rounded-e', ['border-start-end-radius', 'border-end-end-radius']],
1493
1461
  ['rounded-t', ['border-top-left-radius', 'border-top-right-radius']],
1494
1462
  ['rounded-r', ['border-top-right-radius', 'border-bottom-right-radius']],
1495
1463
  ['rounded-b', ['border-bottom-right-radius', 'border-bottom-left-radius']],
1496
1464
  ['rounded-l', ['border-top-left-radius', 'border-bottom-left-radius']],
1497
1465
  ],
1498
1466
  [
1499
- ['rounded-ss', ['border-start-start-radius']],
1500
- ['rounded-se', ['border-start-end-radius']],
1501
- ['rounded-ee', ['border-end-end-radius']],
1502
- ['rounded-es', ['border-end-start-radius']],
1503
1467
  ['rounded-tl', ['border-top-left-radius']],
1504
1468
  ['rounded-tr', ['border-top-right-radius']],
1505
1469
  ['rounded-br', ['border-bottom-right-radius']],
@@ -1516,8 +1480,6 @@ export let corePlugins = {
1516
1480
  ['border-y', [['@defaults border-width', {}], 'border-top-width', 'border-bottom-width']],
1517
1481
  ],
1518
1482
  [
1519
- ['border-s', [['@defaults border-width', {}], 'border-inline-start-width']],
1520
- ['border-e', [['@defaults border-width', {}], 'border-inline-end-width']],
1521
1483
  ['border-t', [['@defaults border-width', {}], 'border-top-width']],
1522
1484
  ['border-r', [['@defaults border-width', {}], 'border-right-width']],
1523
1485
  ['border-b', [['@defaults border-width', {}], 'border-bottom-width']],
@@ -1600,32 +1562,6 @@ export let corePlugins = {
1600
1562
 
1601
1563
  matchUtilities(
1602
1564
  {
1603
- 'border-s': (value) => {
1604
- if (!corePlugins('borderOpacity')) {
1605
- return {
1606
- 'border-inline-start-color': toColorValue(value),
1607
- }
1608
- }
1609
-
1610
- return withAlphaVariable({
1611
- color: value,
1612
- property: 'border-inline-start-color',
1613
- variable: '--tw-border-opacity',
1614
- })
1615
- },
1616
- 'border-e': (value) => {
1617
- if (!corePlugins('borderOpacity')) {
1618
- return {
1619
- 'border-inline-end-color': toColorValue(value),
1620
- }
1621
- }
1622
-
1623
- return withAlphaVariable({
1624
- color: value,
1625
- property: 'border-inline-end-color',
1626
- variable: '--tw-border-opacity',
1627
- })
1628
- },
1629
1565
  'border-t': (value) => {
1630
1566
  if (!corePlugins('borderOpacity')) {
1631
1567
  return {
@@ -1862,8 +1798,6 @@ export let corePlugins = {
1862
1798
  ['py', ['padding-top', 'padding-bottom']],
1863
1799
  ],
1864
1800
  [
1865
- ['ps', ['padding-inline-start']],
1866
- ['pe', ['padding-inline-end']],
1867
1801
  ['pt', ['padding-top']],
1868
1802
  ['pr', ['padding-right']],
1869
1803
  ['pb', ['padding-bottom']],
@@ -1927,16 +1861,9 @@ export let corePlugins = {
1927
1861
  fontSize: ({ matchUtilities, theme }) => {
1928
1862
  matchUtilities(
1929
1863
  {
1930
- text: (value, { modifier }) => {
1864
+ text: (value) => {
1931
1865
  let [fontSize, options] = Array.isArray(value) ? value : [value]
1932
1866
 
1933
- if (modifier) {
1934
- return {
1935
- 'font-size': fontSize,
1936
- 'line-height': modifier,
1937
- }
1938
- }
1939
-
1940
1867
  let { lineHeight, letterSpacing, fontWeight } = isPlainObject(options)
1941
1868
  ? options
1942
1869
  : { lineHeight: options }
@@ -1951,7 +1878,6 @@ export let corePlugins = {
1951
1878
  },
1952
1879
  {
1953
1880
  values: theme('fontSize'),
1954
- modifiers: theme('lineHeight'),
1955
1881
  type: ['absolute-size', 'relative-size', 'length', 'percentage'],
1956
1882
  }
1957
1883
  )
@@ -209,6 +209,12 @@ export class Offsets {
209
209
  return this.layerPositions[a.layer] - this.layerPositions[b.layer]
210
210
  }
211
211
 
212
+ // When sorting the `variants` layer, we need to sort based on the parent layer as well within
213
+ // this variants layer.
214
+ if (a.parentLayer !== b.parentLayer) {
215
+ return this.layerPositions[a.parentLayer] - this.layerPositions[b.parentLayer]
216
+ }
217
+
212
218
  // Sort based on the sorting function
213
219
  for (let aOptions of a.options) {
214
220
  for (let bOptions of b.options) {
package/src/util/color.js CHANGED
@@ -8,10 +8,10 @@ let ALPHA_SEP = /\s*[,/]\s*/
8
8
  let CUSTOM_PROPERTY = /var\(--(?:[^ )]*?)\)/
9
9
 
10
10
  let RGB = new RegExp(
11
- `^(rgb)a?\\(\\s*(${VALUE.source}|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`
11
+ `^(rgba?)\\(\\s*(${VALUE.source}|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`
12
12
  )
13
13
  let HSL = new RegExp(
14
- `^(hsl)a?\\(\\s*((?:${VALUE.source})(?:deg|rad|grad|turn)?|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`
14
+ `^(hsla?)\\(\\s*((?:${VALUE.source})(?:deg|rad|grad|turn)?|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`
15
15
  )
16
16
 
17
17
  // In "loose" mode the color may contain fewer than 3 parts, as long as at least
@@ -52,6 +52,16 @@ export function parseColor(value, { loose = false } = {}) {
52
52
 
53
53
  let color = [match[2], match[3], match[4]].filter(Boolean).map((v) => v.toString())
54
54
 
55
+ // rgba(var(--my-color), 0.1)
56
+ // hsla(var(--my-color), 0.1)
57
+ if (color.length === 2 && color[0].startsWith('var(')) {
58
+ return {
59
+ mode: match[1],
60
+ color: [color[0]],
61
+ alpha: color[1],
62
+ }
63
+ }
64
+
55
65
  if (!loose && color.length !== 3) {
56
66
  return null
57
67
  }
@@ -69,5 +79,10 @@ export function parseColor(value, { loose = false } = {}) {
69
79
 
70
80
  export function formatColor({ mode, color, alpha }) {
71
81
  let hasAlpha = alpha !== undefined
82
+
83
+ if (mode === 'rgba' || mode === 'hsla') {
84
+ return `${mode}(${color.join(', ')}${hasAlpha ? `, ${alpha}` : ''})`
85
+ }
86
+
72
87
  return `${mode}(${color.join(' ')}${hasAlpha ? ` / ${alpha}` : ''})`
73
88
  }
@@ -16,10 +16,6 @@ const placeholderRe = new RegExp(placeholder, 'g')
16
16
  // This is not a data type, but rather a function that can normalize the
17
17
  // correct values.
18
18
  export function normalize(value, isRoot = true) {
19
- if (value.startsWith('--')) {
20
- return `var(${value})`
21
- }
22
-
23
19
  // Keep raw strings if it starts with `url(`
24
20
  if (value.includes('url(')) {
25
21
  return value
@@ -133,14 +133,6 @@ export function parseColorFormat(value) {
133
133
  return value
134
134
  }
135
135
 
136
- function unwrapArbitraryModifier(modifier) {
137
- modifier = modifier.slice(1, -1)
138
- if (modifier.startsWith('--')) {
139
- modifier = `var(${modifier})`
140
- }
141
- return modifier
142
- }
143
-
144
136
  export function asColor(modifier, options = {}, { tailwindConfig = {} } = {}) {
145
137
  if (options.values?.[modifier] !== undefined) {
146
138
  return parseColorFormat(options.values?.[modifier])
@@ -161,7 +153,7 @@ export function asColor(modifier, options = {}, { tailwindConfig = {} } = {}) {
161
153
  normalizedColor = parseColorFormat(normalizedColor)
162
154
 
163
155
  if (isArbitraryValue(alpha)) {
164
- return withAlphaValue(normalizedColor, unwrapArbitraryModifier(alpha))
156
+ return withAlphaValue(normalizedColor, alpha.slice(1, -1))
165
157
  }
166
158
 
167
159
  if (tailwindConfig.theme?.opacity?.[alpha] === undefined) {
@@ -295,7 +287,7 @@ export function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
295
287
  if (configValue !== null) {
296
288
  utilityModifier = configValue
297
289
  } else if (isArbitraryValue(utilityModifier)) {
298
- utilityModifier = unwrapArbitraryModifier(utilityModifier)
290
+ utilityModifier = utilityModifier.slice(1, -1)
299
291
  }
300
292
  }
301
293
  }
@@ -584,6 +584,7 @@ module.exports = {
584
584
  }),
585
585
  maxHeight: ({ theme }) => ({
586
586
  ...theme('spacing'),
587
+ none: 'none',
587
588
  full: '100%',
588
589
  screen: '100vh',
589
590
  min: 'min-content',
@@ -852,7 +853,6 @@ module.exports = {
852
853
  'top-left': 'top left',
853
854
  },
854
855
  transitionDelay: {
855
- 0: '0s',
856
856
  75: '75ms',
857
857
  100: '100ms',
858
858
  150: '150ms',
@@ -864,7 +864,6 @@ module.exports = {
864
864
  },
865
865
  transitionDuration: {
866
866
  DEFAULT: '150ms',
867
- 0: '0s',
868
867
  75: '75ms',
869
868
  100: '100ms',
870
869
  150: '150ms',
@@ -327,12 +327,9 @@ export type DefaultTheme = Config['theme'] & {
327
327
  | 'top-left',
328
328
  string
329
329
  >
330
- transitionDelay: Record<
331
- '0' | '75' | '100' | '150' | '200' | '300' | '500' | '700' | '1000',
332
- string
333
- >
330
+ transitionDelay: Record<'75' | '100' | '150' | '200' | '300' | '500' | '700' | '1000', string>
334
331
  transitionDuration: Record<
335
- '0' | '75' | '100' | '150' | '200' | '300' | '500' | '700' | '1000' | 'DEFAULT',
332
+ '75' | '100' | '150' | '200' | '300' | '500' | '700' | '1000' | 'DEFAULT',
336
333
  string
337
334
  >
338
335
  transitionProperty: Record<