Closed ai closed 9 years ago
@ai, warning istead of throwing errors is based on the intent of making postcss-assets as unobtrusive as possible. Erroneous pieces of code are getting skipped, those which could be succesfully processed are being processed.
But what developing process you suggest. I will wrote url(img.pnd)
, refreshed page and saw blank icon. Then I left 2 minutes to check my styles, then half minute to find a warning in big logs and only after ask that steps I saw, that I wrote pnd
instead of png
.
Real logs (for example from gulp or webpack) are to long to find warning, that broke me styles.
What user cases you suggest, when warning is better, that error?
BTW, in postcss-simple-vars
and postcss-mixins
I have special silent
option. With this option plugin will not throw error on unknown variable or mixin and will just left them in CSS.
I found user cases for warning:
url(http://…)
url(/path/from/http)
Both this examples is because we didn't add some social asset()
function and used url()
, so we didn't know what user wants - use file path here or just wrote relative URL.
@ai
I will wrote url(img.pnd), refreshed page and saw blank icon.
Then you would inspect the element which looks weird and see it has an unprocessed wrong URL set.
Some of users may think, that plugin just didn't work, because they will miss warning in logs.
Also even if I know about warning, I need to spend time to understand the reason of problem. But plugin can save my time if it say what the problem.
Anyway there is no sense in width: width(path)
in my CSS.