css-validator icon indicating copy to clipboard operation
css-validator copied to clipboard

aspect-ratio not working

Open EmpireJones opened this issue 4 years ago • 3 comments

I'm not 100% sure that this syntax is valid, but some tool I'm using is converting "aspect-ratio: 3000 / 3000;" to "aspect-ratio:3e3/3e3".

This results in the errors:

  • "aspect-ratio": Unknown dimension.
  • "aspect-ratio": "/" is not a "aspect-ratio" value.

According to https://developer.mozilla.org/en-US/docs/Web/CSS/number, scientific notation should be valid for CSS numbers.

EmpireJones avatar Apr 29 '22 01:04 EmpireJones

It looks like this functionality is pretty broken in general;

As mentioned in the following comment, even things like "aspect-ratio:1;" and "aspect-ratio:1.5;" don't validate properly. https://github.com/w3c/css-validator/issues/287#issuecomment-1011074600

EmpireJones avatar Apr 29 '22 01:04 EmpireJones

The second part (aspect-ratio with one number only) has been fixed by ad4b7113e23746f82d60e54cf8fe644302b1e2a8. The number parsing needs to be addressed.

ylafon avatar Apr 09 '24 07:04 ylafon