Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Collapse with PostHTML and PostCSS plugins #43

Merged
merged 9 commits into from
Aug 14, 2018
Merged

Collapse with PostHTML and PostCSS plugins #43

merged 9 commits into from
Aug 14, 2018

Conversation

terinjokes
Copy link
Contributor

A large refactor of Collapsify, now with a decent amount of tests, that implements the collapsing functionality as PostHTML and PostCSS AST transforming plugins.

By implementing Collapsify as plugins we can leverage the large ecosystem's plugin, parsing and output generation. The desire is that this allows new features to be added to Collapsify with greater ease, and decrease the number of collapsing issues.

var tasks = [];

css.walkAtRules('import', function (importRule) {
var matches = /(?:url\()?['"]?([^'"\)\s]*)['"]?(?:\))?(?:\s+(.+))?/gi.exec(importRule.params);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use value parser here as well instead of handwritten regular expression?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, I'll give it a shot. Think I might moved this regex from the old parser to here.

@terinjokes terinjokes force-pushed the terin/post branch 2 times, most recently from e8a26e0 to 4ac7361 Compare May 10, 2018 17:28
@RReverser
Copy link
Contributor

Merging this one as-is and will issue another PR with dependency upgrades and more refactoring on top of it.

@dotjs dotjs merged commit 265a15c into master Aug 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants