Skip to content

Bug: Validator can't parse custom variables in aspect-ratio fraction #313

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

Closed
tmb-github opened this issue Aug 24, 2021 · 5 comments
Closed

Comments

@tmb-github
Copy link

/*
It issues this error message when a CSS variable is used on either side of the fraction:
.aspect-ratio / is not a aspect-ratio value : / 3
*/

.aspect-ratio {
aspect-ratio: var(--x) / 3;
}

/* with fallback value in variable: */
.aspect-ratio {
aspect-ratio: var(--x, 2) / 3;
}

@MichaIng
Copy link

Already fixed with: #308

@tmb-github
Copy link
Author

@MichaIng No, it is not fixed. Run the code I supplied through the validator and you'll see. It complains:

/ is not a aspect-ratio value : / 3

...for both statements.

@MichaIng
Copy link

Ah sorry, I missed the detail that it is about the CSS variable and not about the attribute itself.

@ylafon
Copy link
Member

ylafon commented Aug 29, 2021

closing as duplicate of #315
Some work started in a new branch.
currently, aspect-ratio: var(--x) / 3; is ignored as we don't know the value of --x,
and aspect-ratio: var(--x, 4) / 3; should validate. (not deployed yet)

@ylafon ylafon closed this as completed Aug 29, 2021
@tmb-github
Copy link
Author

@ylafon It fails even if --x is defined. See Validator results on this CSS:

:root {
  --x: 1;
}

.aspect-ratio {
  aspect-ratio: var(--x) / 3;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants