tinted-theming / base16-builder-node

A Builder for schemes and templates. Supports Base16, Base24, etc.
MIT License
16 stars 0 forks source link

(wip) semantic aliases #7

Open joshgoebel opened 2 years ago

joshgoebel commented 2 years ago

First pass at implementation of proposal https://github.com/base16-project/base16/issues/11

My test case:

scheme: "Nord"
author: "arcticicestudio"
# Nord Palette
nord0: "2E3440"
nord1: "3B4252"
nord2: "434C5E"
nord3: "4C566A"
nord4: "D8DEE9"
nord5: "E5E9F0"
nord6: "ECEFF4"
nord7: "8FBCBB"
nord8: "88C0D0"
nord9: "81A1C1"
nord10: "5E81AC"
nord11: "BF616A"
nord12: "D08770"
nord13: "EBCB8B"
nord14: "A3BE8C"
nord15: "B48EAD"
# Semantic colors
diff-added: nord14
diff-deleted: nord11
diff-changed: nord13
# Defaults for older templates
base00: nord0
base01: nord1
base02: nord2
base03: nord3
base04: nord4
base05: nord5
base06: nord6
base07: nord7
base08: nord11
base09: nord12
base0A: nord13
base0B: nord14
base0C: nord8
base0D: nord9
base0E: nord15
base0F: nord10

And then just playing around with an old template:

/*
nord0 #{{nord0-hex}}
nord0 bgr #{{nord0-hex-bgr}}
nord1 #{{nord1-hex}}
nord2 #{{nord2-hex}}
*/

.hljs-deletion {
  color: #{{diff-deleted-hex}};
}