Semantic-Org / Semantic-UI-LESS

LESS only distribution
http://www.semantic-ui.com
200 stars 119 forks source link

Certain calc fields not generated correctly #61

Open JasonBarnabe opened 5 years ago

JasonBarnabe commented 5 years ago

semantic-ui-less 2.4.1 less 3.9.0 Running in a Rails 5.2 app using webpacker 3.5.5.

https://github.com/Semantic-Org/Semantic-UI-LESS/blob/e4395217c1b8b3227c7387284d12f2d9774d33c6/themes/default/elements/step.variables#L98

@borderWidth: 1px;
@attachedHorizontalOffset: -@borderWidth;
@attachedWidth: calc(100% + (-@attachedHorizontalOffset * 2));

results in @attachedWidth being calc(100% + (--1px * 2)), which is not valid.

I'm only having this happen in my development environment. Possibly a minifier/compressor is correcting to calc(100% + 2px).

Adding this override fixes it:

@attachedWidth: calc(100% + (@attachedHorizontalOffset * -2));
meze commented 5 years ago

Having the same problem with attached.segment. Solved it temporarily by overriding the theme's variables:

@attachedWidth: calc(~"100% - (" @attachedHorizontalOffset ~"* 2)");

less calculates the value but it should be the expression, not the result of it.

lubber-de commented 2 years ago

This is fixed in the community fork Fomantic-UI since 2.5.0 by https://github.com/fomantic/Fomantic-UI/pull/97