Skip to content

[css-syntax] Should numbers have type integer whenever the actual value is an integer? #10238

Open
@romainmenke

Description

@romainmenke

See : https://drafts.csswg.org/css-syntax/#consume-number

Also mentioned in passing by @tabatkins here : #6471 (comment)

As a result of the current tokenizing rules these values have type number :

  • 10e3
  • 1000.0

While both arguably represent integer values.
Should the algorithm be updated to reflect this?

You can see the difference between numbers with type number and integer in action here : https://codepen.io/romainmenke/pen/GRLwLQy

Wrapping values of type number in a math expression already "normalizes" these into integers when possible. (e.g. z-index: calc(10e3) works)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Thursday morning

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions