Skip to content

pseudo elements must be handled like complex selectors #495

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

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
changelogs
  • Loading branch information
romainmenke committed Jun 22, 2022
commit 28728ab48f340be7dec5ebf57c59efd96ba20a5c
4 changes: 4 additions & 0 deletions plugins/postcss-cascade-layers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes to PostCSS Cascade Layers

### Unreleased

- Fix selector order with any pseudo element. This plugin will no longer re-order selectors.

### 1.0.3 (June 4, 2022)

- Update `@csstools/selector-specificity` (major)
Expand Down
8 changes: 7 additions & 1 deletion plugins/postcss-is-pseudo-class/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Changes to PostCSS Is Pseudo Class

### Unreleased

- Fix selector order with any pseudo element.
- Fix transforming pseudo elements in `:is()`. Following the specification pseudo elements are invalid and we now transform to a known invalid pseudo element.
- Add `onPseudoElement` plugin option. Set `{ onPseudoElement: 'warning' }` to receive warnings when this plugin encounters an unprocessable pseudo element.

### 2.0.5 (June 4, 2022)

- Update `@csstools/selector-specificity` (major)

### 2.0.4 (May 17, 2022)

- Fix selector order with `:before` and other pseudo elements.
- Fix selector order with `:before` and other pseudo elements.

### 2.0.3 (May 11, 2022)

Expand Down
14 changes: 14 additions & 0 deletions plugins/postcss-is-pseudo-class/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,26 @@ postcss([

Warn when pseudo elements are used in `:is` pseudo class functions.

⚠️ Pseudo elements are always invalid and will be transformed to `::-csstools-invalid-<pseudo-name>`.

```js
postcss([
postcssIsPseudoClass({ onPseudoElement: 'warning' })
]).process(YOUR_CSS /*, processOptions */);
```

```css
:is(::after):hover {
order: 1.0;
}

/* becomes */

::-csstools-invalid-after:hover {
order: 1.0;
}
```

## ⚠️ Known shortcomings

### Specificity
Expand Down
4 changes: 4 additions & 0 deletions plugins/postcss-nesting/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes to PostCSS Nesting

### Unreleased

- Fix selector order with any pseudo element.

### 10.1.8 (June 4, 2022)

- Update `@csstools/selector-specificity` (major)
Expand Down
6 changes: 5 additions & 1 deletion plugins/postcss-pseudo-class-any-link/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changes to PostCSS Pseudo Class Any Link

### Unreleased

- Fix selector order with any pseudo element. This plugin will no longer re-order selectors.

### 7.1.4 (May 17, 2022)

- Fix selector order with `:before` and other pseudo elements.
- Fix selector order with `:before` and other pseudo elements.

### 7.1.3 (May 6, 2022)

Expand Down