Record the problem that the use of scss variables in the cacl() function does not take effect

question

  Use cacl() to dynamically calculate the height of an element, including an scss variable in the calculation. as follows:

    height: calc(100% - $ws-header-height);

  Found in the browser does not have the expected effect, the scss variable is not parsed. as follows:

solve

  Interpolation statement using scss #{}  

 height: calc(100% - #{$ws-header-height});

  It is parsed normally in the browser

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325249697&siteId=291194637