Allow passing PostCSS plugin into Marpit#use as postprocess for CSS
#428
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enables the use of PostCSS plugins via
Marpit#use.Previously Marpit only allowed markdown-it plugins. By enabling post-processors for CSS with the same interface, users can customize styles more flexibly.
Currently, Marp Core applies post-processors to the rendered styles by overloading a Marpit's class method
#renderStyle. This was an inefficient implementation because 2 instances of PostCSS were held in Marp Core.https://github.com/marp-team/marp-core/blob/c20422eb2f18e0bde36bd610ca66c1d9c9f68903/src/marp.ts#L110-L120
This change is expected to make style post-processing in Marp Core and 3rd party Marpit-based engines smarter.
Close #418.