postcss / postcss-custom-properties

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

Add an option to disable the undefined and no fallback variable #58

Closed armandabric closed 7 years ago

armandabric commented 7 years ago

I need to be able to pre-compile the style of a library of component. But I could not resolve yet all the variable (some customization related variable: colors, font-family...). My user (me in another application) will have to finish the compilations.

So on this pre-compilation time I want to remove the warnings. And later on the final compilation I will let the warning active.

MoOx commented 7 years ago

Can you provide some explanation about the motivation for this?

armandabric commented 7 years ago

Ho! Sorry I forgot this step 😄

Description filled!

MoOx commented 7 years ago

Why don't you instead make a plugin after this one that remove the message? I don't think it's a good idea to add this option as it allows people to just ignored warnings too easily. Since your case is specific, I guess you could just write a plugin that will take your 3 or 4 lines of code to remove the messages from postcss messages registry?

armandabric commented 7 years ago

I guess you could just write a plugin that will take your 3 or 4 lines of code to remove the messages from postcss messages registry?

I doesn't know that is possible! I will give it a try.

armandabric commented 7 years ago

Ok. I succeed doing it with a plugin: https://gist.github.com/Spy-Seth/0d8c88f7eb81edb4842f493b7e28a8cc

You right, it's an edge case that should not me managed by this library.