The short version
- Every CSS property, keyword and unit is a Go value. Typos stop at the compiler.
- Hover states, nesting, media, container and supports queries, keyframes, fonts and layers.
- Stylesheets ship as files you wrote, files we write for you, or rules that live in the browser.
- Rules can follow your app's state, with no class juggling.
-
The
modelpackage is now calleddata.
Hey everyone,
CSS has one trick it plays on everybody: it fails quietly. You type
colr: red
, nothing happens, no error, and a week later someone asks why the button is grey. Update 0.0.5 ends that.
CSS, written in Go
Every CSS property, keyword and unit is now a Go value. They're generated from the W3C's own specifications and the browser support data behind MDN, and we only include what every major browser can render today. If it compiles, browsers understand it.
var
Card
=
style
.
Class
(
"card"
)
.
Set
(
css
.
Padding
(
css
.
Rem
(
1
)
)
,
css
.
Border
(
css
.
Px
(
2
)
,
kw
.
Solid
,
css
.
Var
(
"line"
)
)
)
.
Hover
(
css
.
Background
(
css
.
Var
(
"sun"
)
)
)
Misspell
Padding
and your editor tells you before you save. Pass a colour where a length belongs and the build stops.
Typed styling lands. Write your CSS in Go, let the compiler catch the typos, and let your app's state drive the look.
The whole toolbox
Hover and focus states, nesting,
@media
,
@container
and
@supports
, keyframes, font faces, custom properties, cascade layers and
!important
. If you'd reach for it in a stylesheet, it's in there. The
Styling
page has a live demo for each one.
Three ways to ship it
- Static: link a stylesheet you already have.
-
Generated: write your rules in Go and get a real
.cssfile at build time. - Dynamic: rules that live in the browser and come and go while the app runs.
Styles that react
Bind a rule to an action and it switches itself on and off. Pair it with a ViewModel's
OnAction
and the look of your app follows its state on its own. The dark mode switch on this site is one of those rules.
One rename
The
model
package is now called
data
. Same API, clearer name. Update the import and you're done.
New docs to match
To show all of this off, the docs got rebuilt: a new look, a proper landing page, and live examples you can poke at on every styling page. Each one is a running WebGo component.
Get it
go get github.com/Toms223/WebGo@v0.0.5
Go write some CSS that can't break quietly. We'll see you next update.
End of issue 0.0.5
03