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

declaration-block-no-redundant-longhand-properties: support collapsing and new properties #6984

Closed
11 tasks
Mouvedia opened this issue Jun 26, 2023 · 8 comments
Closed
11 tasks
Labels
status: needs discussion triage needs further discussion

Comments

@Mouvedia
Copy link
Contributor

Mouvedia commented Jun 26, 2023

Reason

see #6958 (comment)

Collapsing

fixes for these properties:

  • padding
  • margin
  • border-radius
  • border-width

e.g. for border-radius

border-top-left-radius: 1px;
border-top-right-radius: 4px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 4px;

/* gets fixed to */

border-radius: 1px 4px 2px;
border-radius: 1px 4px 2px 4px;

/* this fix would be a bonus targetted to previous versions of stylelint */

border-radius: 1px 4px 2px;

New properties

support:

  • overflow
  • background-position
  • border-image-width
  • border-inline-width
  • border-block-width
  • offset-position
  • overscroll-behavior

These lists are not exhaustive and may be expanded by the PR submitter(s) if need be.
Id recommend to handle it in several separate PRs.

@ybiquitous
Copy link
Member

@Mouvedia Thanks for opening the discussion.

Just to confirm, should we provide this feature as an opt-in or not? I'm a bit concerned if there are any cases where people want to avoid shorthand with fewer values than 4, like border-radius: 1px 4px 2px.

@Mouvedia
Copy link
Contributor Author

Mouvedia commented Jun 27, 2023

I'm a bit concerned if there are any cases where people want to avoid shorthand with fewer values than 4

The only reasons I can come up with would apply to 4 values as well.
i.e. being explicit, easier to maintain

should we provide this feature as an opt-in or not?

I think it should be automatic if it's easy to implement.
i.e. the logic needs to be shared

@ybiquitous
Copy link
Member

Okay, I agree with supporting the collapsing without any option. 👍🏼

@jeddy3 jeddy3 removed the type: enhancement a new feature that isn't related to rules label Jun 27, 2023
@jeddy3
Copy link
Member

jeddy3 commented Jun 27, 2023

I believe we're describing our shorthand-property-no-redundant-values rule.

Demo


When opening issues, please:

  • use the appropriate template for bugs, feature requests or doc changes
  • limit the issue to one problem
  • follow our conventions for labels
  • follow our conventions for titles

As these help us all out.

@jeddy3 jeddy3 closed this as completed Jun 27, 2023
@ybiquitous
Copy link
Member

Sorry, I missed the existing rule shorthand-property-no-redundant-values. 😓

@jeddy3
Copy link
Member

jeddy3 commented Jun 27, 2023

We've a lot of rules and we can't be expected to remember them all 😄

@Mouvedia
Copy link
Contributor Author

@jeddy3 so the second part—new properties—is dismissed as well?

@jeddy3
Copy link
Member

jeddy3 commented Jun 27, 2023

Please open a dedicated new false negatives bug report issue following the conventions for titles and labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs discussion triage needs further discussion
Development

No branches or pull requests

3 participants