pug-php / pug-filter-stylus
Render stylus code as compiled CSS in a style tag
Fund package maintenance!
kylekatarnls
Open Collective
Tidelift
Installs: 82 287
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- nodejs-php-fallback/stylus: ^1.0
- pug-php/pug: ^2.0 || ^3.0
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: >=4.8 <6.0
Replaces
This package is auto-updated.
Last update: 2024-12-15 01:08:15 UTC
README
This template:
//- set from php controller - $prev = $color //- set in the pug template - $color = 'red' head :stylus prev = yellow p color #{color} a color #{prev} em color prev body p | I'm =color | but my links are a=prev | and my quotes are em=prev
with data like this:
$pug = new Pug(); $pug->render('template.pug', array( 'color' => 'red', ));
will be rendered like this:
<head> <style type="text/css"> p { color: red; } p a { color: yellow; } p em { color: yellow; } </style> </head> <body> <p> I'm red but my links are <a>yellow</a> and my quotes are <em>yellow</em> </p> </body>