KSS

KSS is the style sheet language of Kryon applications. This package parses and formats .kss sheets, resolves their @imports and color tokens, installs the rules into Kryon's style table, and ships the classic, lightfield, and material style packs in styles/. Kryon itself only resolves installed rules; apps that read .kss text add this package.

Use it

ziran add https://github.com/kryonlabs/kss.git
using Styles :: #import "kss/Kss";
#import "kss/SystemStyle"

BeginStyleRules, ParseStyleRules, and InstallParsedStyleRules parse a sheet in steps and install it; ProvideStyleRulesImport answers an @import. SystemStyle picks a pack that matches the desktop theme. The classic pack is also compiled in as style_pack_classic, so an app can install it without shipping the .kss file.

Develop

make check checks the package, runs the parser and style tests as portable bundles and native code, verifies that src/style_pack_classic.zi matches styles/classic.kss, and fuzzes generated and damaged sheets under AddressSanitizer and UndefinedBehaviorSanitizer. After editing styles/classic.kss, run make style-packs and commit the regenerated module with it. make fuzz FUZZ_SEED=N FUZZ_COUNT=M runs other sheets; a failing one is kept in build/kss-fuzz/ with a command that shrinks it.

To test against local checkouts, keep them next to this one and put this in an ignored ziran.local.toml:

[overrides]
ziran = "../ziran"
kryon = "../kryon"
S
Description
CSS parser, style pack compiler, formatter and browser export tools.
Readme BSD-3-Clause
2.8 MiB
0 Stars 1 Watchers 0 Forks
Languages
Ziran 84.5%
CSS 14.2%
Shell 0.8%
Makefile 0.4%