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

Regnize <ratio> CSS value #15339

Open
fisker opened this issue Sep 1, 2023 · 2 comments · May be fixed by #15906
Open

Regnize <ratio> CSS value #15339

fisker opened this issue Sep 1, 2023 · 2 comments · May be fixed by #15906
Labels
lang:css/scss/less Issues affecting CSS, Less or SCSS type:enhancement A potential new feature to be added, or an improvement to how we print something

Comments

@fisker
Copy link
Member

fisker commented Sep 1, 2023

Prettier 3.0.2
Playground link

--parser css

Input:

div {
  aspect-ratio: 16 / 9; 
  aspect-ratio: 16/ 9; 
  aspect-ratio: 16 /9; 
}

Output:

div {
  aspect-ratio: 16 / 9;
  aspect-ratio: 16/ 9;
  aspect-ratio: 16 /9;
}

Expected behavior:

They should format the same, properly

div {
  aspect-ratio: 16 / 9;
  aspect-ratio: 16 / 9;
  aspect-ratio: 16 / 9;
}

The <ratio> CSS data type

@fisker fisker added type:enhancement A potential new feature to be added, or an improvement to how we print something lang:css/scss/less Issues affecting CSS, Less or SCSS labels Sep 1, 2023
@FloEdelmann FloEdelmann linked a pull request Jan 10, 2024 that will close this issue
4 tasks
@alexander-akait
Copy link
Member

Just from my experience - most of developer prefer no spaces in ratio

@fisker
Copy link
Member Author

fisker commented Jan 23, 2024

@alexander-akait

Personally, I use space around /.

I did a search

It seems the space version is more popular? Update: No space version has more results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang:css/scss/less Issues affecting CSS, Less or SCSS type:enhancement A potential new feature to be added, or an improvement to how we print something
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants