218 Commits

Author SHA1 Message Date
Jonathan Reinink
2cae04296a
Add aria variants (#9557)
* Add aria variants

* Add group and peer variants to test

* Add support for group and peer modifiers
2022-10-14 14:54:10 -04:00
lightyen
d77b9cec18
Add fill-none and stroke-none utilities (#9403) 2022-09-23 14:12:57 -04:00
Teddy Bradford
27aee8fc29
Replace color template literal with string (#9367) 2022-09-19 15:24:21 -04:00
Robin Malfait
4a745439f0
Add type annotations to the tailwind.config.js file (#8493)
* add type annotation to the config by default

* use `@type {import('tailwindcss').Config}` instead
2022-06-02 16:44:12 +02:00
Jordan Pittman
cab1fcecc5
Add future flag to preserve custom, default ring color opacity (#8448)
* Add future flag to preserve ring color opacity

* Update changelog
2022-05-27 09:48:27 -04:00
Jordan Pittman
7ed46b6f52 Re-enable new features
This reverts commits 1456ed9021b3455dbb4458c2fb7d8ab66dfb3fed, d0269c24b3c7ad4557b7e3f2779bd15c5ac501f7, and 57699a04036c542d82e7b7102d775d4d2379493d.
2022-04-12 14:13:04 -04:00
Jordan Pittman
57699a0403
Prep for patch release (#8098)
* Disable backdrop variant

* Disable enabled variant

* Disable border spacing utilities

* Disable text-start/end utilities

* Disable poll option in CLI

* Disable ring color default fn

* Disable dark mode class name customization

* Disable support for `Document` node types

* Disable rgb/hsl fns

* Update tests

* Temporarily disable type generation

* Update changelog
2022-04-12 13:58:57 -04:00
Juan Martín Seery
dbb5b1d8f7
Added border-spacing utility (#7102)
* Added `border-spacing` utility

* Update to base CSS variable approach

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
2022-03-04 11:20:23 -05:00
Jonathan Reinink
ec911c73f0 Improve order of color properties in transition and transition-colors utilities 2021-12-15 14:09:27 -05:00
Jonathan Reinink
1c7a793c94 Update order of color properties in transition and transition-colors utilities 2021-12-15 13:49:13 -05:00
Felix Klein
9934174867
Add 'text-decoration-color' to default 'transition' and 'transition-colors' utilities (#6405)
* Add 'text-decoration-color' to default 'transition' and 'transition-colors' utilities

* Add 'text-decoration-color' to default 'transition' and 'transition-colors' utilities

* Delete tailwind-output-flagged.css

* Delete tailwind-output-important.css

* Delete tailwind-output-no-color-opacity.css

* Delete tailwind-output.css

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
2021-12-15 13:44:51 -05:00
Jonathan Reinink
8c9b635894
Remove aspect-attrs utility (#6228) 2021-12-01 06:16:12 -05:00
Oscar Lee-Vermeren
d22604af04
Add remaining text-decoration utilities (#6004)
* Add `text-decoration-style` utilities

* Add remaining `text-decoration` utilities

* Add test for default underline offset

* Remove text-underline-position, don't rename underline utilities, remove DEFAULT values for decoration thickness and underline offset

* Add auto/from-font values, update tests

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2021-11-24 12:13:08 -05:00
Peter Neupauer
0c4af0febc
Add aspect ratio dimensions value (#6178)
* Add aspect ratio `dimensions` value

* Update defaultConfig.stub.js

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
2021-11-23 15:20:54 -05:00
Adam Wathan
d1f066d97a
Add support for colored box shadows (#5979)
* WIP

* add box shadow parser

* use box shadow parser

* Update default shadows, add boxShadowColor key, add shadow datatype

* Update tests

* add `valid` flag to `boxShadow` parser

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2021-11-04 10:14:13 -04:00
Adam Wathan
f9fb2cec12
Add full color palette for fill/stroke (#5933)
Historically we've only included `fill-current` and `stroke-current` due to file size considerations, and recommended combining them with text color utilities like this:

```html
<svg class="fill-current text-blue-500">
```

With the JIT engine, there's no real reason for this anymore, so this PR enables all colors by default, allowing you to write this out of the box instead:

```html
<svg class="fill-blue-500">
```

Giddy up.
2021-11-03 10:51:57 -04:00
Jonathan Reinink
bf59a88c3e
Add new outline style, color, width and offset utilities (#5887)
* Add new outline style, color, width and offset utilities

Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>

* Remove old `outline` property from default config

Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>

* Tweak order of outline plugins

Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>

* Revert to previous `outline-none` styles

Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>

* Drop quotes from outline property

* Add offset back to `outline-none` utility

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2021-10-27 10:21:24 -04:00
MichaelAllenWarner
8259dfdf48
Add text-decoration-color utilities (#5760)
* utilities and tests in place for textDecorationColor and textDecorationOpacity

* change 'backgroundColor' to 'textDecorationColor' in corePlugin declaration for latter

* remove explicit textDecorationOpacity utility (the JIT slash syntax suffices)

Co-authored-by: Michael Warner <michaelwarner@Michaels-MacBook-Pro.local>
2021-10-12 13:35:59 -04:00
Sung M. Kim
10886b3a35
Support all utilities in JIT mode: https://github.com/tailwindlabs/tailwindcss/discussions/5724 (#5734) 2021-10-09 09:46:58 -04:00
Luke Warlow
f2d2a0e3cd
Add min-content and max-content utilities for (min/max) height (#5729) 2021-10-07 09:13:50 -04:00
Luke Warlow
31a9860fe5
Add fit-content utilities for (min/max) height and width (#5638) 2021-10-07 06:08:22 -04:00
Adam Wathan
97062c398b
Make negative values a first-class feature, rather than theme-driven (#5709)
* WIP

* Add failing test for negating default values

* Add dynamic negative value opt-in (#5713)

* Add `supportsNegativeValues` plugin option

* Update `getClassList` to support dynamic negative values

* Add test for using a negative scale value with a plugin that does not support dynamic negative values

* Support dynamic negation of `DEFAULT` values (#5718)

* Add test case

Co-authored-by: Brad Cornes <bradlc41@gmail.com>
2021-10-06 13:42:05 -04:00
Adam Wathan
a2676b0544
Add flex-basis utilities (#5671) 2021-10-04 15:47:14 -04:00
Adam Wathan
61f881fca1 Remove darkMode from simpleConfig 2021-09-30 15:26:13 -04:00
Adam Wathan
601bc5fc43 Standardize default config to use unified callback argument syntax 2021-09-30 15:25:54 -04:00
Jonathan Reinink
753d3f146c
Add scroll-snap utilities (#5637)
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Peter Jonsson <4572231+95jonpet@users.noreply.github.com>
Co-authored-by: Enzo Innocenzi <enzo@innocenzi.dev>
2021-09-29 09:57:26 -04:00
Adam Wathan
4efc5971f7
Add inherit to color palette (#5597)
Re-implementation of #2706.

Co-Authored-By: Jorge González <yo@jorgeglz.io>

Co-authored-by: Jorge González <yo@jorgeglz.io>
2021-09-26 10:09:43 -04:00
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
Brad Cornes
4919cbfbb8
Update color parsing and formatting (#5442)
* Replace `culori` with simple color parser

* Use space-separated color syntax

* Update default color values to use space-separated syntax

* Update separator regex

* Fix tests

* add tests for the new `color` util

Also slightly modified the `color` util itself to take `transparent`
into account and also format every value as a string for consistency.

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2021-09-09 16:15:53 +02:00
Jonathan Reinink
12fa78b9ca
Add column utilities (#5457)
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-Authored-By: Cody <codytooker@gmail.com>
2021-09-09 09:29:44 -04:00
Jonathan Reinink
1c10cf261b
Add text-indent utilities (#5449)
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2021-09-08 15:16:46 -04:00
Jonathan Reinink
b04dab6be6
Add will-change utilities (#5448)
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2021-09-08 14:50:31 -04:00
Luke Warlow
51f71af62c
Add accent-color utilities (#5387)
* Add accent-color utilities

* Address comments
2021-09-07 21:07:54 -04:00
Adam Wathan
db8b449a67
Enable extended color palette (#5384)
Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com>

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2021-09-06 14:29:03 -04:00
Jonathan Reinink
e9cde3a070
Add native aspect ratio support (#5359) 2021-09-02 08:32:02 -04:00
Robin Malfait
691ed02f63
Remove AOT (#5340)
* make `jit` mode the default when no mode is specified

* unify JIT and AOT codepaths

* ensure `Object.entries` on undefined doesn't break

It could be that sometimes you don't have values in your config (e.g.: `presets: []`), this in turn will break some plugins where we assume we have a value.

* drop AOT specific tests

These tests are all covered by JIT mode already and were AOT specific.

* simplify tests, and add a few

Some of the tests were written for AOT specifically, some were missing. We also updated the way we write those tests, essentially making Tailwind a blackbox, by testing against the final output.
Now that JIT mode is the default, this is super fast because we only generate what is used, instead of partially testing in a 3MB file or building it all, then purging.

* add some todo's to make sure we warn in a few cases

* make `darkMode: 'media'`, the default

This also includes moving dark mode tests to its own dedicated file.

* remove PostCSS 7 compat mode

* update CLI to be JIT-first

* fix integration tests

This is not a _real_ fix, but it does solve the broken test for now.

* warn when using @responsive or @variants

* remove the JIT preview warning

* remove AOT-only code paths

* remove all `mode: 'jit'` blocks

Also remove `variants: {}` since they are not useful in `JIT` mode
anymore.

* drop unused dependencies

* rename `purge` to `content`

* remove static CDN builds

* mark `--purge` as deprecated in the CLI

This will still work, but a warning will be printed and it won't show up
in the `--help` output.

* cleanup nesting plugin

We don't have to duplicate it anymore since there is no PostCSS 7
version anymore.

* make sure integration tests run in band

* cleanup folder structure

* make sure nesting folder is available

* simplify resolving of purge/content information
2021-09-01 17:13:59 +02:00
Adam Wathan
f20655c2d3
Fix backdrop opacity variants (#4892)
We weren't generating backdrop opacity variants properly due to a typo in the default config.
2021-07-04 09:50:14 -04:00
Adam Wathan
ff64417ff7
Add blur-none with intent to deprecate blur-0 (#4614)
We always use `none` for other utilities where the values have string names like `sm`, but for `blur` I chose `blur-0` for some idiotic reason. Can't have that.
2021-06-10 12:13:19 -04:00
Adam Wathan
77dfac2bfa
JIT: Add caret-color utilities (#4499)
Co-Authored-By: Jesse Katsumata <niconico.clarinet@gmail.com>

Co-authored-by: Jesse Katsumata <niconico.clarinet@gmail.com>
2021-05-28 13:55:42 -04:00
Adam Wathan
c8a5f816f4
JIT: Add support for before/after pseudo-elements (#4461) 2021-05-26 08:57:02 -04:00
Mateusz
f89bf5f4a6
Add :read-only variant (#4102)
* Add :read-only variant

* Added read-only variant to defaultConfig.stub

Co-authored-by: FunnyScarf <5177092+dyzajash@users.noreply.github.com>
2021-05-11 15:29:23 -04:00
David Luhr
6c7f3c8f8c Add background-origin utilities (#4117)
* Add background-origin utilities

* Update fixtures

* Update basic usage test

* Change sort order for background origin

* Move background origin after other background properties
2021-05-07 13:56:14 -04:00
Adam Wathan
a05b36996b Add CSS filter support (#3923)
* Implement `filter` helper classes with all methods

* Rename filter plugins/utilities, drop filter opacity, add drop shadow

* Remove non-final default filter values

* Working on default filter values, add basic JIT support

* Working on blur values

* New blur values (these are ~okay)

* Match drop-shadow values to box-shadows by eye as best as possible

* Update tests

* Fix kitchen sink test

* Add filter variants configuration

* Move drop-shadow to end of filters list

Co-Authored-By: Peter Neupauer <peter@neupauer.sk>

* Add invert variants configuration

* Add backdrop-filter utilities

* Update tests

* Transition filters by default

* Alphabetize new config keys

* Optimize filter plugins for JIT + add arbitrary value support

Except for drop-shadow, will add that once we can think it through a bit.

Co-authored-by: Nick Schmidt <nick@kreativgebiet.com>
Co-authored-by: Peter Neupauer <peter@neupauer.sk>
2021-05-07 13:56:13 -04:00
Adam Wathan
f34214eccc Add mix-blend-mode and background-blend-mode utilities (#3920)
* Add mix-blend-mode utilities

* Rename mix-blend-mode utilities to `mix-blend-*`

Co-Authored-By: Peter Neupauer <peter@neupauer.sk>

* Add `background-blend-mode` utilities

Co-Authored-By: Peter Neupauer <peter@neupauer.sk>

Co-authored-by: Peter Neupauer <peter@neupauer.sk>
2021-05-07 13:56:13 -04:00
Adam Wathan
9c454e1d4b Add isolation utilities (#3914) 2021-05-07 13:56:12 -04:00
Adam Wathan
77ca74bb88 Add box-decoration-break utilities (#3911) 2021-05-07 13:56:12 -04:00
Adam Wathan
5b2d3ea056 Generate dark variants for ringOpacity by default 2021-05-07 13:56:10 -04:00
Yehuda Neufeld
0e4d8de0df Enable dark variants by default for opacity utilities (#2975)
* enable `dark` by default for opacity utilities

* removed `opacity`, as unneeded

* removed `ringOpacity`, as unneeded
2021-05-07 13:56:10 -04:00
Cameron Huntington
cb6a7fada3 alphabetize transformOrigin and transitionDuration properties (#2828) 2021-05-07 13:56:10 -04:00
Kevin Lang
7a295af48c add help cursor (#3199) 2021-05-07 13:56:09 -04:00