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 stylelint rule to prevent usage of the order CSS property #61241

Closed
afercia opened this issue Apr 30, 2024 · 0 comments · Fixed by #61243
Closed

Add stylelint rule to prevent usage of the order CSS property #61241

afercia opened this issue Apr 30, 2024 · 0 comments · Fixed by #61243
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] In Progress Tracking issues with work in progress [Type] Code Quality Issues or PRs that relate to code quality

Comments

@afercia
Copy link
Contributor

afercia commented Apr 30, 2024

Description

Previously:
#57519
#57640
#58936
#58940
#58942
#59013

Part of an effort to remove all the order CSS properties from the codebase.

For accessibility, visual/reading and DOM order must always match when they affect reading order and interaction. Basically thisis almost always the case. There's very limited cases where the order property can be used without affecting accessibility, for example when switching the position of an aria-hidden icon, or similare cases where the impact is only 'visual'.

To prevent future usages of the order CSS property, I'd like to propose to:

  • Add a stylelint config or rule to trigger an error when an order property is found.
  • In the rare cases where a stylelint-disable comment would be appropriate, require to specifi a disable reason.
  • As far as I can tell, requiring a description for the disable reason in the comments is a 'global' configuration of stylelint so that will require to add a disable reason to all the stylelint-disable comments, which is a good thing anyways.

Currently, there are 2 occurrences of the order css property, here and here. They're both tracked in specific issues and they will be likely removed soon. Other occurrences have been removed already.

Step-by-step reproduction instructions

  • Run npm run lint:css in yout terminal, in the project root.
  • Observe stylelint doesn't report any error or warning for the usage of the order CSS property.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@afercia afercia added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Code Quality Issues or PRs that relate to code quality labels Apr 30, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] In Progress Tracking issues with work in progress [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant