我们如何使用以下操作进行操作:较小的根变量(CSS vars)?

发布于 2025-01-24 16:41:46 字数 368 浏览 5 评论 0原文

我正在尝试使用更少的根变量进行操作。

例如

:root{
  --padding-md: 5px;
}

@padding-md: ~'var(--padding-md)'; // we get the CSS var
@padding-double: @padding-md + 5px; //we try to add 5px

,否则

@padding-md: calc(5px + 3px) + 5px; // we get the CSS var

就丢了OP 这可能吗?怎么做?

有一种方法可以告诉较少设置CSS CANC功能而不是使操作不影响默认的操作?

I´m trying to make operations with the root variables using less.

For example

:root{
  --padding-md: 5px;
}

@padding-md: ~'var(--padding-md)'; // we get the CSS var
@padding-double: @padding-md + 5px; //we try to add 5px

Or this

@padding-md: calc(5px + 3px) + 5px; // we get the CSS var

But LESS just throw the op
Is this possible? How to do that?

there is a way to tell to LESS set the CSS CALC function instead make the operations without affect the default less operations?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文