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

border-radius not parsing correctly #3467

Closed
heavyk opened this issue Feb 6, 2020 · 3 comments
Closed

border-radius not parsing correctly #3467

heavyk opened this issue Feb 6, 2020 · 3 comments

Comments

@heavyk
Copy link

heavyk commented Feb 6, 2020

if the border-radius has a / in it, then it looks like less thinks it's division...

to reproduce:

.border-radius {
  border-radius: 34px 0 0 36px / 34px 0 0 36px;
  border-radius: 10px 100px / 120px;
}

produces:

.border-radius {
  border-radius: 34px 0 0 1.05882353px 0 0 36px;
  border-radius: 10px 0.83333333px;
}

... which is incorrect. you can see this is valid syntax here:
https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius

@kbav
Copy link

kbav commented Feb 18, 2020

This issue can be seen in this test case that I created. View the compiled CSS to see how LESS renders it.

@heavyk and for anyone else stumbling in to this, note that you can escape characters in LESS, which is a handy tool for getting around parsing issues. This is also shown in my test case.

Instead of writing...
border-radius: 10px 100px / 120px;

write
border-radius: 10px 100px ~"/" 120px;

in your LESS and it should parse it correctly, leaving the / character alone and not interpret it as a character indicating a division is to take place.

@heavyk
Copy link
Author

heavyk commented Feb 24, 2020

ah cool, knowing how to escape it is helpful, thanks!

@matthew-dean
Copy link
Member

Closing as this has several workarounds. The other is to change the math mode as in http://lesscss.org/usage/#less-options-math

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

3 participants