csstools / postcss-extend-rule

Use the @extend at-rule and functional selectors in CSS
https://jonathantneal.github.io/postcss-extend-rule/
Creative Commons Zero v1.0 Universal
51 stars 7 forks source link

Feat: add sourceFrom option #19

Closed TGlide closed 8 months ago

TGlide commented 1 year ago

Description

This PR adds a sourceFrom option, allowing @extends to work with other files, even when they're not imported on the file being read.

This PR solves issue #4

laitine commented 1 year ago

Is this PR going to be merged? Would be really useful.

TGlide commented 1 year ago

Is this PR going to be merged? Would be really useful.

It seems the project is no longer maintained, as the last commit was last year. I suggest forking it.

romainmenke commented 8 months ago

You can inject other CSS with @csstools/postcss-global-data

It injects and later removes CSS which might make it possible to do what you want here.

romainmenke commented 8 months ago

I've added some examples as tests : https://github.com/csstools/postcss-extend-rule/blob/87edc0dd5607d87efee49b112da4a196aedd8eb6/test/_tape.mjs#L25-L46