1
在stylelint是否可以爲規則declaration-block-properties-order
嵌套數組?我很好奇,因爲我真的希望執行類似於Nicolas Gallagher's Idiomatic CSS的聲明訂單。不過,我並不在乎填充或邊距是否先到達。Stylelint嵌套聲明順序陣列
我知道我可以有這個規定很容易地做到這一點...
"declaration-block-properties-order":
[
{
properties: [
"position",
"top",
"right",
"bottom",
"left",
"z-index"
],
},
{
order: "flexible",
properties: [
"padding",
"margin"
],
},
]
但是......什麼我希望做的是指定填充和保證金組的順序,所以保證金,保證金-top,margin-right,margin-bottom和margin-left只能按此順序出現,與填充相同......但不關心哪個組是第一個。我試過嵌套數組,但我不確定這是可能的還是我的語法錯誤。
"declaration-block-properties-order":
[
{
order: "flexible",
properties: [
{
properties: [
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left"
],
},
{
properties: [
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left"
],
},
],
},
]
但我不希望它接受保證金,保證金頂部,填充,保證金,權利,填充權。我想要組織兩個組,但不關心填充或保證金組是否是第一個。
非常感謝! – Octoxan