带插值变量的数学运算?

ass CSS

番长

2020-03-23

考虑以下sass:

$font-size: 18;                 
$em: $font-size;

$column: $font-size * 3;        // The column-width of my grid in pixels
$gutter: $font-size * 1;        // The gutter-width of my grid in pixels

$gutter-em: #{$gutter / $em}em; // The gutter-width in ems.
$column-em: #{$column / $em}em; // The column-width in ems;

$foo = $gutter-em / 2; // This results in a value like "1em/2". :(
$bar = ($gutter-em / 2); // this doesn't work either, same as above.

如何生成$foo可以正常使用的,可以在其他表达式中进一步使用的?

第2926篇《带插值变量的数学运算?》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点

0个回答

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android