sass / node-sass

:rainbow: Node.js bindings to libsass

Home Page:https://npmjs.org/package/node-sass

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unit is removed when value is 0 from css-vars

csaggo opened this issue · comments

when defining a css variable like so:

:root {
--varname: 0px;
}

it results in:
:root {
--varname: 0;
}
so the unit is removed in case the value is 0.

this results in calc() not working correctly in the browser:

left: calc(50% - var(--varname)) results in left: 0
while when the unit is contained in the variable the result will be left: 800px (in case the container is 1600px for example as expected)

  • NPM version 9.6.5
  • Node version v18.16.0
  • Node Process {
    node: '18.16.0',
    acorn: '8.8.2',
    ada: '1.0.4',
    ares: '1.19.0',
    brotli: '1.0.9',
    cldr: '42.0',
    icu: '72.1',
    llhttp: '6.0.10',
    modules: '108',
    napi: '8',
    nghttp2: '1.52.0',
    nghttp3: '0.7.0',
    ngtcp2: '0.8.1',
    openssl: '3.0.8+quic',
    simdutf: '3.2.2',
    tz: '2022g',
    undici: '5.21.0',
    unicode: '15.0',
    uv: '1.44.2',
    uvwasi: '0.0.15',
    v8: '10.2.154.26-node.26',
    zlib: '1.2.13'
    }
  • Node Platform darwin
  • Node architecture x64
  • node-sass version 8.0.0:
  • npm node-sass versions node-sass@8.0.0

My bad, the unit gets removed by my css-minifyer not by node-sass. issue is closed.