validator icon indicating copy to clipboard operation
validator copied to clipboard

CSS “aspect-ratio: 1” is being incorrectly marked as an error

Open simevidas opened this issue 3 years ago • 6 comments

URL being validated or code to reproduce error: https://webplatform.news

    Error: CSS: aspect-ratio: 1 is not a aspect-ratio value.

    At line 106, column 17

     aspect-ratio: 1;↩}↩↩/* MAIN *
Screenshot 2022-08-05 at 08 41 41

Link to report: https://validator.w3.org/nu/?doc=https%3A%2F%2Fwebplatform.news

simevidas avatar Aug 05 '22 06:08 simevidas

OK, pinging @ylafon, since I can reproduce this at https://jigsaw.w3.org/css-validator/validator?uri=https://webplatform.news/ — so this issue isn’t specific to the HTML checker but instead is an upstream issue with the CSS-checking backend.

sideshowbarker avatar Oct 29 '22 07:10 sideshowbarker

Indeed, the definition of ratio in the css validator is way outdated. I opened an issue to track that.

ylafon avatar Oct 29 '22 10:10 ylafon

@ylafon do we have any roadmap for this?

onlinebizsoft avatar May 17 '23 04:05 onlinebizsoft

Hi, this is still failing, values like aspect-ratio: 1, aspect-ratio: 1.5 or aspect-ratio: 2.666666667 will fail but all will pass if we explicitly add the height denominator: aspect-ratio: 1/1, aspect-ratio: 1.5/1, etc., which shouldn't be needed as the spec says it defaults to 1.

Captura de pantalla 2023-12-07 a las 10 29 42

jaimeiniesta avatar Dec 07 '23 09:12 jaimeiniesta

Let me just add, that aspect-ratio: 1; is also how core WordPress outputs its square 1:1 aspect ratio, meaning the editor or content creator has no influence on the markup, and can not, for instance, just enter 1:1 (instead of just 1), to satisfy the validator.

Meaning all square aspect ratios, often used for thumbnails, headshots etc in WordPress, will cause false positive when validating.

That, again, means we've got not choice but to tell people to ignore the errors in the validator, and that is a slippery slope, as valid HTML is a cornerstone of accessible web development.

🤔

oldrup avatar Dec 11 '23 08:12 oldrup

Just to note that it was fixed upstream (see right above).

ylafon avatar Apr 09 '24 07:04 ylafon