gws.lib.style.core¶
Style object and constructors.
Source code: gws.lib.style.core
Module Contents¶
- class gws.lib.style.core.Config(*args, **kwargs)¶
Bases:
gws.ConfigFeature style
- values: dict | None¶
style values
- gws.lib.style.core.from_config(cfg: gws.Config, opts: gws.lib.style.parser.Options = None) Object¶
Create a style object from a configuration.
- Parameters:
cfg – Style configuration.
opts – Parser options. Defaults to trusted and strict.
- Returns:
A style object.
- Raises:
gws.Error – If a property or value is invalid and the parser is strict.
- gws.lib.style.core.from_dict(d: dict, opts: gws.lib.style.parser.Options = None) Object¶
Create a style object from a dict.
The dict can contain
cssSelector,text(CSS text) andvalues(a dict of style values). Values fromvaluesoverride those parsed fromtext.- Parameters:
d – A dict with style properties.
opts – Parser options. Defaults to untrusted and strict.
- Returns:
A style object.
- Raises:
gws.Error – If a property or value is invalid and the parser is strict.
- gws.lib.style.core.from_props(props: gws.Props, opts: gws.lib.style.parser.Options = None) Object¶
Create a style object from client properties.
- Parameters:
props – Style properties.
opts – Parser options. Defaults to untrusted and non-strict.
- Returns:
A style object.