Beispiel #1
0
func generateMarkup() *trees.Markup {
	body := trees.NewMarkup("body", false)
	trees.NewCSSStyle("width", "auto").Apply(body)
	trees.NewAttr("id", "main-wrapper").Apply(body)

	root := trees.NewMarkup("div", false)
	trees.NewAttr("id", "root-div").Apply(root)
	trees.NewAttr("class", "roots").Apply(root)
	trees.NewCSSStyle("width", "100px").Apply(root)
	trees.NewMarkup("section", false).Apply(root)
	root.Apply(body)

	root2 := trees.NewMarkup("div", false)
	trees.NewAttr("id", "root-div-2").Apply(root2)
	trees.NewAttr("class", "roots").Apply(root2)
	root2.Apply(body)

	label := trees.NewMarkup("label", false)
	trees.NewCSSStyle("width", "200px").Apply(label)
	label.Apply(root2)

	return body
}
Beispiel #2
0
// BackgroundStyle provides the color style value
func BackgroundStyle(value string) trees.Property {
	return trees.NewCSSStyle("background", value)
}
Beispiel #3
0
// WidthStyle provides the width style value
func WidthStyle(size string) trees.Property {
	return trees.NewCSSStyle("width", size)
}
Beispiel #4
0
// MarginStyle provides the margin style value
func MarginStyle(size string) trees.Property {
	return trees.NewCSSStyle("margin", size)
}
Beispiel #5
0
// PaddingStyle provides the margin style value
func PaddingStyle(size string) trees.Property {
	return trees.NewCSSStyle("padding", size)
}
Beispiel #6
0
// FontstringStyle provides the margin style value
func FontstringStyle(size string) trees.Property {
	return trees.NewCSSStyle("font-size", size)
}
Beispiel #7
0
// HeightStyle provides the height style value
func HeightStyle(size string) trees.Property {
	return trees.NewCSSStyle("height", size)
}
Beispiel #8
0
// DisplayStyle provides the style setter that sets the css display value.
func DisplayStyle(ops string) trees.Property {
	return trees.NewCSSStyle("display", ops)
}
Beispiel #9
0
// ColorStyle provides the color style value
func ColorStyle(value string) trees.Property {
	return trees.NewCSSStyle("color", value)
}