Egui::StyleSheet
Inherits Reference < Object
Constructors
Instance methods
The class for path, created on first touch (defining a child
never requires defining its ancestors first).
Introspection: print the whole tree (classes → states → keys with
values) — puts ctx.stylesheet or log it to see every key.
The class+state vars, merged in two cascade layers and cached:
the returned bag is the same object frame after frame until a
rule changes something — read it, do not mutate it.
- class layer (defaults): ancestor vars root→leaf — the more specific class wins per key;
- state layer: every matching state overlay root→leaf, merged on top — states ALWAYS override class defaults, and the leaf state wins among states (CSS: classes are defaults, pseudo-class rules beat them).
Define/extend a rule CSS-style: rule("sidebar.tab:selected", …)
splits into class "sidebar.tab" + state "selected". Merges into
whatever the selector already holds (per-key override) and drops
the resolve cache.
The raw (unmerged) state overlay defined for one class+state —
the state layer of the cascade, applied on top of the class
layer but under widget #style overrides.
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>
Drop the cached merges manually (after mutating a StyleClass
directly through []; rule does this itself).
Remove one key from a class/state rule (the inspector's "reset"): the slot goes back to inheriting the theme. Unset keys and unknown selectors are no-ops.