pugjs / pug

Pug – robust, elegant, feature rich template engine for Node.js
https://pugjs.org
21.7k stars 1.95k forks source link

Interpolating template data inside filter #3419

Open CMTV opened 1 year ago

CMTV commented 1 year ago

I have created a filter for scss:

filters: {
    'scss': (text) => sass.compileString(text).css
}

And it works just fine, but I also need to use data from template inside my filtered stylesheet:

// myTemplate.pug

- let colorVar = '#fff';

style
    :scss
        a
        {
            b
            {
                color: #{colorVar};
            }
        }

Is there a simple way to make this work?