From 4710e9c8a168d35baad84d7d7e01c6f1e465a973 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Sun, 3 Mar 2024 13:55:37 -0800 Subject: [PATCH 1/3] Move `styles.CSS` to `elem.CSS` --- elements.go | 5 +++++ styles/README.md | 2 +- styles/styles.go | 20 -------------------- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/elements.go b/elements.go index cfd255c..ad00aa0 100644 --- a/elements.go +++ b/elements.go @@ -520,3 +520,8 @@ func None() NoneNode { func Raw(html string) RawNode { return RawNode(html) } + +// CSS takes css content and returns a TextNode. +func CSS(content string) TextNode { + return TextNode(content) +} diff --git a/styles/README.md b/styles/README.md index a997384..7069fa3 100644 --- a/styles/README.md +++ b/styles/README.md @@ -108,7 +108,7 @@ These functions facilitate the embedding of CSS into HTML documents, particularl cssContent := `/* ... */` // Creating a ` cssContent := `.test-class {color: #333;}` - el := Style(attrs.Props{attrs.Type: "text/css"}, TextNode(cssContent)) + el := Style(attrs.Props{attrs.Type: "text/css"}, CSS(cssContent)) assert.Equal(t, expected, el.Render()) }