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

Less confused about max() + calc() #3604

Open
mina86 opened this issue Feb 22, 2021 · 3 comments · May be fixed by #3708
Open

Less confused about max() + calc() #3604

mina86 opened this issue Feb 22, 2021 · 3 comments · May be fixed by #3708
Labels

Comments

@mina86
Copy link

mina86 commented Feb 22, 2021

$ lessc --version
lessc 4.1.1 (Less Compiler) [JavaScript]
$ lessc  <(echo 'body { padding: max(1em, calc(50vw - 25rem)); } ')
body {
  padding: 1em;
}

Expected output:

body {
  padding: max(1em, calc(50vw - 25rem));
}

Any subset of the expression (e.g. max(1em, 50vw) or calc(50vw - 25rem)) works fine.

@FreekVR
Copy link

FreekVR commented Feb 24, 2021

Having the same issue with nested var function in min();

eg.

min(var(--maxWidth, 50rem), 100%)

compiles to

100% instead of expected min(var(--maxWidth, 50rem), 100%)

Seems to execute less-provided min function instead of the one from vanilla CSS.

@oebrab
Copy link

oebrab commented Apr 18, 2021

calc inside max is redundant

max(1em, calc(50vw - 25rem)) can be max(1em, 50vw - 25rem)

However, max(1em, 50vw - 25rem) compiles to max(1em, 25vw) instaed of max(1em, 50vw - 25rem)

Related issue

A workaround is ~"max(1em, 50vw - 25rem)"

@lumburr lumburr linked a pull request Mar 31, 2022 that will close this issue
3 tasks
@bugron
Copy link

bugron commented Jan 12, 2023

Hi @matthew-dean @iChenLei. Is there any chance the fix for this bug can be merged and published? Thanks.

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

Successfully merging a pull request may close this issue.

5 participants