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

Ensure all plugins are executed for a given candidate #6540

Merged
merged 2 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Nothing yet!
### Fixed

- Support square bracket notation in paths ([#6519](https://github.com/tailwindlabs/tailwindcss/pull/6519))
- Ensure all plugins are executed for a given candidate ([#6540](https://github.com/tailwindlabs/tailwindcss/pull/6540))

## [3.0.5] - 2021-12-15

Expand Down Expand Up @@ -35,7 +38,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix text decoration utilities from overriding the new text decoration color/style/thickness utilities when used with a modifier ([#6378](https://github.com/tailwindlabs/tailwindcss/pull/6378))
- Move defaults to their own always-on layer ([#6500](https://github.com/tailwindlabs/tailwindcss/pull/6500))
- Support negative values in safelist patterns ([#6480](https://github.com/tailwindlabs/tailwindcss/pull/6480))
- Support square bracket notation in paths ([#6519](https://github.com/tailwindlabs/tailwindcss/pull/6519))

## [3.0.2] - 2021-12-13

Expand Down
1 change: 0 additions & 1 deletion src/lib/generateRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ function* resolveMatchedPlugins(classCandidate, context) {
for (let [prefix, modifier] of candidatePermutations(candidatePrefix)) {
if (context.candidateRuleMap.has(prefix)) {
yield [context.candidateRuleMap.get(prefix), negative ? `-${modifier}` : modifier]
return
}
}
}
Expand Down
37 changes: 36 additions & 1 deletion tests/basic-usage.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs'
import path from 'path'

import { run, css } from './util/run'
import { html, run, css } from './util/run'

test('basic usage', () => {
let config = {
Expand All @@ -22,3 +22,38 @@ test('basic usage', () => {
expect(result.css).toMatchFormattedCss(expected)
})
})

test('all plugins are executed that match a candidate', () => {
let config = {
content: [{ raw: html`<div class="bg-green-light bg-green"></div>` }],
theme: {
colors: {
green: {
light: 'green',
},
},
},
corePlugins: { preflight: false },
}

let input = css`
@tailwind utilities;

.bg-green {
/* Empty on purpose */
}
`

return run(input, config).then((result) => {
expect(result.css).toMatchFormattedCss(css`
.bg-green-light {
--tw-bg-opacity: 1;
background-color: rgb(0 128 0 / var(--tw-bg-opacity));
}

.bg-green {
/* Empty on purpose */
}
`)
})
})