drupal-pattern-lab / patternengine-php-twig

Twig-based PatternEngine for Pattern Lab.
http://patternlab.io/
MIT License
2 stars 1 forks source link

Add Ability to Add Twig Globals To Pattern Lab (Twig's Idea of Global Variables) #6

Open sghoweri opened 7 years ago

sghoweri commented 7 years ago

https://twig.symfony.com/doc/2.x/advanced.html#id1

Now I know that Pattern Lab has offered globally available data via the _data folder for a long time now however that only really helps if you're using Pattern Lab on its own vs having PL serve as a living source of truth for your Design System (with Drupal Integration of course).

I'm pretty sure I can whip something up for this but essentially I'm looking to expose Twig's native Globals extension to PL so shared constants across patterns can get universally shared with Drupal (ex. if using the Unified Twig Extensions module) which would include adding a brand new Globals folder along side the current filter / tags / functions folders.

CC @EvanLovely @evanmwillhite @aleksip