aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/format/css/style.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/data/format/css/style.lux')
-rw-r--r--stdlib/source/library/lux/data/format/css/style.lux36
1 files changed, 36 insertions, 0 deletions
diff --git a/stdlib/source/library/lux/data/format/css/style.lux b/stdlib/source/library/lux/data/format/css/style.lux
new file mode 100644
index 000000000..5f2c68888
--- /dev/null
+++ b/stdlib/source/library/lux/data/format/css/style.lux
@@ -0,0 +1,36 @@
+(.module:
+ [library
+ [lux #*
+ [data
+ [text
+ ["%" format (#+ format)]]]
+ [type
+ abstract]]]
+ ["." // #_
+ ["#." value (#+ Value)]
+ ["#." property (#+ Property)]])
+
+(abstract: #export Style
+ Text
+
+ {#.doc "The style associated with a CSS selector."}
+
+ (def: #export empty
+ Style
+ (:abstraction ""))
+
+ (def: #export separator
+ " ")
+
+ (def: #export (with [property value])
+ (All [brand]
+ (-> [(Property brand) (Value brand)]
+ (-> Style Style)))
+ (|>> :representation
+ (format (//property.name property) ": " (//value.value value) ";" ..separator)
+ :abstraction))
+
+ (def: #export inline
+ (-> Style Text)
+ (|>> :representation))
+ )