twbs / mq4-hover-shim

A shim for the Media Queries Level 4 `hover` media feature
https://www.npmjs.com/package/mq4-hover-shim
MIT License
98 stars 18 forks source link

Use postcss.plugin() API #26

Open cvrebert opened 9 years ago

cvrebert commented 9 years ago
pytkin commented 8 years ago

What kind of help do you need? If you have question(s) related with PostCSS, you can address them to @ai

cvrebert commented 8 years ago

It's just a matter of finding the time. I don't anticipate any special difficulties.

bassjobsen commented 8 years ago

@cvrebert @ai i try to run the following command: postcss --use mq4-hover-shim.postprocessorFor --mq4-hover-shim.postprocessorFor.hoverSelectorPrefix ".bs-true-hover " -o dist/css/bootstrap.css dist/css/bootstrap.css Do i use the wrong command or does it not work? Thanks.

cvrebert commented 8 years ago

Doubt it would work, because of this issue.

bassjobsen commented 8 years ago

@ai as far i do understand --use mq4-hover-shim.postprocessorFor calls require('./q4-hover-shim.postprocessorFor'); in stead of var plugin = require('./q4-hover-shim'); plugin.postprocessorFor(). How should this be solved?

cvrebert commented 8 years ago

@bassjobsen mq4-hover-shim doesn't yet implement the plugin interface expected by postcss. PostCSS is not at fault.

bassjobsen commented 8 years ago

Hi @cvrebert yes i have seen that. But when using --use mq4-hover-shim.postprocessorFor i got Error: Cannot find module 'mq4-hover-shim.postprocessorFor' so the wrong interface is never reached in the first place.

cvrebert commented 8 years ago

postcss-cli is maintained by other folks, not by ai.

bassjobsen commented 8 years ago

yes, i see now. So @pirxpilot can you help?

pirxpilot commented 8 years ago

Not sure how I can help: as soon as mq4-hover-shim implements standard plugin interface it should work with postcss-cli and other runners without any problems.

bassjobsen commented 8 years ago

Hi @pirxpilot thanks for your quick response. Yes i do understand the plugin interface should be implement here: https://github.com/twbs/mq4-hover-shim/blob/master/src/nodejs/postprocessor.js#L72 Currently i found the problem at https://github.com/twbs/mq4-hover-shim/blob/master/src/nodejs/index.js#L9. The preceding means on should use nd --use mq4-hover-shim.postprocessorFor which seems non possible. Or should mq4-hover-shim refactor the index.js too?