Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Incorrect behavior minifying custom CSS

Open agabi10 opened this issue 9 years ago • 3 comments

Rocket.Chat Version: 0.54.2 Running Instances: 1 DB Replicaset OpLog: Disabled Node Version: v4.8.2

I added these lines to the custom CSS:

.account-box .options {
  height: -webkit-calc(100% - 160px);
  height: -moz-calc(100% - 160px);
  height: calc(100% - 160px);
}

But if I refresh the tab and check the theme.css file I have this CSS code instead:

.account-box .options{height:calc(-60%)}

I don't think it's appropriate removing the ones with vendor prefixes, but at least it should keep the 100% - 160px because it's only the same as -60% if the height is 100px...

agabi10 avatar Apr 07 '17 11:04 agabi10

Hey @agabi10 it's not a problem. The field Custom CSS is a Less CSS field.

In Less calc(100% - 160px) will compile to calc(-60%), to make what you want, you need to write this calc(~"100% - 160px")

karlprieb avatar Apr 07 '17 15:04 karlprieb

Thanks @karlprieb, and what about adding the vendor prefixes? I tried with .calc(height, ~'100% - 160px'); as I found searching through the code, but it only adds the normal one, without the prefixes.

agabi10 avatar Apr 07 '17 16:04 agabi10

Thanks @karlprieb, I had the same issue. Your solution fixed it.

jthomae1 avatar Jun 02 '17 07:06 jthomae1