Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage the LESS parser in the CSSRewriter #252

Closed
gideonthomas opened this issue May 8, 2015 · 6 comments
Closed

Leverage the LESS parser in the CSSRewriter #252

gideonthomas opened this issue May 8, 2015 · 6 comments

Comments

@gideonthomas
Copy link

We currently use our own parsing mechanisms and regexes to parse and rewrite CSS. However, we should probably use the LESS parser that brackets provides here instead so that we run into fewer parsing bugs.

@humphd
Copy link

humphd commented May 8, 2015

The LESS version used in Brackets is older than the new docs. We have to use less.parser and .toCSS(). See https://github.com/adobe/brackets/blob/04efd92ae3d91ea70c6481a7e32e6e4f41676d55/src/utils/ExtensionUtils.js#L121-L131 for an idea of how to call the parser. I'm not sure how you pass a custom plugin so it will let us rewrite image URLs. See https://github.com/less/less-plugin-inline-urls/blob/master/lib/inline-images.js for some idea on how it might be done.

cc @Pomax.

@humphd
Copy link

humphd commented May 8, 2015

It looks to me like Plugins were added in Less v2, so this might be tricky without also updating Less.

@humphd
Copy link

humphd commented May 8, 2015

@Pomax
Copy link

Pomax commented May 8, 2015

small note: LESS<2 is incompatible with node v12, so you're going to want to update LESS regardless, if you want to keep the project runnable for people on the current version of Node

@humphd
Copy link

humphd commented May 22, 2015

Looks like LESS v2.3.1 is coming upstream in the 1.4 milestone, see adobe#10240

@gideonthomas gideonthomas added the P3 label Jan 8, 2016
@humphd
Copy link

humphd commented Sep 28, 2017

We no longer ship LESS in production (for size/perf savings), so closing this.

@humphd humphd closed this as completed Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants