pug-php / pug-filter-stylus
将 Stylus 代码渲染为编译后的 CSS 代码,嵌入 style 标签中
资助包维护!
kylekatarnls
Open Collective
Tidelift
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-09-15 00:40:59 UTC
README
此模板
//- 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
包含如下数据
$pug = new Pug(); $pug->render('template.pug', array( 'color' => 'red', ));
将被渲染成这样
<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>