pug-php / pug-filter-less
将Less代码渲染为style标签中的编译后的CSS
资助包维护!
kylekatarnls
Open Collective
Tidelift
Requires
- nodejs-php-fallback/less: ^1.0
- pug-php/pug: ^2.0 || ^3.0
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: >=4.8 <6.0
Replaces
- kylekatarnls/jade-filter-less: 1.1.0
This package is auto-updated.
Last update: 2024-09-16 14:27:33 UTC
README
此模板
//- set from php controller - $prev = $color //- set in the pug template - $color = 'red' head :less @prev: yellow; p { width: 200px; 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>
安全联系信息
要报告安全漏洞,请使用Tidelift安全联系。Tidelift将协调修复和披露。