Skip to main content

Module values

Module values 

Source
Expand description

Typed values: CSS Values and Units Level 4’s numbers, dimensions and math functions, CSS Color Level 4’s colors, and the value definition syntax every property’s grammar is written in.

Structs§

Absolute
A colour with numbers for channels, None where one is missing.
Channels
A color with channels: everything but the keywords that stand for one.
CustomProperties
An element’s custom properties, as declared.
GuaranteedInvalid
The guaranteed-invalid value turned up where a value was needed: a var() with nothing to stand for and no fallback.
InvalidValue
The value didn’t match the property’s grammar, or the property isn’t one the specs define.
Math
A math function’s value: its simplified calculation tree.
PropertyData
One property, as its spec defines it.
Relative
A relative color: an origin color and channels that may name the origin’s, kept as written until there’s a value to work them out from.
Resolved
Custom properties with every var() in them substituted. A name that maps to None holds the guaranteed-invalid value.

Enums§

Channel
One channel: a number, none, or a math function that couldn’t be worked out yet.
Color
A <color>.
Component
One typed value in a property’s value.
CssWide
The CSS-wide keywords, which every property takes.
Expect
What a value must be, for Math::fits.
Grammar
A grammar, parsed.
Kind
What a dimension measures.
Leaf
A number, a percentage or a dimension: a calculation’s leaves.
MathFunction
A math function other than calc(), which only groups.
Model
How a color’s channels are to be read.
Node
A calculation tree, CSS Values 4 §10.8.
Predefined
A color() space.
RelativeChannel
One channel of a relative color, as written.
Rounding
round()’s rounding strategy.
Space
A colour space a colour can be worked out in.
Specified
A property’s specified value.
Unit
A unit, from the dimension tokens CSS knows.

Functions§

expand
Parses a shorthand’s value and splits it into a value for each of its longhands, in the order the spec lists them; a longhand the value leaves out gets its initial value. A longhand that is itself a shorthand (border-width in border) is followed by its own. A longhand gives itself.
number_to_string
write_number into a new string.
parse_declaration_value
Parses a declaration’s value for its property.
parse_value
Parses value as a value of property, -- custom properties included.
properties
Every property in the table, sorted by name.
property
Looks a property up by name, ignoring ASCII case.
substitute
Replaces every var() in value from custom.
substitute_value
Substitutes var() in a property’s value and parses what results, as computing a value with var() in it does. An error is “invalid at computed-value time”, which the cascade turns into unset.
write_components
Writes typed values as CSSOM serializes a specified value: separated by spaces, commas followed by one.
write_number
A number, a value with a unit, written as CSSOM serializes one: to six significant figures, without an exponent, -0 as 0.

Type Aliases§

Property
A property: PropertyData with its grammar parsed.