No description
Find a file
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
.github Update issue templates 2021-09-14 11:51:35 -04:00
integrations Setup integration tests (#5466) 2021-09-14 16:18:14 +02:00
jest JIT: Optimize universal selector usage by inlining only the relevant selectors (#4850) 2021-07-01 06:33:37 -04:00
nesting Remove AOT (#5340) 2021-09-01 17:13:59 +02:00
perf Performance improvements + memory leak fix (#3032) 2020-12-11 15:03:49 +01:00
scripts Inline plugins (#5455) 2021-09-09 09:22:50 -04:00
src Improve arbitrary value support (#5568) 2021-09-24 18:45:42 +02:00
stubs Improve arbitrary value support (#5568) 2021-09-24 18:45:42 +02:00
tests Improve arbitrary value support (#5568) 2021-09-24 18:45:42 +02:00
.editorconfig Convert new stuff to use ES6 modules 2017-08-27 18:02:41 -04:00
.eslintignore Generate plugin list file (#4725) 2021-06-23 14:13:03 -04:00
.eslintrc.json Remove duplicate prettier.config.js settings from .eslintrc.json (#5087) 2021-09-01 17:41:43 +02:00
.gitignore Remove AOT (#5340) 2021-09-01 17:13:59 +02:00
base.css Remove preflight CSS export in favor of base 2019-02-11 12:38:46 -05:00
CHANGELOG.md Fix list item in changelog 2021-09-23 22:23:55 -04:00
colors.js Update color warnings to match other warnings (#5412) 2021-09-10 14:41:19 -04:00
components.css Move CSS files to root for easier imports 2018-03-13 10:05:24 -04:00
defaultConfig.js Fix incorrect import in defaultConfig and defaultTheme (#5527) 2021-09-17 13:16:38 +02:00
defaultTheme.js Fix incorrect import in defaultConfig and defaultTheme (#5527) 2021-09-17 13:16:38 +02:00
LICENSE Avoid updating license every year 2017-12-29 22:32:43 +01:00
package-lock.json Update jest-diff to version 27.2.0 2021-09-24 10:13:34 +00:00
package.json Update jest-diff to version 27.2.0 2021-09-24 10:13:34 +00:00
plugin.js Add default interop to tailwindcss/plugin 2020-10-06 14:34:35 -04:00
prettier.config.js Add Prettier configuration file (prettier.config.js) (#3713) 2021-05-13 09:07:24 -04:00
README.md Update README.md 2021-09-14 14:49:09 -04:00
resolveConfig.js Support new presets key + extending core plugins config (#2474) 2020-10-08 11:21:39 -04:00
screens.css Add screen.css file for postcss-import convenience 2019-05-12 10:36:59 -04:00
tailwind.css Undo accidental changes to CDN build process 2019-12-25 13:54:09 -05:00
utilities.css Move CSS files to root for easier imports 2018-03-13 10:05:24 -04:00
variants.css JIT: Replace @tailwind screens with @tailwind variants (#4356) 2021-05-14 13:58:52 -04:00

Tailwind CSS
A utility-first CSS framework for rapidly building custom user interfaces.

Build Status Total Downloads Latest Release License


Documentation

For full documentation, visit tailwindcss.com.

Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

Discuss Tailwind CSS on GitHub

For casual chit-chat with others using the framework:

Join the Tailwind CSS Discord Server

Contributing

If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.