Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

kylekatarnls/jade-filter-stylus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository now lives on https://github.com/pug-php/pug-filter-stylus

pug-filter-stylus

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>