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 selector-pseudo-class-disallowed-list support for @page #8171

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

Mouvedia
Copy link
Member

@Mouvedia Mouvedia commented Dec 5, 2024

Which issue, if any, is this issue related to?

#1871

Is there anything in the PR that needs further explanation?

  1. :blank references

https://developer.mozilla.org/en-US/docs/Web/CSS/:blank
https://caniuse.com/mdn-css_selectors_-moz-only-whitespace
https://drafts.csswg.org/selectors-4/#blank-pseudo
web-platform-tests/interop#595
https://www.npmjs.com/package/css-blank-pseudo

  1. I tried using a combination of walkAtRules and walkRules instead of walk, the performance hit was negligible.

Copy link

changeset-bot bot commented Dec 5, 2024

🦋 Changeset detected

Latest commit: e0c5666

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +297 to 301
/*
introduced the 10/05/2016 by 8c808d0
as of 2024 it is still not supported by any browser
*/
'blank',
Copy link
Member Author

@Mouvedia Mouvedia Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having both :blank and :blank—line 219—could have been problematic if both were supported by at least one browser.
i.e. ['blank'] wouldn't differentiate between the two, which would be detrimental for our users


I am not removing it because #7510 hasn't been resolved yet.
i.e. the removal policy has not been proposed
I have added its mozilla prefixed counterpart though.

@Mouvedia Mouvedia marked this pull request as draft December 5, 2024 16:13
@Mouvedia Mouvedia requested a review from romainmenke December 5, 2024 16:28
@Mouvedia Mouvedia marked this pull request as ready for review December 5, 2024 16:28
@Mouvedia Mouvedia requested a review from jeddy3 December 5, 2024 23:06
@jeddy3 jeddy3 changed the title Add @page support to selector-pseudo-class-disallowed-list Added: selector-pseudo-class-disallowed-list support for @page Dec 6, 2024
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

Minor suggestion, otherwise LGTM.

.changeset/fresh-seahorses-grab.md Outdated Show resolved Hide resolved
@Mouvedia Mouvedia changed the title Added: selector-pseudo-class-disallowed-list support for @page Add selector-pseudo-class-disallowed-list support for @page Dec 6, 2024
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

@jeddy3 jeddy3 merged commit 0d8ff86 into stylelint:main Dec 6, 2024
16 of 17 checks passed

if (!params.includes(':')) return;

const offset = `@page${node.raws.afterName ?? ''}`.length;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have used atRuleParamIndex.

renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Dec 16, 2024
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.11.0 | 16.12.0 |


## [v16.12.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16120)

-   Added: `selector-pseudo-class-allowed-list` now checks `@page` pseudo-classes ([#8176](stylelint/stylelint#8176)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Added: `selector-pseudo-class-disallowed-list` now checks `@page` pseudo-classes ([#8171](stylelint/stylelint#8171)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `at-rule-property-required-list` message to use "descriptor" for accuracy ([#8186](stylelint/stylelint#8186)) ([@ybiquitous](https://github.com/ybiquitous)).
-   Fixed: `custom-property-no-missing-var-function` false positives for `container-name` ([#8157](stylelint/stylelint#8157)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `custom-property-no-missing-var-function` false positives for custom properties passed to `running()` ([#8172](stylelint/stylelint#8172)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `function-no-unknown` false positives for `running()` ([#8172](stylelint/stylelint#8172)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for `:open` ([#8184](stylelint/stylelint#8184)) ([@lukewarlow](https://github.com/lukewarlow)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for `:recto`, `:verso` and `:nth()` ([#8170](stylelint/stylelint#8170)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for some `moz-*` vendor-prefixed pseudo-classes ([#8188](stylelint/stylelint#8188)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-element-no-unknown` false positives for `::details-content` ([#8174](stylelint/stylelint#8174)) ([@lukewarlow](https://github.com/lukewarlow)).
-   Fixed: `selector-type-no-unknown` false positives for idents in functional pseudo-classes ([#8191](stylelint/stylelint#8191)) ([@elskhn](https://github.com/elskhn)).
-   Fixed: `value-keyword-case` false negatives ([#8158](stylelint/stylelint#8158)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `value-keyword-case` false positives for vendor-prefixed system colors ([#8146](stylelint/stylelint#8146)) ([@Mouvedia](https://github.com/Mouvedia)).
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Dec 16, 2024
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.11.0 | 16.12.0 |


## [v16.12.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16120)

-   Added: `selector-pseudo-class-allowed-list` now checks `@page` pseudo-classes ([#8176](stylelint/stylelint#8176)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Added: `selector-pseudo-class-disallowed-list` now checks `@page` pseudo-classes ([#8171](stylelint/stylelint#8171)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `at-rule-property-required-list` message to use "descriptor" for accuracy ([#8186](stylelint/stylelint#8186)) ([@ybiquitous](https://github.com/ybiquitous)).
-   Fixed: `custom-property-no-missing-var-function` false positives for `container-name` ([#8157](stylelint/stylelint#8157)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `custom-property-no-missing-var-function` false positives for custom properties passed to `running()` ([#8172](stylelint/stylelint#8172)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `function-no-unknown` false positives for `running()` ([#8172](stylelint/stylelint#8172)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for `:open` ([#8184](stylelint/stylelint#8184)) ([@lukewarlow](https://github.com/lukewarlow)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for `:recto`, `:verso` and `:nth()` ([#8170](stylelint/stylelint#8170)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for some `moz-*` vendor-prefixed pseudo-classes ([#8188](stylelint/stylelint#8188)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-element-no-unknown` false positives for `::details-content` ([#8174](stylelint/stylelint#8174)) ([@lukewarlow](https://github.com/lukewarlow)).
-   Fixed: `selector-type-no-unknown` false positives for idents in functional pseudo-classes ([#8191](stylelint/stylelint#8191)) ([@elskhn](https://github.com/elskhn)).
-   Fixed: `value-keyword-case` false negatives ([#8158](stylelint/stylelint#8158)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `value-keyword-case` false positives for vendor-prefixed system colors ([#8146](stylelint/stylelint#8146)) ([@Mouvedia](https://github.com/Mouvedia)).
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Dec 16, 2024
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.11.0 | 16.12.0 |


## [v16.12.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16120)

-   Added: `selector-pseudo-class-allowed-list` now checks `@page` pseudo-classes ([#8176](stylelint/stylelint#8176)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Added: `selector-pseudo-class-disallowed-list` now checks `@page` pseudo-classes ([#8171](stylelint/stylelint#8171)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `at-rule-property-required-list` message to use "descriptor" for accuracy ([#8186](stylelint/stylelint#8186)) ([@ybiquitous](https://github.com/ybiquitous)).
-   Fixed: `custom-property-no-missing-var-function` false positives for `container-name` ([#8157](stylelint/stylelint#8157)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `custom-property-no-missing-var-function` false positives for custom properties passed to `running()` ([#8172](stylelint/stylelint#8172)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `function-no-unknown` false positives for `running()` ([#8172](stylelint/stylelint#8172)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for `:open` ([#8184](stylelint/stylelint#8184)) ([@lukewarlow](https://github.com/lukewarlow)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for `:recto`, `:verso` and `:nth()` ([#8170](stylelint/stylelint#8170)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for some `moz-*` vendor-prefixed pseudo-classes ([#8188](stylelint/stylelint#8188)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-element-no-unknown` false positives for `::details-content` ([#8174](stylelint/stylelint#8174)) ([@lukewarlow](https://github.com/lukewarlow)).
-   Fixed: `selector-type-no-unknown` false positives for idents in functional pseudo-classes ([#8191](stylelint/stylelint#8191)) ([@elskhn](https://github.com/elskhn)).
-   Fixed: `value-keyword-case` false negatives ([#8158](stylelint/stylelint#8158)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `value-keyword-case` false positives for vendor-prefixed system colors ([#8146](stylelint/stylelint#8146)) ([@Mouvedia](https://github.com/Mouvedia)).
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Dec 16, 2024
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.11.0 | 16.12.0 |


## [v16.12.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16120)

-   Added: `selector-pseudo-class-allowed-list` now checks `@page` pseudo-classes ([#8176](stylelint/stylelint#8176)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Added: `selector-pseudo-class-disallowed-list` now checks `@page` pseudo-classes ([#8171](stylelint/stylelint#8171)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `at-rule-property-required-list` message to use "descriptor" for accuracy ([#8186](stylelint/stylelint#8186)) ([@ybiquitous](https://github.com/ybiquitous)).
-   Fixed: `custom-property-no-missing-var-function` false positives for `container-name` ([#8157](stylelint/stylelint#8157)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `custom-property-no-missing-var-function` false positives for custom properties passed to `running()` ([#8172](stylelint/stylelint#8172)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `function-no-unknown` false positives for `running()` ([#8172](stylelint/stylelint#8172)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for `:open` ([#8184](stylelint/stylelint#8184)) ([@lukewarlow](https://github.com/lukewarlow)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for `:recto`, `:verso` and `:nth()` ([#8170](stylelint/stylelint#8170)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for some `moz-*` vendor-prefixed pseudo-classes ([#8188](stylelint/stylelint#8188)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-element-no-unknown` false positives for `::details-content` ([#8174](stylelint/stylelint#8174)) ([@lukewarlow](https://github.com/lukewarlow)).
-   Fixed: `selector-type-no-unknown` false positives for idents in functional pseudo-classes ([#8191](stylelint/stylelint#8191)) ([@elskhn](https://github.com/elskhn)).
-   Fixed: `value-keyword-case` false negatives ([#8158](stylelint/stylelint#8158)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `value-keyword-case` false positives for vendor-prefixed system colors ([#8146](stylelint/stylelint#8146)) ([@Mouvedia](https://github.com/Mouvedia)).
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Dec 16, 2024
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.11.0 | 16.12.0 |


## [v16.12.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16120)

-   Added: `selector-pseudo-class-allowed-list` now checks `@page` pseudo-classes ([#8176](stylelint/stylelint#8176)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Added: `selector-pseudo-class-disallowed-list` now checks `@page` pseudo-classes ([#8171](stylelint/stylelint#8171)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `at-rule-property-required-list` message to use "descriptor" for accuracy ([#8186](stylelint/stylelint#8186)) ([@ybiquitous](https://github.com/ybiquitous)).
-   Fixed: `custom-property-no-missing-var-function` false positives for `container-name` ([#8157](stylelint/stylelint#8157)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `custom-property-no-missing-var-function` false positives for custom properties passed to `running()` ([#8172](stylelint/stylelint#8172)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `function-no-unknown` false positives for `running()` ([#8172](stylelint/stylelint#8172)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for `:open` ([#8184](stylelint/stylelint#8184)) ([@lukewarlow](https://github.com/lukewarlow)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for `:recto`, `:verso` and `:nth()` ([#8170](stylelint/stylelint#8170)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-class-no-unknown` false positives for some `moz-*` vendor-prefixed pseudo-classes ([#8188](stylelint/stylelint#8188)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `selector-pseudo-element-no-unknown` false positives for `::details-content` ([#8174](stylelint/stylelint#8174)) ([@lukewarlow](https://github.com/lukewarlow)).
-   Fixed: `selector-type-no-unknown` false positives for idents in functional pseudo-classes ([#8191](stylelint/stylelint#8191)) ([@elskhn](https://github.com/elskhn)).
-   Fixed: `value-keyword-case` false negatives ([#8158](stylelint/stylelint#8158)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `value-keyword-case` false positives for vendor-prefixed system colors ([#8146](stylelint/stylelint#8146)) ([@Mouvedia](https://github.com/Mouvedia)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants