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

Lessc error with nested calc() #3149

Closed
turnerhayes opened this issue Jan 3, 2018 · 6 comments
Closed

Lessc error with nested calc() #3149

turnerhayes opened this issue Jan 3, 2018 · 6 comments

Comments

@turnerhayes
Copy link

I'm trying to compile Bootstrap's CSS with lessc and getting the following error:

Bootstrap version: 4.0.0-beta.3
Lessc version: lessc 2.7.3 (Less Compiler) [JavaScript]

$ lessc node_modules/bootstrap/dist/css/bootstrap.css
OperationError: Operation on an invalid type in [project directory]/node_modules/bootstrap/dist/css/bootstrap.css on line 3719, column 3:
3718   display: block;
3719   height: calc(calc(2.25rem + 2px) - 1px * 2);
3720   padding: 0.375rem 0.75rem;

Seems to be objecting to the nested calc(). According to MDN, this is valid syntax (although I read on SO that that clarification was added in the past year or two, so maybe lessc was correct at some point).

@seven-phases-max
Copy link
Member

seven-phases-max commented Jan 12, 2018

@seven-phases-max
Copy link
Member

Closing in favour of #1880.

@turnerhayes
Copy link
Author

That seemed to work, but shouldn't lessc accept any valid CSS without flags?

@seven-phases-max
Copy link
Member

but shouldn't lessc accept any valid CSS without flags?

The default --strict-math=on will break too much legacy code (for more details see #1880, #974 etc.).

@turnerhayes
Copy link
Author

I guess I don't really understand why nested calc()s can't be passed through as is, rather than being regarded as something to (potentially) calculate during compilation.

@matthew-dean
Copy link
Member

@turnerhayes This works in 3.x.

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