The check of the custom properties of one slide
slide/1 does the work of Expresso.Overlay.PropertyVerifier, and it is a
pure function on an Expresso.Slide struct. It reads the state option and
the set option of each on entity of the slide, and it gives one warning
for each property that Expresso.Theme reports as a defect.
registered_state/2 does a part of the work of Expresso.Overlay.Verifier.
It refuses a state that takes the name of a property that the theme
registers.
docs/overlays.md gives the rules.
Summary
Functions
Give an error for a state that takes the name of a property that the theme registers
Give a warning for each custom property of a slide that is a defect
Types
@type warning() :: {String.t(), :erl_anno.anno()} | String.t()
A warning of the verifier, with the location of the on entity
Functions
@spec registered_state(Expresso.Slide.t(), %{required(String.t()) => String.t()}) :: :ok | {:error, String.t()}
Give an error for a state that takes the name of a property that the theme registers
The compiler registers each state as a number with the initial value 0, and
that registration replaces the registration of the theme. Each element of
the deck that reads the property then gets 0 in place of the initial value
of the theme, on each slide. The state scale is an example: each element
gets the size 0 × 0. The default registrations are those of the theme.
@spec slide(Expresso.Slide.t(), Expresso.Css.names()) :: [warning()]
Give a warning for each custom property of a slide that is a defect
The names come from the theme and from the CSS of the deck, which
Expresso.Css.merge/2 joins. The default is the theme alone. The function
reports these conditions:
- The
stateoption, or a key of thesetoption, names a property that the theme does not use. The renderer writes the property, and no rule of the theme reads it. Therefore the value has no effect. - The
stateoption names a property that the theme declares, or that the theme registers with a different syntax than a number. The compiler registers each state as a number with the initial value 0. That registration makes the value of the theme invalid, and the theme then loses the property. - A key of the
setoption names a registered property, and the value does not agree with the syntax of that registration. The browser then ignores the value, and the property keeps its initial value. A<length>needs a unit of length, an<angle>needs a unit of angle, and a<number>needs a plain number. A value with a CSS function, such asvar()orcalc(), and a CSS-wide keyword, such asinherit, get no warning, because the browser calculates them.
Each message holds the path of the slide. The function adds the location of
the on entity when Spark has it. A module of a test has no debug
information, and Spark then gives nil.