[英]Sublime Text: Reindent SCSS files?
我有一些SCSS文件,這些文件的縮進在某種程度上設法得到了很好的解決。
我嘗試過執行“ Edit > Line > Reindent
並更改各種縮進設置,但似乎都無法正常工作。
是否有一致的方式來重新縮進SCSS文件?
我所看到的例子:
[role="main"] {
margin: 0 auto;
padding: 30px;
h1 {
text-align: center;
font-family: 'Exo';
font-weight: 200;
font-size: 3.5em;
margin: 8px 0 20px 0;
}
}
.hidden {
display: none;
}
.button, button {
@include button;
&.red {
@include button($red);
}
}
這發生在數千行SCSS中……我寧願不必手動手動縮進。
選擇所有內容,然后按Ctrl - [ (取消縮進)幾次,以刪除所有原始縮進。 然后,使用Edit -> Line -> Reindent
,它應該可以正常工作。 您的示例代碼為我生成了此代碼:
[role="main"] {
margin: 0 auto;
padding: 30px;
h1 {
text-align: center;
font-family: 'Exo';
font-weight: 200;
font-size: 3.5em;
margin: 8px 0 20px 0;
}
}
.hidden {
display: none;
}
.button, button {
@include button;
&.red {
@include button($red);
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.