Skip to content

Instantly share code, notes, and snippets.

View msweeney's full-sized avatar
💭
I may be slow to respond.

Matt Sweeney msweeney

💭
I may be slow to respond.
View GitHub Profile
module.exports = function(str) {
return function(style) {
style.rules = style.rules.map(function(rule) {
if (rule.declarations) {
rule.declarations.forEach(function(decl, i) {
var token;
if (decl.comment) {
token = decl.comment.trim();
if (token.charAt(0) === '$') {
rule.declarations[i+1].value = token;