tailwindcss/tests
Robin Malfait 1ec5438448
Improve arbitrary value support (#5568)
* simplify `inset` plugin

* run `prettier` on stub file

* simplify `align` utility

* improve arbitrary support for outline

This will allow us to use `outline-[OUTLINE,OPTIONAL_OFFSET]`

Input:
```html
outline-[2px_solid_black]
```

Output:
```css
.outline-\[2px_solid_black\] {
  outline: 2px solid black;
  outline-offset: 0;
}
```

---

Input:
```html
outline-[2px_solid_black,2px]
```

Output:
```css
.outline-\[2px_solid_black\2c 2px\] {
  outline: 2px solid black;
  outline-offset: 2px;
}
```

* remove default `type`

* simplify createUtilityPlugin, use types directly

* find first matching type when coercing the value

* introduce css data types

Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Types

These data types will be used to "guess" the type of an arbitrary value
if there is some ambiguity going on. For example:

```
bg-[#0088cc]      -> This is a `color`  -> `background-color`
bg-[url('...')]   -> This is a `url`    -> `background-image`
```

If you are using css variables, then there is no way of knowing which
type it is referring to, in that case you can be explicit:

```
bg-[color:var(--value)]   -> This is a `color`  -> `background-color`
bg-[url:var(--value)]     -> This is a `url`    -> `background-image`
```

When you explicitly pass a data type, then we bypass the type system and
assume you are right. This is nice in a way because now we don't have to
run all of the guessing type code. On the other hand, you can introduce
runtime issues that we are not able to detect:

```
:root {
  --value: 12px;
}

/* Later... */
bg-[color:var(--value)] -> Assumes `color` -> *eventually* -> `background-color: 12px`
```

* add a bunch of new tests for advanced arbitrary values
2021-09-24 18:45:42 +02:00
..
fixtures Remove AOT (#5340) 2021-09-01 17:13:59 +02:00
plugins Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00
postcss-plugins/nesting Remove AOT (#5340) 2021-09-01 17:13:59 +02:00
util Remove variants related code (#5465) 2021-09-10 09:34:27 -04:00
animations.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
apply.test.css Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00
apply.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
apply.test.js Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00
arbitrary-values.test.css Improve arbitrary value support (#5568) 2021-09-24 18:45:42 +02:00
arbitrary-values.test.html Improve arbitrary value support (#5568) 2021-09-24 18:45:42 +02:00
arbitrary-values.test.js Improve arbitrary value support (#5568) 2021-09-24 18:45:42 +02:00
basic-usage.test.css Add break-before, break-inside and break-after utilities (#5530) 2021-09-23 14:31:23 -04:00
basic-usage.test.html Add break-before, break-inside and break-after utilities (#5530) 2021-09-23 14:31:23 -04:00
basic-usage.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
collapse-adjacent-rules.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
collapse-adjacent-rules.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
collapse-adjacent-rules.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
color-opacity-modifiers.test.js Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00
color.test.js Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00
configurePlugins.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
containerPlugin.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
context-reuse.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
context-reuse.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
context-reuse.worker.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
custom-extractors.test.css Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00
custom-extractors.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
custom-extractors.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
custom-plugins.test.js Remove variants related code (#5465) 2021-09-10 09:34:27 -04:00
custom-separator.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
custom-separator.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
custom-separator.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
custom-transformers.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
customConfig.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
dark-mode.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
defaultConfig.test.js [WIP] Unify JIT and AOT code paths (#4188) 2021-05-07 13:56:15 -04:00
defaultTheme.test.js [WIP] Unify JIT and AOT code paths (#4188) 2021-05-07 13:56:15 -04:00
detect-nesting.test.js Warn when nesting is detected (#5489) 2021-09-16 14:13:45 +02:00
escapeClassName.test.js [WIP] Unify JIT and AOT code paths (#4188) 2021-05-07 13:56:15 -04:00
evaluateTailwindFunctions.test.js Refactor internals to decouple watch strategies and extract IO 2021-05-26 09:43:05 -04:00
experimental.test.js Improve experimental universal selector improvements (#5517) 2021-09-23 15:05:35 -04:00
extractor-edge-cases.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
flattenColorPalette.test.js [WIP] Unify JIT and AOT code paths (#4188) 2021-05-07 13:56:15 -04:00
import-syntax.test.css Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00
import-syntax.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
import-syntax.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-boolean.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-boolean.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-boolean.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-modifier-prefix.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-modifier-prefix.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-modifier-prefix.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-modifier.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-modifier.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-modifier.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-selector.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-selector.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
important-selector.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
kitchen-sink.test.css Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00
kitchen-sink.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
kitchen-sink.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
layer-at-rules.test.js port @layer tests from AOT to JIT mode (#5379) 2021-09-03 17:46:15 +02:00
layer-without-tailwind.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
layer-without-tailwind.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
layer-without-tailwind.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
modify-selectors.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
modify-selectors.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
modify-selectors.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
mutable.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
mutable.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
mutable.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
negateValue.test.js [WIP] Unify JIT and AOT code paths (#4188) 2021-05-07 13:56:15 -04:00
opacity.test.js Support using functions as colors when disabling color opacity utilities (#5470) 2021-09-10 09:35:15 -04:00
parallel-variants.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
parseAnimationValue.test.js [JIT] Support animation lists (#5252) 2021-08-20 22:39:06 -04:00
parseObjectStyles.test.js [WIP] Unify JIT and AOT code paths (#4188) 2021-05-07 13:56:15 -04:00
prefix.fn.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
prefix.fn.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
prefix.fn.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
prefix.test.css Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00
prefix.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
prefix.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
prefixSelector.test.js [WIP] Unify JIT and AOT code paths (#4188) 2021-05-07 13:56:15 -04:00
raw-content.test.css Add scroll-behavior utilities (#5388) 2021-09-11 09:13:28 -04:00
raw-content.test.html Add scroll-behavior utilities (#5388) 2021-09-11 09:13:28 -04:00
raw-content.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
relative-purge-paths.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
relative-purge-paths.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
resolve-defaults-at-rules.test.js Improve experimental universal selector improvements (#5517) 2021-09-23 15:05:35 -04:00
resolveConfig.test.js Remove variants related code (#5465) 2021-09-10 09:34:27 -04:00
responsive-and-variants-atrules.test.css JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
responsive-and-variants-atrules.test.html JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
responsive-and-variants-atrules.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
safelist.test.js Pattern safelisting (#5511) 2021-09-16 14:47:41 +02:00
screenAtRule.test.js Refactor internals to decouple watch strategies and extract IO 2021-05-26 09:43:05 -04:00
syntax-lit-html.test.js Add test for lit-html syntax 2021-09-21 12:41:58 -04:00
syntax-svelte.test.js Fix svelte test 2021-09-21 12:43:44 -04:00
syntax-svelte.test.svelte Rename svelte tests 2021-09-21 12:37:49 -04:00
tailwind-screens.test.js JIT by default - move tests and make them consistent (#5374) 2021-09-03 13:48:16 +02:00
to-path.test.js Remove lodash (#5390) 2021-09-06 14:15:10 -04:00
variants.test.css Add variant for ::file-selector-button pseudo element (#4936) 2021-09-23 15:43:37 -04:00
variants.test.html Add variant for ::file-selector-button pseudo element (#4936) 2021-09-23 15:43:37 -04:00
variants.test.js Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00
withAlphaVariable.test.js Update color parsing and formatting (#5442) 2021-09-09 16:15:53 +02:00