SASS中有多行吗?

发布于 2024-08-23 19:45:28 字数 792 浏览 5 评论 0原文

我无法从 SASS 文档中弄清楚这一点。例如,我想使用带有 5 个参数的 Compass mixin:

=link-colors(!normal, !hover = false, !active = false, !visited = false, !focus = false)

我想声明 5 个具有语义上可理解的名称的常量,如下所示:

!top_line_navigation_link_normal_color = #00c
!top_line_navigation_link_hover_color = #0cc
!top_line_navigation_link_active_color = #c0c
!top_line_navigation_link_visited_color = #ccc
!top_line_navigation_link_focus_color = #cc0

然后在下面的某个位置将 compass mixin 添加到我的 mixin 中:

+link-colors(!top_line_navigation_link_normal_color, !top_line_navigation_link_hover_color, !top_line_navigation_link_active_color, !top_line_navigation_link_visited_color, !top_line_navigation_link_focus_color)

该行太长了。我对这个问题不是很认真。但是可以制作多行吗? :)

I couldn't figure out that from SASS documentation. For example I would like to use Compass mixin with 5 parameters:

=link-colors(!normal, !hover = false, !active = false, !visited = false, !focus = false)

I would like to declare 5 constants with semantically understandable names like those:

!top_line_navigation_link_normal_color = #00c
!top_line_navigation_link_hover_color = #0cc
!top_line_navigation_link_active_color = #c0c
!top_line_navigation_link_visited_color = #ccc
!top_line_navigation_link_focus_color = #cc0

and then somewhere below add compass mixin to my mixin:

+link-colors(!top_line_navigation_link_normal_color, !top_line_navigation_link_hover_color, !top_line_navigation_link_active_color, !top_line_navigation_link_visited_color, !top_line_navigation_link_focus_color)

The line is long too much. I'm not very serious with this question. But is it possible to make multiline? :)

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撩心不撩汉 2024-08-30 19:45:28

No, Sass does not support multiline statements (https://github.com/sass/sass/issues/216). But the new SCSS syntax in Sass3 does because it is whitespace agnostic, just like CSS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文