Egui::Ecss::Doc
Inherits Reference < Object
The parsed document: class rules (dotted paths → StyleClass)
plus element overrides (Id → ElementEntry). Built by
#record_* edits or .parse; written by #to_s.
Constructors
Lenient parse: whatever fully parses becomes a rule; everything else is a one-line STDERR warning (the file is live-edited in text editors — a half-typed declaration must not kill the app).
Class methods
The value spelling: colors as #rrggbbaa (the same lowercase
hex StyleSheet#dump uses), whole numbers without the .0.
"button:hover" → {"button", "hover"}; "button" → {"button", nil}.
Instance methods
Introspection for specs/tests: the base-or-state bag of a class rule, nil when absent or empty.
Merge one key into a class rule (creating the class on first
touch, like StyleSheet#rule).
Merge one key into an element override (state-scoped like the
class rules). name fills the entry's explicit id name when it
was only known by its raw value so far.
Merge one key into an element override (state-scoped like the
class rules). name is required: only explicitly-named widgets
are addressable across restarts, so a nil-name (auto-id) edit
is silently not recorded — it still applies live through the
Context, it just never persists to the file.
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Remove one key; true when the document changed. Drops the rule
entirely once every bag is empty, so the file never accumulates
button { } husks.
Remove one key from an element rule; true when something was actually dropped (empty bags and empty entries go away).