diff --git a/cstyle/transformers/ul/main.go b/cstyle/transformers/ul/main.go
index 244e0a3..e9fc21c 100644
--- a/cstyle/transformers/ul/main.go
+++ b/cstyle/transformers/ul/main.go
@@ -21 +21 @@ func Init() cstyle.Transformer {
- li.CStyle = v.CStyle
+ li.Style = v.Style
@@ -23,5 +23,5 @@ func Init() cstyle.Transformer {
- dot.CStyle["background"] = "#000"
- dot.CStyle["border-radius"] = "100px"
- dot.CStyle["width"] = "5px"
- dot.CStyle["height"] = "5px"
- dot.CStyle["margin-right"] = "10px"
+ dot.Style["background"] = "#000"
+ dot.Style["border-radius"] = "100px"
+ dot.Style["width"] = "5px"
+ dot.Style["height"] = "5px"
+ dot.Style["margin-right"] = "10px"
@@ -31,3 +31,3 @@ func Init() cstyle.Transformer {
- content.CStyle = v.CStyle
- content.CStyle = c.QuickStyles(&content)
- content.CStyle["display"] = "block"
+ content.Style = v.Style
+ content.Style = c.QuickStyles(&content)
+ content.Style["display"] = "block"
@@ -38,3 +38,3 @@ func Init() cstyle.Transformer {
- li.CStyle["display"] = "flex"
- li.CStyle["align-items"] = "center"
- li.CStyle = c.QuickStyles(&li)
+ li.Style["display"] = "flex"
+ li.Style["align-items"] = "center"
+ li.Style = c.QuickStyles(&li)
package ul
import (
"grim/cstyle"
"grim/element"
)
func Init() cstyle.Transformer {
return cstyle.Transformer{
Selector: func(n *element.Node) bool {
return n.TagName == "ul"
},
Handler: func(n *element.Node, c *cstyle.CSS) *element.Node {
// The reason tN (temporary Node) is used, is because we have to go through the n.Children and it makes it hard to insert/remove the old one
// its better to just replace it
// !ISSUE: make stylable
tN := n.CreateElement(n.TagName)
for _, v := range n.Children {
li := n.CreateElement("li")
li.CStyle = v.CStyle
dot := li.CreateElement("div")
dot.CStyle["background"] = "#000"
dot.CStyle["border-radius"] = "100px"
dot.CStyle["width"] = "5px"
dot.CStyle["height"] = "5px"
dot.CStyle["margin-right"] = "10px"
content := li.CreateElement("div")
content.InnerText = v.InnerText
content.CStyle = v.CStyle
content.CStyle = c.QuickStyles(&content)
content.CStyle["display"] = "block"
li.AppendChild(&dot)
li.AppendChild(&content)
li.Parent = n
li.CStyle["display"] = "flex"
li.CStyle["align-items"] = "center"
li.CStyle = c.QuickStyles(&li)
tN.AppendChild(&li)
}
n.Children = tN.Children
return n
},
}
}