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

Empty calculation passed to css in 4.2.0 #4256

Open
MagpieRook opened this issue Jan 2, 2024 · 4 comments · May be fixed by #4266
Open

Empty calculation passed to css in 4.2.0 #4256

MagpieRook opened this issue Jan 2, 2024 · 4 comments · May be fixed by #4266
Labels

Comments

@MagpieRook
Copy link

To reproduce:

Use any min or max function alongside a CSS variable. The breaking change in my deployed environment is:

:root {
  --body-max-width: 1200px;
}

#main-content {
  max-width: min(var(--body-max-width), calc(100vw - 20px));
}

However, another call to min without CSS variables is passed appropriately:

.carousel {
  --caption-width: min(600px, 100%);
}

Current behavior:

In 4.1.3, both the max-width statement and the --caption-width variable are passed as-is to the CSS file. In 4.2.0, the CSS file produced instead has max-width: min();.

Expected behavior:

A non-empty max-width: min();.

Environment information:

  • less version: 4.2.0
  • nodejs version: 18.13.0
  • operating system: (occurs on both windows and mac)

This occurs with max, as well, but not calc, which makes me think it's related to #3719.

@MagpieRook MagpieRook added the bug label Jan 2, 2024
@iChenLei
Copy link
Member

iChenLei commented Jan 3, 2024

PR welcome

@matthew-dean
Copy link
Member

Would this address it?

fschinkel added a commit to eclipse-scout/scout.rt that referenced this issue Jan 11, 2024
min/max functions with css variables are not handled correctly by less.
LESS: min(var(--variable-1), var(--variable-2))
CSS: min()
This issue was occurs from version 4.2.0, therefore downgrade to 4.1.3.
see less/less.js#4256

370618
@matthew-dean
Copy link
Member

@SoonIter Same question as here: #4256 (comment)

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.

4 participants