Open FrancescoK opened 9 years ago
:+1: no strong feelings about {{ viewModel }}
vs {{viewModel}}
.
I like the {{ viewModel }}
version better.
Anything about html tags with lots of attributes on multiple lines vs. single line? (I like to arrange them vertically.)
We should agree on some transition process. Reordering all attributes e.g. right now wouldn't feel like responsible use of time =).
@febeling We could leave attributes on multiple lines vs. single line to the author’s judgement. It’s more readable if it’s a lot and helps not exceed a certain line-length, but for two or three might be too much?
As for transition process, the “scout rule” seems reasonable: Correct the style when you work in a template/HTML file, but let’s not go back through the entire codebase just to fix style.
@FrancescoK sounds both reasonable
+1 on {{ viewModel }}
. +1 on "scout rule". If we're enforcing attribute order, I'd suggest id
first as it has higher CSS specificity. Regarding multi/single line attributes, I prefer the former as it's easier to Git (akin to JS function params).
Enforcing these rules is going to be tricky. Is there a decent HTML linter? tidy is painful to work with.
IDs first makes sense, though I would argue they should only be used as JS hooks, never for styling (following csswizardry’s advice) precisely because of their heavyweight specificity.
+1 on never using id's for styling, and actually not even for JS hooks either: I prefer to just 'js-' prefixed class-names. That way you can easily add the hook to multiple elements at a later date.
Suggestion:
Syntax
(mostly from mdo’s codeguide.co):
</li>
or</body>
).Attribute order
HTML attributes should come in this particular order for easier reading of code.
Angular:
<span translate>
for localized strings instead of setting translate on another elementTo discuss: