SASS中有多行吗?
我无法从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,Sass 不支持多行语句 (https://github.com/sass/sass/issues/ 216)。但 Sass3 中新的 SCSS 语法确实如此,因为它与空格无关,就像 CSS 一样。
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.