Closed xzyfer closed 9 years ago
It's well within scope. Given the way gyp files work, it's completely reasonable. If you can require()
the node module (with it's gyp bindings), you should be able to register those calls as part of a custom function as well. The idea is to bring all of the great things about node and npm to the Sass system. :)
[edit] A hypothetical eyeglass-module
var myCStuff = require("./my-c-stuff");
module.exports = function(eyeglass, sass) {
return {
functions: {
"signature()": function() {
// just use myCStuff and handle converting results into proper sass.types
// signature() will become a supported Sass custom function
}
}
}
}
I could hug you. Happy to assist in anyway from the Libsass side of things.
Agree. We will probably end up doing something like this for our spriting module. Hugs all around!
Pretty self explanatory. Being able to distribute, install and register custom Libsass C functions would be great. It would certainly ease the distribution of custom behaviour without requiring the forking of Libsass (this is a decision I'm currently facing in my team).