mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-06-22 04:58:40 +00:00
add clarification comment
This commit is contained in:
@@ -25,6 +25,9 @@ export async function formatCSS(view) {
|
|||||||
bracketSpacing: true,
|
bracketSpacing: true,
|
||||||
endOfLine: 'lf'
|
endOfLine: 'lf'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//format manually single declaration rules to span one line.
|
||||||
|
//Prettier can't do it by default, this is crude but it works
|
||||||
formatted = formatted.replace(
|
formatted = formatted.replace(
|
||||||
/([^{]+)\{\s*\n\s*([^;\n]+:[^;\n]+;)\s*\n\s*\}/g,
|
/([^{]+)\{\s*\n\s*([^;\n]+:[^;\n]+;)\s*\n\s*\}/g,
|
||||||
(_, selector, decl)=>`${selector.trim()} { ${decl.trim()} }`
|
(_, selector, decl)=>`${selector.trim()} { ${decl.trim()} }`
|
||||||
|
|||||||
Reference in New Issue
Block a user