Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for @apply with complex classes, including responsive and pseudo-class variants #2159

Merged
merged 20 commits into from Aug 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
36fc03b
Add initial support for applying variants and other complex classes
adamwathan Aug 12, 2020
d6e22b9
Remove leading dot from apply case in sanity test
adamwathan Aug 13, 2020
e313de6
Fix lint issues
adamwathan Aug 13, 2020
3d156cc
Explicitly don't support legacy cssnext `@apply` rules
adamwathan Aug 13, 2020
1c23b0a
Use lodash for flatMap
adamwathan Aug 13, 2020
ba9ee06
Remove unused expected
adamwathan Aug 13, 2020
6f1fb5c
Drop entries methods for lodash
adamwathan Aug 13, 2020
c252e33
Get shadow lookup working-ish with new apply approach
adamwathan Aug 13, 2020
8646c94
Prepend a shadow lookup table when no @tailwind rules are in the tree
adamwathan Aug 14, 2020
2cbc8e9
Add tests for all the new scenarios `@apply` now supports
adamwathan Aug 14, 2020
e03db68
Fix test typo
adamwathan Aug 14, 2020
b518dc3
Test applying classes with a prefix configured
adamwathan Aug 14, 2020
23ffa25
Avoid accidentally forgetting getProcessedPlugins arg when customizin…
adamwathan Aug 14, 2020
b527dcf
Improve test name
adamwathan Aug 14, 2020
577f536
Update tests that relied on changed implementation details
adamwathan Aug 14, 2020
cef0b84
Reorganize prototype code
adamwathan Aug 14, 2020
6fe745b
Improve comment
adamwathan Aug 14, 2020
e37b665
Support applying classes that occur multiple times in a single selector
adamwathan Aug 14, 2020
9d257a9
Rename inject instances to apply
adamwathan Aug 15, 2020
6b32635
Explain other code branch when processing `@apply` rules
adamwathan Aug 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion __tests__/applyAtRule.test.js
Expand Up @@ -13,7 +13,11 @@ const { utilities: defaultUtilities } = processPlugins(
)

function run(input, config = resolvedDefaultConfig, utilities = defaultUtilities) {
return postcss([substituteClassApplyAtRules(config, utilities)]).process(input, {
return postcss([
substituteClassApplyAtRules(config, () => ({
utilities,
})),
]).process(input, {
from: undefined,
})
}
Expand Down