]> git.maquefel.me Git - brevno-suite/hugo/commit
tocss: Simplify the hugo:vars type handling
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 21 Feb 2023 17:32:09 +0000 (18:32 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 22 Feb 2023 12:26:10 +0000 (13:26 +0100)
commitecf3cd514fe0e4c848513053721ee9573108f666
tree4b2815053abe072e0218aa82d92025b5cab6a6fc
parenta1a9c08b5ffee8432d9ed23143233d5f00b50608
tocss: Simplify the hugo:vars type handling

Instead of maintaing a list of all CSS units and functions this commit:

* Uses 3 regexps to detect typed CSS values (e.g. `24px`) + properly handle numeric Go types.
* These regexps may have some false positives -- e.g. strings that needs to be quoted.
* For that rare case, you can mark the string with e.g. `"32xxx" | css.Quoted`
* For the opposite case:  `"32" | css.Unquoted`

Updates #10632
common/types/css/csstypes.go [new file with mode: 0644]
resources/resource_transformers/tocss/dartsass/client.go
resources/resource_transformers/tocss/dartsass/integration_test.go
resources/resource_transformers/tocss/internal/sass/cssValues.go
resources/resource_transformers/tocss/internal/sass/helpers.go
resources/resource_transformers/tocss/internal/sass/helpers_test.go [new file with mode: 0644]
resources/resource_transformers/tocss/scss/client.go
tpl/css/css.go [new file with mode: 0644]
tpl/tplimpl/template_funcs.go