paco@hyves.nl
Lower case for tags:
<section></section>
Double quotation marks for attributes
<input type="text" />
Separate words in ID and class names by a hyphen
<section class="article-content"></section>
Use this kind of hierarchical names
<article class="article"> <h2 class="article-title"></h2> <section class="article-description"></section> <section class="article-content"> <p class="article-content-lead"></p> </section> </article>
NO inline CSS!
<div style="color:green;">Success!</div>
NO inline Javascript!
<a href="/" onclick="alert('You clicked!')"> Click me! </a>
*(unless you are actually representing a data table)
*(People like me should be able to understand them)
If there are many differences, probably we need 2 templates.
Only the call to init the presenter
Before writing custom HTML, please check if we have patterns that do the same thing.
Also check Andamio documentation
ALWAYS try to reuse the common styles
Use classes, not IDs
Use the variables defined in LESS
There are colors and sizes defined there
Simple selectors
.article-title
Instead of complicated ones
#main-content .article h2.article-title
Use classes instead of general tags
Use hyphen-separated names, not camelCase
Yes, also for the IDs
.button { background: red; &:hover { background: green; } }
.button { background: red; .theme-blue & { background: blue; } }
.item { .item-tile{ } } //The same as .item .item-title {}
You can use variables
Actually, you SHOULD use them
We also have a few mixins
But please use with moderation
Do not mess the global namespace
Declare your variables inside your module
Functionality related to a template?
Place it inside a presenter
Loading time is important...
... but also parsing takes time in mobile devices
Class to identify an element that will be accessed with Javascript, or tests.
This means you will be careful to change it.
No styling here.
Even if style and markup changes, this will be still there and working.
Class to identify an element that will have and action associated when interacting with it.
Also, no styling
There are many things that andamio provides
The Internets provide also a lot of stuff, but...
...make sure it's efficient
Up: .closest(selector)
Down: .find(selector)
Better than $("#iLoveIds")