Skip to content

Instantly share code, notes, and snippets.

@gavinmcfarland
Created August 20, 2019 17:29
Show Gist options
  • Select an option

  • Save gavinmcfarland/585714fe0da67c2b20cdb8cbee83dc78 to your computer and use it in GitHub Desktop.

Select an option

Save gavinmcfarland/585714fe0da67c2b20cdb8cbee83dc78 to your computer and use it in GitHub Desktop.
Super Minimallistic Templating Language

An idea for a super minimalistic templating language

.<rule.abbr><modifier> {        # for rule, modifier, prop, value in rules
	<prop>: >> <value> <<;
}
// css/class.template
.{{@}} {                                         #if type is "class"
    {{import decl}}
    {{import class}}
    {{import atRule}}
}

// css/atRule.template
@{{type}} {{@}} {                                #if type is "atRule"
    {{import decl}}
    {{import class}}
    {{import atRule}}
}

// css/decl.template
{{@}}: {{@value}}                                #if type is "decl"

// css/var.template
:root {                                          #if type is "var"
    --{{@}}: >>{{@}},<<;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment