Re: [csswg-drafts] [css-syntax] Should numbers have type `integer` whenever the actual value is an integer? (#10238)

+1 to what is proposed here, I have personally run into many issues where this was a problem, and I know it's common enough that people are employing [crazy hacks like assigning the `<number>` to a dummy registered `--integer` property](https://css-tricks.com/using-absolute-value-sign-rounding-and-modulo-in-css-today/).

However, I’d go even further: instead of debating whether a `<number>` should be considered an `<integer>` if it’s an integer, IMO a better solution would be to allow a `<number>` to be used anywhere an `<integer>` is expected, and just be converted to an `<integer>` using some default rounding strategy (probably floor, which is what assigning to `--integer` does today). Then the point discussed here becomes moot as there are very few cases where it makes a difference.

-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10238#issuecomment-2137845193 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 29 May 2024 16:41:57 UTC