Skip to main content

Module style_check

Module style_check 

Source
Expand description

The Box style whitelist as a validator: validateStyle of src/style.ts, keyed off the embedded catalog/style.json. The regexes of the TS are small hand-written parsers here (no regex engine).

Re-exports§

pub use crate::conditions::is_condition_key;
pub use crate::conditions::is_media_key;

Structs§

KeySpec
One style.json key spec.
StyleIssue

Statics§

STYLE_SPECS
Every whitelisted key → its spec (layout keys first, then visual).

Functions§

is_hex_color
^#([0-9a-fA-F]{6}|[0-9a-fA-F]{8}|[0-9a-fA-F]{3,4})$
is_transform
STYLE_TRANSFORM_PATTERN: one or more transform functions separated by ONE space, no leading or trailing space.
validate_style
Every rule the client resolver relies on: whitelisted keys, well-typed values, conditions one level deep, direction on the root only (root == Some(false) flags it; None = unknown, allowed).