Ghent - sept 6th, 2013
HTML & CSS architect
I suck @ JS :-(
This is my workflow and it's under constant evaluation and subject to change. No need to copy it, instead: be inspired.
{%include nav.html%}
{% if page.url contains 'news' %}class="current"{% endif %}
Include parameters
{% include button-group.html param='flr' %}
in _includes/button-group.html
Parameter value can be a string, integer or boolean.
Requires Jekyll 1.1.0 and up
{% include button-group.html modifier='pull-right' %}
in _includes/button-group.html
Output
{% include read-later.html modifier='pull-right' digit=223 %}
in _includes/read-later.html
{% if include.digit %}
{{ include.digit }}
{% else %}
456
{% endif %}
Output
223
Block - Element - Modifier
...
...
...
...
/* Bad */
.pageHeader {}
.button--blue {}
/* Good */
.page-header {}
.button--primary {}
/* old skool */
article > header {}
/* old skool + Smacss theming */
.theme--x-mas article > header {}
/* BEM */
.article__header {}
/* BEM + SMACSS theming */
.theme--x-mas .article__header {}
Scalable and Modular Architecture for CSS
smacss.com
/* no classes here, only element selectors */
body {}
p {}
a {}
/* grid */
.col {}
.col--2 {}
.col--primary {}
/* layout specific: .layout-- prefix */
.layout--homepage {}
.layout--
classes are added to the html
tag
Biggest chunk of your CSS file
/* skip the prefix, it's too verbose */
.module-carousel {}
/* that's the way, uhu uhu */
.carousel {}
/* .is- prefix */
.is-active {}
.is-hidden {}
.is-collapsed {}
.is-expanded {}
Will you need this one?
.theme--members .article {
display: boobs; /* tetn */
}
.theme--x-mas blockquote:before {
content: 'hohoho';
}
.theme--
classes are added to the html
tag
| - sass
| - base
_base.scss
_normalize.scss
_defaults.scss
_webfonts.scss
...
| - layout
_layout.scss
_grid.scss
_sections.scss
...
| - modules
_modules.scss
_carousel.scss
_pagination.scss
...
| - state
_state.scss
...
| - theme
_theme.scss
_x-mas.scss
...
_site-settings.scss
_mixins.scss
main.scss
Terminal windows overload
I ♥ styleguides
a.k.a. manual labour
Handcoded HTML or markdown files
{%include nav.html%}
Grunt, again, to the rescue.
CSS comments in markdown style
Sections based on chapter numbers
CSS comments in KSS style