From f3cdb47a96816095cbadb2a4d9a58ccdbd011c23 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Mon, 5 Aug 2024 13:59:51 -0300 Subject: [PATCH] Style interface --- src/styles.cr | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/styles.cr diff --git a/src/styles.cr b/src/styles.cr new file mode 100644 index 0000000..e4b8432 --- /dev/null +++ b/src/styles.cr @@ -0,0 +1,29 @@ +module Tartrazine + class Style + # These properties are tri-state. + # true means it's set + # false means it's not set + # nil means inherit from parent style + property bold : Bool? + property nobold : Bool? + property italic : Bool? + property notalic : Bool? + property underline : Bool? + + # These properties are either set or nil + # (inherit from parent style) + property background : String? + property border : String? + property color : String? + end + + class Theme + property name : String = "" + + styles = Hash{String => Style} + + # Get the style for a token. + def style(token) + end + end +end