Skip to content

Commit

Permalink
Change HTML style guide. Specify that the opening tag's closing brack…
Browse files Browse the repository at this point in the history
…et goes on its own line.

Former-commit-id: 4cc4252
  • Loading branch information
cjcenizal committed Jun 27, 2016
1 parent c48964e commit 7c15a56
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions style_guides/html_style_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,26 @@

## Multiple attribute values

When a node has multiple attributes that would cause it to exceed the 80-character line limit, each attribute including the first should be on its own line with a single indent. Also, when a node that is styled in this way has child nodes, there should be a blank line between the opening parent tag and the first child tag.
When a node has multiple attributes, each attribute including the first should be on its own line with a single indent.

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.

```
<ul
<div
attribute1="value1"
attribute2="value2"
attribute3="value3">
attribute3="value3"
>
Hello
</div>
```

If the node doesn't have child notes, add the closing tag on the same line as the opening tag's closing bracket.

<li></li>
<li></li>
...
</ul>
```
<div
attribute1="value1"
attribute2="value2"
attribute3="value3"
></div>
```

0 comments on commit 7c15a56

Please sign in to comment.