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

CSS(src): Fix invalid example @font-face def #34655

Merged
merged 5 commits into from
Jul 6, 2024
Merged

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Jul 5, 2024

Description

Remove a format(); argument which was accidentally doubled while applying suggested changes during review of #20691. The CSS example as currently shown in the documentation is invalid, having format("opentype"); on its own in a @font-face definition (not as an argument to src:).

Motivation

Ensure that example CSS in the repo is valid and works as intended.

Additional details

This suggested change overlooked that format("opentype"); was present on a separate line immediately below the suggestion, and accidentally duplicated it when applied.

Related issues and pull requests

A `format();` argument was accidentally doubled when applying
suggested changes during review of mdn#20691.
@ferdnyc ferdnyc requested a review from a team as a code owner July 5, 2024 12:29
@ferdnyc ferdnyc requested review from estelle and removed request for a team July 5, 2024 12:29
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/xs [PR only] 0-5 LoC changed labels Jul 5, 2024
Copy link
Contributor

github-actions bot commented Jul 5, 2024

Preview URLs

(comment last updated: 2024-07-06 02:37:56)

@github-actions github-actions bot added size/s [PR only] 6-50 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Jul 6, 2024
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

Thanks!

@Josh-Cena Josh-Cena merged commit 0c0d0a2 into mdn:main Jul 6, 2024
8 checks passed
@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jul 6, 2024

@Josh-Cena Oh, cool, I see you figured out the same thing I eventually did — that putting the inline trailing CSS comments before the comma keeps Prettier from making a complete mess of them. 👍

(I ended up on quite the journey of discovery into Prettier's handling of comment placement, yesterday.)

@ferdnyc ferdnyc deleted the patch-1 branch July 6, 2024 07:12
@Josh-Cena
Copy link
Member

Yeah, it's always a fight😅

@chrisdavidmills
Copy link
Contributor

FYI you can also put -nolint at the start of the code fence to make prettier leave it alone, for example:

```css-nolint
CSS code here
```

@Josh-Cena
Copy link
Member

Yeah but here it's an example and there's no reason to not format it, other than needing time to figure out how to make it look good.

@chrisdavidmills
Copy link
Contributor

Yeah but here it's an example and there's no reason to not format it, other than needing time to figure out how to make it look good.

Agreed. The above is mainly useful when you end up in one of those situations where prettier has formatted most things correctly, but then does something weird to a couple of lines and you want it to chill out ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants