lib/css/src/value/root.zig
daab053ee43316e1809a84551d573ddd1e5bf3d2
1 //! Typed CSS values and the sixteen byte declaration record they lower into.
2 //!
3 //! A stylesheet parses strings once at load. Everything downstream reads a
4 //! `Declaration`: a property word, a kind, a unit, a flag word, and two scalar
5 //! words. A directly authored inline style writes the same record without
6 //! parsing anything, so one representation serves both producers.
7 //!
8 //! Lengths, percentages, numbers, colours, and keywords fit the two scalar
9 //! words outright. A string keeps a byte offset and a length into the source
10 //! the stylesheet borrows, so no value owns heap memory.
11 //!
12 //! `parse` is driven by a `Grammar` tag rather than by a property identifier,
13 //! which keeps this namespace free of the property table and makes the value
14 //! reader testable one grammar at a time.
15
16 const parser = @import("parse.zig");
17 const scalar = @import("scalar.zig");
18
19 pub const color = @import("color.zig");
20
21 pub const Accept = parser.Accept;
22 pub const Declaration = scalar.Declaration;
23 pub const Grammar = scalar.Grammar;
24 pub const Keyword = scalar.Keyword;
25 pub const Kind = scalar.Kind;
26 pub const Unit = scalar.Unit;
27 pub const Value = scalar.Value;
28 pub const accepted = parser.accepted;
29 pub const flag_important = scalar.flag_important;
30 pub const hasVariable = parser.hasVariable;
31 pub const parse = parser.parse;
32 pub const wide = parser.wide;