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
Fix declaration-block-no-redundant-longhand-properties
false positives for inherit
keyword
#6419
Conversation
🦋 Changeset detectedLatest commit: f442a05 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kimulaco Thank you for creating the pull request. Adding a note about inherit
to the rule doc is a nice idea!
I've left a few trivial suggestions, but this change almost looks good. 👍🏼
lib/rules/declaration-block-no-redundant-longhand-properties/index.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
I've requested a change to the docs.
You should use a longhand property to have only the specific value inherited. So, the following patterns are also not considered problems: | ||
|
||
<!-- prettier-ignore --> | ||
```css | ||
a { | ||
margin-top: 1px; | ||
margin-right: 2px; | ||
margin-bottom: 3px; | ||
margin-left: inherit; | ||
} | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this as our patterns don't tend to show edge cases.
We can add something to do extended description at the top instead. For example, expand the following line
This rule will only complain if you've used the longhand equivalent of all the properties that the shorthand will set.
To:
"This rule will only complain if you've used the longhand equivalent of all the properties that the shorthand will set and if their values are not inherit
."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes. LGTM.
Closes #6394
I think this CSS spec is often overlooked. So, I added a description and example to the docs. 94a21c3