D.A.B.Tv0.0.33 Tutorial API DABT Tools ↗ GitHub ↗

tui.load_theme

tui.load_theme FILE

Loads a stylesheet into the class table. <theme src="…"/> calls it.

Returns: 1 and a message on stderr when FILE can’t be read or parsed.

Notes

  • Rules merge into one table: a later file overrides the fields it sets, and nothing is removed. Classes from a theme loaded on an earlier page stay defined.
  • Each file is parsed once per process and re-applied from memory until its mtime, or the mtime of a file it imports, changes.
  • @import "other.css"; (or @import url("other.css");) applies another stylesheet at that line. The path is relative to the importing file, or absolute. Fields the importing file sets afterwards override the imported ones; the rest are kept. An unreadable file is skipped with a warning, and imports nested more than 8 deep (cycles) are cut off.
  • The app-wide overlay from tui.theme.set is re-applied after every stylesheet, so it always wins.
  • Widgets already styled with tui.class keep their old colors; load themes before applying classes.
  • Class names that collide with a widget or pane style are logged as warnings.

See also: tui.class