zikaari / aspen-decorations

Styling engine for Aspen
MIT License
2 stars 1 forks source link

Glob pattern driven decorations #1

Open zikaari opened 5 years ago

zikaari commented 5 years ago

Implementation Proposal

const deco1 = new GlobbyDecoration('cssClassname')

console.log(deco1 instanceof Decoration) // > true

deco1.addGlobRule('src/vendor/**/*.css')
deco1.addGlobRule('**node_modules**')

setTimeout(() => {
  deco1.removeGlobRule('**node_modules**')
}, 5000)

Behaviour

Notes

node-ignore is a great glob matcher with no external dependencies. (No interal deps eithers, like fs or path)

LoganDark commented 3 years ago

Remember to support TargetMatchMode.Self as well, unless this only matches absolute paths?