Diff
diff --git a/cstyle/transformers/margin-block/main.go b/cstyle/transformers/margin-block/main.go
index 5ac485d..a82ddf4 100644
--- a/cstyle/transformers/margin-block/main.go
+++ b/cstyle/transformers/margin-block/main.go
@@ -12 +12 @@ func Init() cstyle.Transformer {
- return n.ComputedStyle["margin-block"] != "" || n.ComputedStyle["margin-block-start"] != "" || n.ComputedStyle["margin-block-end"] != ""
+ return n.GetStyle("margin-block") != "" || n.GetStyle("margin-block-start") != "" || n.GetStyle("margin-block-end") != ""
@@ -16,2 +16,2 @@ func Init() cstyle.Transformer {
- writingMode := n.ComputedStyle["writing-mode"]
- mb := parseMarginBlock(n.ComputedStyle["margin-block"])
+ writingMode := n.GetStyle("writing-mode")
+ mb := parseMarginBlock(n.GetStyle("margin-block"))
@@ -19,2 +19,2 @@ func Init() cstyle.Transformer {
- if n.ComputedStyle["margin-block-start"] != "" {
- mb[0] = n.ComputedStyle["margin-block-start"]
+ if n.GetStyle("margin-block-start") != "" {
+ mb[0] = n.GetStyle("margin-block-start")
@@ -22,2 +22,2 @@ func Init() cstyle.Transformer {
- if n.ComputedStyle["margin-block-end"] != "" {
- mb[1] = n.ComputedStyle["margin-block-end"]
+ if n.GetStyle("margin-block-end") != "" {
+ mb[1] = n.GetStyle("margin-block-end")
@@ -29,2 +29,2 @@ func Init() cstyle.Transformer {
- n.ComputedStyle["margin-left"] = mb[0]
- n.ComputedStyle["margin-right"] = mb[1]
+ n.SetStyle("margin-left", mb[0])
+ n.SetStyle("margin-right", mb[1])
@@ -34,5 +34,5 @@ func Init() cstyle.Transformer {
- n.ComputedStyle["margin-left"] = mb[1]
- n.ComputedStyle["margin-right"] = mb[0]
- } else if n.ComputedStyle["margin"] == "" {
- if n.ComputedStyle["margin-top"] == "" {
- n.ComputedStyle["margin-top"] = mb[0]
+ n.SetStyle("margin-left", mb[1])
+ n.SetStyle("margin-right", mb[0])
+ } else if n.GetStyle("margin") == "" {
+ if n.GetStyle("margin-top") == "" {
+ n.SetStyle("margin-top", mb[0])
@@ -40,2 +40,2 @@ func Init() cstyle.Transformer {
- if n.ComputedStyle["margin-bottom"] == "" {
- n.ComputedStyle["margin-bottom"] = mb[0]
+ if n.GetStyle("margin-bottom") == "" {
+ n.SetStyle("margin-bottom", mb[0])