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

Parsing Less Functions containing default values gets interpreted as Pseudo-Elements #10

Closed
julkuh opened this issue May 4, 2017 · 7 comments
Labels
Milestone

Comments

@julkuh
Copy link

julkuh commented May 4, 2017

Hey,

parsing less functions containing default values for params (e.g.@animation-count:infinite) results in a Major SonarQube issue

Remove this usage of the unknown "linear" pseudo.

LESS-Sample

.animation (@animation-name, @animation-duration, @animation-count:infinte, @timing-function:linear){
   -webkit-animation: @animation-name @animation-duration @animation-count @timing-function;
    animation: @animation-name @animation-duration @animation-count @timing-function;
}
@racodond
Copy link
Owner

racodond commented May 4, 2017

Hi @julkuh,

Could you please provide the full source code because I don't see any "linear" pseudo in you Less sample?

Thanks§

David

@julkuh
Copy link
Author

julkuh commented May 4, 2017

I've updated the example above. Sorry.
The problem is the expression @myPropertyWithDefaultValue:someValue.
The colon between variable name and default value gets interpreted as the colo to identify pseudo classes in css (e.g. :hover).

@racodond
Copy link
Owner

racodond commented May 4, 2017

Could you please provide a full code sample that can be interpreted by the SCSS parser: https://www.sassmeister.com/ ?

@julkuh
Copy link
Author

julkuh commented May 4, 2017

As it is a LESS it will never be intepreted correctly by SCSS Parser ;)
But i'll prepared a working example at less2css.org/ for you

@racodond
Copy link
Owner

racodond commented May 4, 2017

I'm a bit tired I guess :-)

@racodond
Copy link
Owner

@julkuh No need to prepare an example. I just switched my brain to Less mode and spotted the issue.

@racodond racodond added bug and removed question labels May 10, 2017
@racodond racodond added this to the 4.4 milestone May 10, 2017
@julkuh
Copy link
Author

julkuh commented May 10, 2017

That's really great 👍

@racodond racodond modified the milestones: 4.3, 4.4 May 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants