Changed: DB Params
This commit is contained in:
3
templ/generator/test-css-expression/constants.go
Normal file
3
templ/generator/test-css-expression/constants.go
Normal file
@@ -0,0 +1,3 @@
|
||||
package testcssexpression
|
||||
|
||||
const red = "#ff0000"
|
19
templ/generator/test-css-expression/render_test.go
Normal file
19
templ/generator/test-css-expression/render_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package testcssexpression
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
)
|
||||
|
||||
var expected = templ.ComponentCSSClass{
|
||||
ID: "className_34fc0328",
|
||||
Class: templ.SafeCSS(`.className_34fc0328{background-color:#ffffff;max-height:calc(100vh - 170px);color:#ff0000;}`),
|
||||
}
|
||||
|
||||
func TestCSSExpression(t *testing.T) {
|
||||
if diff := cmp.Diff(expected, className()); diff != "" {
|
||||
t.Error(diff)
|
||||
}
|
||||
}
|
7
templ/generator/test-css-expression/template.templ
Normal file
7
templ/generator/test-css-expression/template.templ
Normal file
@@ -0,0 +1,7 @@
|
||||
package testcssexpression
|
||||
|
||||
css className() {
|
||||
background-color: #ffffff;
|
||||
max-height: calc(100vh - 170px);
|
||||
color: { red };
|
||||
}
|
23
templ/generator/test-css-expression/template_templ.go
Normal file
23
templ/generator/test-css-expression/template_templ.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.3.833
|
||||
package testcssexpression
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import templruntime "github.com/a-h/templ/runtime"
|
||||
|
||||
func className() templ.CSSClass {
|
||||
templ_7745c5c3_CSSBuilder := templruntime.GetBuilder()
|
||||
templ_7745c5c3_CSSBuilder.WriteString(`background-color:#ffffff;`)
|
||||
templ_7745c5c3_CSSBuilder.WriteString(`max-height:calc(100vh - 170px);`)
|
||||
templ_7745c5c3_CSSBuilder.WriteString(string(templ.SanitizeCSS(`color`, red)))
|
||||
templ_7745c5c3_CSSID := templ.CSSID(`className`, templ_7745c5c3_CSSBuilder.String())
|
||||
return templ.ComponentCSSClass{
|
||||
ID: templ_7745c5c3_CSSID,
|
||||
Class: templ.SafeCSS(`.` + templ_7745c5c3_CSSID + `{` + templ_7745c5c3_CSSBuilder.String() + `}`),
|
||||
}
|
||||
}
|
||||
|
||||
var _ = templruntime.GeneratedTemplate
|
Reference in New Issue
Block a user