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

Fix column position for font-family-name-quotes rule #5955

Merged
merged 1 commit into from Mar 8, 2022

Conversation

ybiquitous
Copy link
Member

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

Extracted from #5725. This change should make it easier to support a column range.

Is there anything in the PR that needs further explanation?

This change fixes a column position of a font-family-name-quotes problem to include quotes.

a { font-family: "Arial"; }
/* Before:        ↑ */

a { font-family: "Arial"; }
/* After:        ↑ */

This change fixes a column position of a `font-family-name-quotes` problem to include quotes.

```css
a { font-family: "Arial"; }
/* Before:        ↑ */

a { font-family: "Arial"; }
/* After:        ↑ */
```
@@ -400,36 +436,26 @@ testRule({
code: 'a { font-family: "Lucida Grande", "Arial", "sans-serif"; }',
fixed: 'a { font-family: "Lucida Grande", "Arial", sans-serif; }',
message: messages.rejected('sans-serif'),
line: 1,
column: 45,
Copy link
Member Author

Choose a reason for hiding this comment

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

[note] I've removed checking a position from fix: true test cases since they are duplicated with the non-fix test cases above. No problems?

@@ -83,11 +85,16 @@ const makeMutableFontFamilies = (fontFamilies, decl) => {
const mutableNodes = [];

fontFamilies.forEach((fontFamily, idx) => {
const quote = 'quote' in fontFamily && fontFamily.quote;
Copy link
Member Author

Choose a reason for hiding this comment

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

[note] The StringNode#quote property holds an actual quote like " or '.

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!

@ybiquitous ybiquitous merged commit dbfc408 into main Mar 8, 2022
@ybiquitous ybiquitous deleted the fix-column-position-for-font-family-name-quotes branch March 8, 2022 09:26
@ybiquitous
Copy link
Member Author

@jeddy3 Thank you for the review! I've updated the changelog:

  • Fixed: font-family-name-quotes column position (#5955).

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.

None yet

2 participants