Skip to content

Apply the range definition notation #7400

Closed
@cdoublev

Description

@cdoublev

I would like the range definition notation to be applied to value definitions whose interval is currently defined in prose. I can make pull request (a single or one per spec) if it helps to get this change sooner. The motivation is automatic parsing of value definition.

At least, the lists below can serve as a reference for the spec authors to update their definitions.

CSS property values

I excluded CSS 2 from my search.

Other CSS values

As noted in #7140, the range definition notation would need to be generalized in order to apply to a descriptor value or a value in a rule's prelude. I think it can be achieved with this change in CSS Syntax 3:

 Just like in property grammars, the notation `<foo>` refers to the "foo" grammar term, assumed to be defined elsewhere. Substituting the `<foo>` for its definition results in a semantically identical grammar.

+ For numeric data types, this type notation can annotate any range restrictions using the bracketed range notation described in [CSS Values](https://drafts.csswg.org/css-values-4/#numeric-ranges).

Multiple interval syntax

Some range definitions cannot be defined with the current notation because they have multiple intervals. It was not discussed in #355, where this notation comes from. I'm thinking of [x1,x2] [x3,x4] for this, which is similar but simpler than [x1,x2] ∪ [x3,x4] (union).

I thought there was a few more cases but I only found this one, so I guess I can live without this notation and implement a specific validation function for it.

  • [css-grid-1][css-grid-2] <grid-line>: auto | <custom-ident> | [<integer [-∞,-1] [1,∞]> && <custom-ident>?] | [span && [ <integer [1,∞]> || <custom-ident>]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions