javascript - node-sass and sass-eyeglass Get the tree -
i interested in using sass-eyeglass node-sass build custom functions. 1 of things looking retrieve value of sass variable so:
js:
// eyeglass-exports.js "use strict"; var path = require("path"); module.exports = function(eyeglass, sass) { return { functions: { "get-var($prefix, $subject)": function(prefix, subject, done) { // return variable {prefix + ' - ' + subject} } } } };
sass:
// index.scss $my-foo: 20px; div { font-size: get-var(my, foo); // font-size: 20px; }
to able this, need access kind of tree of has been parsed (at point in time). possible node-sass?
Comments
Post a Comment