开发者

Is there a multiline in SASS? [duplicate]

This question already has answers here: SASS indented syntax on multiple lines? 开发者_运维知识库 (2 answers) Closed 7 years ago.

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? :)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜