pug-php/pug-filter-less

Render Less code as compiled CSS in a style tag

Maintainers

👁 kylekatarn

Package info

github.com/pug-php/pug-filter-less

pkg:composer/pug-php/pug-filter-less

Statistics

Installs: 91 484

Dependents: 1

Suggesters: 0

Stars: 2

Open Issues: 0

1.1.0 2017-10-03 15:50 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

  • kylekatarnls/jade-filter-less: 1.1.0

MIT 2e29c26581f482daade38acf175131f73b45e0f4

  • Kyle Katarn <kylekatarnls.woop@gmail.com>

This package is auto-updated.

Last update: 2026-06-16 18:20:44 UTC


README

👁 Latest Stable Version
👁 Build Status
👁 Code Climate
👁 Test Coverage
👁 StyleCI

This template:

//- 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

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>

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.