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

Parse error for Polymer @apply #9

Closed
donny-dont opened this issue Dec 2, 2015 · 9 comments
Closed

Parse error for Polymer @apply #9

donny-dont opened this issue Dec 2, 2015 · 9 comments

Comments

@donny-dont
Copy link

Currently the parser fails if you attempt to use the Polymer 1.0 mixins. See https://www.polymer-project.org/1.0/docs/devguide/styling.html.

Attempting to use it results in

ParseError: directive options not recognised in - on line 18, column 15:
      17
      18         @apply(--scrollable-group-wrapper);
      .................^
      19
@donny-dont
Copy link
Author

The hacks in less/less.js#2715 seem to work but makes things quite ugly.

@AdalbertoLacruz
Copy link
Owner

Sorry, as far as know @apply yet isn't supported in lessc js.

@donny-dont
Copy link
Author

Sure but can less_dart support it?

@AdalbertoLacruz
Copy link
Owner

Polymer defines mixins as:
--mixin-name: { rules }
and use them with:
@apply(--mixin-name);

Possibly could implement a pass-throw for @apply in the lessc directive system. But the mixin definition is more complex to parse and must be in a css file, external to lessc.

Could this be a solution for you?

@donny-dont
Copy link
Author

I think I could live with that. Would be great if it could parse inside the mixin for stuff like px to em's but not sure how hard that would be.

@donny-dont
Copy link
Author

Just wanted to note that it was super easy to get less_dart up and running. Really great stuff you have here. The polymer stuff is all new so I expect some hiccups but everything looks good.

@AdalbertoLacruz
Copy link
Owner

Could you try the new version?
For reference see the test: test/less/extendedTest/apply.less
that result in: test/css/extendedText/apply.css

@donny-dont
Copy link
Author

:shipit: worked great! Thanks @AdalbertoLacruz.

@AdalbertoLacruz
Copy link
Owner

I'm glad to hear that. It´s time to upgrade pub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants