Skip to content

Instantly share code, notes, and snippets.

@gmac
Created March 16, 2017 19:48
Show Gist options
  • Save gmac/45bc517e7a19088124688e45ac5f0b4c to your computer and use it in GitHub Desktop.
Save gmac/45bc517e7a19088124688e45ac5f0b4c to your computer and use it in GitHub Desktop.
Notes for theme editor talk
// THEME
// Get plain variable text:
theme.getVar('color_breaker_fg')
// Get rendered variable value:
theme.getVarValue('color_breaker_fg')
// Compile mapped field dependencies:
theme.getDependencyGraph()
// Get variable dependents and ancestors:
theme.getVarDependencies('color_body')
theme.getVarAncestors('color_breaker_fg')
// See the current diff that we're tracking from source:
theme.getDiff()
JSON.stringify( theme.getDiff() )
// USAGE
// Get variables that apply to a rule:
theme_usage.getVarsForRule('.c-global-header')
// Get rules that apply to a variable:
theme_usage.getRulesForVar('color_link')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment