1177 Commits

Author SHA1 Message Date
Adam Wathan
44dbde8ea6 Don't return when updating declaration important 2020-08-28 08:49:33 -04:00
Keunbae Park
15bcb8bf18 fix missing return 2020-08-27 13:05:06 -04:00
Adam Wathan
1bc2fed3bd Tweak help text 2020-08-22 08:40:24 -04:00
Adam Wathan
ed3edf9129
Merge pull request #2225 from tailwindlabs/add-postcss-init-option
add tailwind -p init option to generate a postcss file
2020-08-22 08:38:35 -04:00
Adam Wathan
634a0e6a5f
Merge pull request #2211 from tailwindlabs/apply-to-rule-with-multiple-selectors
Fix issue where couldn't apply variant classes to rule with multiple selectors
2020-08-22 08:36:44 -04:00
Robin Malfait
939346d8b3
add tailwind -p init option to generate a postcss file 2020-08-22 01:43:47 +02:00
Robin Malfait
c79b0b936f
Merge pull request #2224 from tailwindlabs/fix-multiline-apply
Fix multiline @apply values
2020-08-22 00:23:36 +02:00
Robin Malfait
3bf6348523
split @apply values by spaces, tabs and newlines
Fixes: #2222
2020-08-22 00:09:46 +02:00
Adam Wathan
3839c74312 Remove unused import 2020-08-20 16:31:25 -04:00
Adam Wathan
86288cd90b Fix issue where couldn't apply variant classes to rule with multiple selectors 2020-08-20 16:29:07 -04:00
Joe Mooring
5362c65fcb Log to stderr instead of stdout
Fixes #2203
2020-08-20 09:37:22 -04:00
Adam Wathan
b17b51811f Remove unused function 2020-08-19 13:34:21 -04:00
Adam Wathan
b3db1053b5 Don't log anything for people who have opted in to future features 2020-08-19 13:28:04 -04:00
Adam Wathan
a7e19ca131 Pass opacityValue to gradient colors for transparency support, do not pass opacityVariable since unused 2020-08-19 11:38:22 -04:00
Adam Wathan
28930f4799 Merge branch 'fix/color-object-closures' of git://github.com/innocenzi/tailwindcss into innocenzi-fix/color-object-closures 2020-08-19 11:25:13 -04:00
Adam Wathan
2d090feb98 Only log purge notice once per process 2020-08-19 10:56:51 -04:00
Adam Wathan
ef149cfafb Optimize rebuilds in long-running processes 2020-08-19 10:21:26 -04:00
Adam Wathan
4228cf22be Don't issue duplicate flag notices in long running processes 2020-08-18 21:14:10 -04:00
Enzo Innocenzi
486772a82d
fix(gradientColorStops): correctly handle color closures 2020-08-18 22:35:29 +02:00
Enzo Innocenzi
0206d060e5
fix(colors): correctly flatten color closures 2020-08-18 22:35:10 +02:00
Adam Wathan
092009b508 Simplify flag logging 2020-08-18 13:23:08 -04:00
Adam Wathan
f32ae238ef Merge branch 'master' of github.com:tailwindlabs/tailwindcss 2020-08-18 09:06:35 -04:00
Adam Wathan
fdf468998f Fix issue where motion variants incorrectly stack with group-hover variants 2020-08-18 09:03:32 -04:00
Robin Malfait
33ee64665d cache className resolve 2020-08-18 08:21:33 -04:00
Robin Malfait
fe70c89718 use append instead of prepend
Same idea, but prepend will internally reverse all nodes.
2020-08-18 08:21:33 -04:00
Robin Malfait
e417da262e cache clone rule
Otherwise every time we read this value it will be re-cloned
2020-08-18 08:21:33 -04:00
Robin Malfait
5260c71c60 only parse the className when needed 2020-08-18 08:21:33 -04:00
Robin Malfait
8ae2a32a0c hoist selectorParser setup code
No need to re-create the selectorParser in every call.
2020-08-18 08:21:33 -04:00
Robin Malfait
fab4d7b8f6 cache buildSelectorVariant 2020-08-18 08:21:33 -04:00
Robin Malfait
0631851b7b introduce a useMemo utility
Naming is hard so I took this name from the React hook 😎

Also use this useMemoy utility to make sure that the extractUtilityNames
is cached. There is no need to re-compute the utility names all the
time.
2020-08-18 08:21:33 -04:00
Robin Malfait
00f4427ea9 improvement cloning of the parent node
We used to clone the full tree and then remove all the children, this
was a bit too slow so therefore we will now create a new tree based on
the old information.
2020-08-18 08:21:33 -04:00
Robin Malfait
78df10020f hoist the selector parser
No need to re-create the selector parser in the loop for each selector.
2020-08-18 08:21:33 -04:00
Robin Malfait
309b8e5bb8 re-use the same tailwindApplyPlaceholder 2020-08-18 08:21:33 -04:00
Robin Malfait
e39fd6f2b3 remove the reversed orderedUtilityMap
We don't require this reversed map since we can already sort by the
index on the node directly. Therefore this can be dropped.
2020-08-18 08:21:33 -04:00
Robin Malfait
88888fd0f8 switch to a do {} while ()
We alreayd know that we have an `@apply` otherwise we would not have
called that function in the first place. Moving to a `do {} while ()`
allows us to skip 1 call to `hasAtRule(css, 'apply')`. Which is nice
because that skips a possible full traversal.
2020-08-18 08:21:33 -04:00
Robin Malfait
f2e3e22c6b make the cloning of the rule in the lookup table lazy
We create a big lookup table so that we can lookup the nodes by its
utilityName. This is used inside the recursive `@apply` code.

This big lookup table will clone every single rule and put it in,
however we don't need to clone everything! We are only interested in the
rules that have been actually applied.

This way we make the cloning of the rule lazy and only when we use this
exact rule.

There is an additional performace "issue" though: When we read the same
rule multiple times, it will clone every time you read from that object.
We could add additional memoization stuff, but so far it doesn't seem to
be the bottleneck. Therefore I've added a perf todo just to leave a mark
when this becomes the bottleneck.
2020-08-18 08:21:33 -04:00
Robin Malfait
5564e0b493 remove unused containsApply check
Currently we will walk the tree for every single rule to see if an
`@apply` exists somewhere in that tree. However we don't use the
`containsApply` anymore so this is a quick win!
2020-08-18 08:21:33 -04:00
Robin Malfait
aa7ae6af37 re-use classNameParser
We were re-creating the classNameParser inside the loop. Since that code
is all pretty pure we can hoist it so that we don't have to recreate
that parser all the time.
2020-08-18 08:21:33 -04:00
Robin Malfait
8c7fb84e58 bail out of the applyComplexClasses when it is not needed
There is no need in re-compiling tailwind or building expensive lookupt
tables when it turns out that we don't even need it.

We have a small overhead by walking the tree to check if `@apply`
exists. However this outweighs the slowness of re-generating tailwind +
expensive lookup tables.
2020-08-18 08:21:33 -04:00
Adam Wathan
7945f0f7c8
Merge pull request #2176 from tailwindlabs/gradients
Add background gradient support
2020-08-18 08:06:50 -04:00
Adam Wathan
1d2dd1a5f4
Merge pull request #1965 from juno-w/master
Divide border style
2020-08-17 21:13:49 -04:00
Adam Wathan
4ca48dbde5 Add catch arg 2020-08-17 14:18:42 -04:00
Adam Wathan
926b6b1fab Rename mid color stop to via 2020-08-17 13:25:18 -04:00
Adam Wathan
8d87445b81 Improve API, support auto-transparent to, rename gradientColor plugin 2020-08-17 11:05:06 -04:00
Adam Wathan
7fb5d4a579 Add support for background images and 2/3-color-stop gradients 2020-08-16 15:23:49 -04:00
Adam Wathan
488c0e35c9 Don't include vendor prefix for background-clip: text
Better to rely on autoprefixer for this for now. If we want to start shipping prefixes we should do it across the board, not just in one spot.
2020-08-15 16:24:21 -04:00
Adam Wathan
5b82b6f5ac Add background-clip utilities 2020-08-15 16:20:33 -04:00
Adam Wathan
8a066c27a2 Merge branch 'apply-complex-classes' 2020-08-15 15:39:48 -04:00
Adam Wathan
6b32635f2c Explain other code branch when processing @apply rules 2020-08-15 15:39:39 -04:00
Adam Wathan
9d257a986c Rename inject instances to apply 2020-08-15 15:31:26 -04:00