SCSS(无礼)计算:#{} [英] SCSS (sass) calculation: #{}

查看:37
本文介绍了SCSS(无礼)计算:#{}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在计算字体大小时,我很困惑

i'm quite confused at the moment when it comes to calculating a font-size

这是我已经使用的正常计算.

this is the normal calculation I already use.

字体大小:#{($ font-size * 0.7)/$ em} em

我现在想做的就是将上面的整个陈述与另外一个……我知道的听起来很复杂.

What I wanna do now is divide an entire statement like the one above with another one … sounds complicated I know.

所以我有#{($ font-size * 0.7)/$ em} 我有#{(($ font-size * 0.8125)/$ em}

我现在要定义这两个值...

I want to devide those two values now …

所以 font-size:#{($ font-size * 0.7)/$ em}/#{($ font-size * 0.8125)/$ em} em .

但这不起作用.知道我如何使用SASS进行这样的计算吗?

But that doesn't work. Any idea how I do a calculation like that with SASS?

推荐答案

尝试:

font-size: #{(($font-size*0.7) / $em) / (($font-size*0.8125) / $em)}em

重新插入字符串#{...} 应该是计算之后要做的最后一件事.

The interpolation back into a string #{...} should be the last thing done after the calculations.

这篇关于SCSS(无礼)计算:#{}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆