### ----------------------------------------------------
### -- CSS::Module
### -- Licenses: Artistic-2.0
### -- Authors: David Warring
### -- File: lib/CSS/Module/CSS21/Gen/Grammar.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 2
-size {:i [ <length> ** 1..2 || [ auto | portrait | landscape ] & <keyw> ] }

#| speak-header: once | always
rule decl:sym<speak-header> {:i (speak\-header) ':' <val( rx{ <expr=.expr-speak-header> }, &?ROUTINE.WHY)> }
rule expr-speak-header {:i [ once | always ] & <keyw> }

#| speak-numeral: digits | continuous
rule decl:sym<speak-numeral> {:i (speak\-numeral) ':' <val( rx{ <expr=.expr-speak-numeral> }, &?ROUTINE.WHY)> }
rule expr-speak-numeral {:i [ digits | continuous ] & <keyw> }

#| speak-punctuation: code | none
rule decl:sym<speak-punctuation> {:i (speak\-punctuation) ':' <val( rx{ <expr=.expr-speak-punctuation> }, &?ROUTINE.WHY)> }
rule expr-speak-punctuation {:i [ code | none ] & <keyw> }

#| speak: normal | none | spell-out
rule decl:sym<speak> {:i (speak) ':' <val( rx{ <expr=.expr-speak> }, &?ROUTINE.WHY)> }
rule expr-speak {:i [ normal | none | spell\-out ] & <keyw> }

#| speech-rate: <number> | x-slow | slow | medium | fast | x-fast | faster | slower
rule decl:sym<speech-rate> {:i (speech\-rate) ':' <val( rx{ <expr=.expr-speech-rate> }, &?ROUTINE.WHY)> }
rule expr-speech-rate {:i [ <number> || [ x\-slow | slow | medium | fast | x\-fast | faster | slower ] & <keyw> ] }

#| stress: <number>
rule decl:sym<stress> {:i (stress) ':' <val( rx{ <expr=.expr-stress> }, &?ROUTINE.WHY)> }
rule expr-stress {:i <number> }

#| table-layout: auto | fixed
rule decl:sym<table-layout> {:i (table\-layout) ':' <val( rx{ <expr=.expr-table-layout> }, &?ROUTINE.WHY)> }
rule expr-table-layout {:i [ auto | fixed ] & <keyw> }

#| text-align: <align> | justify
rule decl:sym<text-align> {:i (text\-align) ':' <val( rx{ <expr=.expr-text-align> }, &?ROUTINE.WHY)> }
rule expr-text-align {:i [ <align> || justify & <keyw> ] }

#| text-decoration: none | [ underline || overline || line-through || blink ]
rule decl:sym<text-decoration> {:i (text\-decoration) ':' <val( rx{ <expr=.expr-text-decoration> }, &?ROUTINE.WHY)> }
rule expr-text-decoration {:i :my @*SEEN; [ none & <keyw> || [ [ underline & <keyw> <!seen(0)> | overline & <keyw> <!seen(1)> | line\-through & <keyw> <!seen(2)> | blink & <keyw> <!seen(3)> ]+ ] ] }

#| text-indent: <length> | <percentage>
rule decl:sym<text-indent> {:i (text\-indent) ':' <val( rx{ <expr=.expr-text-indent> }, &?ROUTINE.WHY)> }
rule expr-text-indent {:i [ <length> || <percentage> ] }

#| text-transform: capitalize | uppercase | lowercase | none
rule decl:sym<text-transform> {:i (text\-transform) ':' <val( rx{ <expr=.expr-text-transform> }, &?ROUTINE.WHY)> }
rule expr-text-transform {:i [ capitalize | uppercase | lowercase | none ] & <keyw> }

#| top: <length> | <percentage> | auto
rule decl:sym<top> {:i (top) ':' <val( rx{ <expr=.expr-top> }, &?ROUTINE.WHY)> }
rule expr-top {:i [ <length> || <percentage> || auto & <keyw> ] }

#| unicode-bidi: normal | embed | bidi-override
rule decl:sym<unicode-bidi> {:i (unicode\-bidi) ':' <val( rx{ <expr=.expr-unicode-bidi> }, &?ROUTINE.WHY)> }
rule expr-unicode-bidi {:i [ normal | embed | bidi\-override ] & <keyw> }

#| vertical-align: baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage> | <length>
rule decl:sym<vertical-align> {:i (vertical\-align) ':' <val( rx{ <expr=.expr-vertical-align> }, &?ROUTINE.WHY)> }
rule expr-vertical-align {:i [ [ baseline | sub | super | top | text\-top | middle | bottom | text\-bottom ] & <keyw> || <percentage> || <length> ] }

#| visibility: visible | hidden | collapse
rule decl:sym<visibility> {:i (visibility) ':' <val( rx{ <expr=.expr-visibility> }, &?ROUTINE.WHY)> }
rule expr-visibility {:i [ visible | hidden | collapse ] & <keyw> }

#| voice-family: [<generic-voice> | <specific-voice> ]#
rule decl:sym<voice-family> {:i (voice\-family) ':' <val( rx{ <expr=.expr-voice-family> }, &?ROUTINE.WHY)> }
rule expr-voice-family {:i [ [ <generic-voice> || <specific-voice> ] ]+% <op(',')> }

#| generic-voice: male | female | child
rule generic-voice {:i [ male | female | child ] & <keyw> }

#| specific-voice: <identifier> | <string>
rule specific-voice {:i [ <identifier> || <string> ] }

#| volume: <number> | <percentage> | silent | x-soft | soft | medium | loud | x-loud
rule decl:sym<volume> {:i (volume) ':' <val( rx{ <expr=.expr-volume> }, &?ROUTINE.WHY)> }
rule expr-volume {:i [ <number> || <percentage> || [ silent | x\-soft | soft | medium | loud | x\-loud ] & <keyw> ] }

#| white-space: normal | pre | nowrap | pre-wrap | pre-line
rule decl:sym<white-space> {:i (white\-space) ':' <val( rx{ <expr=.expr-white-space> }, &?ROUTINE.WHY)> }
rule expr-white-space {:i [ normal | pre | nowrap | pre\-wrap | pre\-line ] & <keyw> }

#| widows: <integer>
rule decl:sym<widows> {:i (widows) ':' <val( rx{ <expr=.expr-widows> }, &?ROUTINE.WHY)> }
rule expr-widows {:i <integer> }

#| width: <length> | <percentage> | auto
rule decl:sym<width> {:i (width) ':' <val( rx{ <expr=.expr-width> }, &?ROUTINE.WHY)> }
rule expr-width {:i [ <length> || <percentage> || auto & <keyw> ] }

#| word-spacing: normal | <length>
rule decl:sym<word-spacing> {:i (word\-spacing) ':' <val( rx{ <expr=.expr-word-spacing> }, &?ROUTINE.WHY)> }
rule expr-word-spacing {:i [ normal & <keyw> || <length> ] }

#| z-index: auto | <integer>
rule decl:sym<z-index> {:i (z\-index) ':' <val( rx{ <expr=.expr-z-index> }, &?ROUTINE.WHY)> }
rule expr-z-index {:i [ auto & <keyw> || <integer> ] }


