postcss / postcss-custom-properties

Use Custom Properties in CSS
https://postcss.github.io/postcss-custom-properties
MIT License
597 stars 77 forks source link

Allow importFrom to take other file extensions #170

Open niksajanjic opened 5 years ago

niksajanjic commented 5 years ago

I can make a PR to allow other file extensions like .sss which I'm using, .sass, .scss or .less. All that is needed is to copy getCustomPropertiesFromCSSFile function and just add one line where we parse the string using parsers for a specific extension before parsing it using postcss.

If this would be a good enhancement, I can make a PR.

But, I'm wondering if there is a better way (just a rough idea, not researched yet):

niksajanjic commented 5 years ago

Ok, I saw there's a second argument results passed to a returned plugin function, so I can use that to access parser option. I'll try to use that and see what I come up with.

patricekaufmann commented 4 years ago

I am also interested in this kind of functionality. Mainly using .pcss files I now have to add a .css file next to them which doesn't look too nice.

gitttttq commented 3 years ago

Ok, I saw there's a second argument results passed to a returned plugin function, so I can use that to access parser option. I'll try to use that and see what I come up with.

So is this problem solved now?

niksajanjic commented 3 years ago

I don't remember anymore what I did to make it work, I think I switched it to JS so I can use variables inside my JS code too, but I can't bet on it.

So, the question is if maintainers want to allow additional extensions or not. If they do, then this issue still makes sense. It's been quite some time since I created this issue, I doubt I'd have time or will to get back to this and make a PR.