Skip to content

flynt-theme/strike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strike

Theme generator for Flynt. Write one template per app, generate all variants.

Install

brew tap flynt-theme/tap
brew install strike

Or with Go:

go install github.com/flynt-theme/strike/cmd/strike@latest

Usage

strike build <template> [flags]

Flags:
  --palette   Path or URL to palette.json  (default: flynt-theme/flynt on GitHub)
  --out       Output directory             (default: template directory)
  --combined  Render once with both dark and light contexts (for single-file themes)
  --check     Exit non-zero if outputs are stale, without writing

Example - build from a local palette:

strike build theme.yaml.tmpl --palette ../flynt/palette.json

Example - single-file theme (e.g. Obsidian):

strike build theme.css.tmpl --combined

Example - CI check (verify committed files match the template):

strike build theme.yaml.tmpl --check

Template format

Templates are plain text files with a YAML frontmatter block:

---
output: flynt-{{ .variant }}.yaml
---
# file body — any format, rendered as a Go template
accent: '{{ .amber }}'
background: '{{ .bg }}'
foreground: '{{ .tx }}'

Strike renders one output file per palette variant (dark, light). The output line is itself a template - use .variant to produce separate filenames.

Template variables

Variant

Variable Example values
.variant dark, light
.label Flynt Dark, Flynt Light

Base tokens

Variable Token
.bg bg
.bg2 - .bg5 bg-2 through bg-5
.tx tx
.tx2 - .tx5 tx-2 through tx-5

All values are hex strings with a # prefix (e.g. #100E0C).

Accent primaries (shade 500)

.ember .clay .amber .moss .fern .teal .delft .iris .plum .rose

Full shade range

{{ index (index .shades "amber") "400" }}

Available shades: 50 100 150 200 300 400 500 600 700 800 850 900 950

Template functions

Function Example Output
hex2rgb {{ hex2rgb .amber }} 198,159,42
hex2rgbf {{ hex2rgbf .amber }} 0.7765 0.6235 0.1647
hexchan {{ hexchan .amber "r" }} 0.7765
nohash {{ nohash .amber }} C69F2A
shade {{ shade .dark.shades "amber" "400" }} hex string
lower {{ lower .variant }} dark
upper {{ upper .label }} FLYNT DARK

hexchan accepts "r", "g", or "b" as the channel argument. Useful for formats like iTerm2 that need each component on a separate line.

License

MIT - Flynt Theme

About

Flynt theme generator

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages