Egui::StyleVars
Inherits Hash < Iterable < Enumerable < Reference < Object
A mergeable bag of style variables: Hash(String, StyleValue) with
typed getters (untyped keys simply stay invisible to a getter, so
typos degrade to "unset", never to a crash). Bags produced by
StyleSheet#resolve are shared caches — treat them as read-only.
Instance methods
Apply this bag onto a copy of base (the same key vocabulary
WidgetStyle#merge_over uses), mapping keys onto their Style
slots. background is deliberately NOT mapped here: it is
state-scoped, so state-painted widgets read it from the
state-merged bag through Widget#background_color instead of a
flat Style slot. Skips cloning for empty bags.
The four-sided box under prefix ("padding", "margin", …):
prefix.top/left/right/bottom, each side falling back to the
scalar prefix shorthand (CSS padding: 12px sets all sides),
missing sides to 0. Negative sides clamp to 0 — this layout
engine has no notion of "padding pulling content outside the
widget", so a negative value only made text overflow its rect.
Same, but nil when no box key is set at all (callers fall back to
their own default, e.g. Spacing#button_padding).
Integers coerce (CSS vibes: {"height" => 24} reads as 24.0).
The CSS box-shadow under prefix ("shadow" by default):
requires shadow.color (a shadow without a color is nothing),
everything else defaults — blur/spread/offset 0, outset. Flat
scalar keys like #box?, so the mergeable-bag cascade works per
key: a button:active rule may flip only shadow.inset and the
class defaults fill in the rest.