SASS输出的自定义缩进类型 [英] Custom Indentation Type for SASS Output

查看:205
本文介绍了SASS输出的自定义缩进类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队正在与一个供应商合作,该供应商更喜欢4空间硬标签而不是SASS扩展输出样式附带的2空间软标签(我知道,我知道-我们试图将他们讲解为2空间交易,但他们不会让步).我们使用领班来处理我们所有的编译,因此我们无法从表面上访问sass-convert命令,可让您在编译期间设置缩进样式.

My team is working with a vendor who prefers a 4-space hard tab to the 2-space soft tab that comes with the SASS expanded output style (I know, I know - we tried to talk them into the two-space deal, but they won't budge). We use Foreman to handle all of our compiling, so we don't have surface-level access to the sass-convert command that lets you set the indent-style during compilation.

我熟悉能够为SASS更改4种不同的输出样式,并且我知道您可以在本地环境中更改选项卡样式,例如

I'm familiar with being able to change the 4 different output styles for SASS, and I know that you can change the tab style on your local environment like in this ticket, but I was wondering if there's a way to do this automatically through the config.rb file where we set the output style to start with.

推荐答案

没有诸如"4空间硬标签"之类的东西.硬标签只是一个字符.

There's no such thing as "4-space hard tabs". A hard tab is just a character.

由编辑器设置决定应显示的标签宽度.您可以将其设置为2、4、8个空格,并且不会更改源代码.

It is editor settings that decide how wide a tab should be displayed. You can set it to be two, four, eight spaces wide, and it will not alter the source code.

问题在于 SASS确实支持缩进选项卡,其中一个选项卡表示一种缩进级别.因此,对您来说应该没有问题.

The matter is that SASS does support tabs for indentation, with one tab meaning one level of indentation. So there should be no problem for you.

如果您正在谈论CSS文件的缩进,我真的不明白为什么这对您的团队有任何意义.如果您使用的是SASS,则不应编辑CSS文件,而很少打开CSS文件(大多数调试都在FireBug之类的开发人员工具中进行,您是否知道

If you're talking about the indentation of CSS files, i really don't understand why this is of any significance for your team. If you're using SASS, CSS files are not supposed to be edited and are rarely ever opened (most debugging takes place in developer tools like FireBug, are you aware of debug_info and source maps?). In production CSS is minified and all white space is purged.

考虑采用任务运行器工具,例如 Grunt .您可以在开发例程周期的特定阶段利用它来解析生成的CSS文件.如果您这样做,也可以使用出色的 autoprefixer 工具.

Consider adopting a task runner tool like Grunt. You can leverage it to parse resulting CSS files at certain stage of the development routine cycle. You can also make use of the brilliant autoprefixer tool if you go this way.

PS两个空格是Ruby社区的标准缩进,SASS主要是其中的一部分.您的团队正在阻止潮流.

PS Two spaces is the standard indentation for the Ruby community, which SASS is mostly a part of. You team is kinda stemming the tide.

这篇关于SASS输出的自定义缩进类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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