From 045e654c155cb0f673399238df66eec054e8848f Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Fri, 23 Dec 2016 12:16:51 -0800 Subject: [PATCH] Explain rationale of HTML bracket formatting in HTML style guide. (#9629) --- style_guides/html_style_guide.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/style_guides/html_style_guide.md b/style_guides/html_style_guide.md index 01406c670616..7297619ae36c 100644 --- a/style_guides/html_style_guide.md +++ b/style_guides/html_style_guide.md @@ -3,9 +3,11 @@ ## Multiple attribute values -When a node has multiple attributes, each attribute including the first should be on its own line with a single indent. +When an element has multiple attributes, each attribute including the first should be on its own line with a single indent. +This makes the attributes easier to scan and compare across similar elements. -The closing bracket should be on its own line. This allows attributes to be shuffled and edited without having to move the bracket around. It also makes it easier to scan vertically and match opening and closing brackets. +The closing bracket should be on its own line. This allows attributes to be shuffled and edited without having to move the bracket around. It also makes it easier to scan vertically and match opening and closing brackets. This format +is inspired by the positioning of the opening and closing parentheses in [Pug/Jade](https://pugjs.org/language/attributes.html#multiline-attributes). ```
``` -If the node doesn't have child notes, add the closing tag on the same line as the opening tag's closing bracket. +If the element doesn't have children, add the closing tag on the same line as the opening tag's closing bracket. ```