WordCamp NL, May 11th 2014
Gaya Kessler
Blog: http://www.gayadesign.com
Slides: http://talk.gayadesign.com
Twitter: @gayadesign
HTML, CSS, images, JavaScript, other assets, optimization of assets, optimization for the browser, unit tests uitvoeren
here we go again...
optimization of assets, optimization for the browser, unit tests uitvoeren
CSS is not manageable.
JavaScript is a pile of junk.
Optimization is time expensive.
$ gem install sass
$header-color: #666;
$body-color: #333;
body {
color: $body-color;
}
h1, h2, h3, h4 {
color: $header-color;
}
body {
color: #333;
}
h1, h2, h3, h4 {
color: #666;
}
.header {
ul {
margin: 0px;
li {
padding: 0px;
font: {
family: 'Open Sans', sans-serif;
size: 21pt;
}
&:hover {
background: #666;
}
}
}
}
.header ul {
margin: 0px;
}
.header ul li {
padding: 0px;
font-family: 'Open Sans', sans-serif;
font-size: 21pt;
}
.header ul li:hover {
background: #666;
}
/* _settings.scss, _layout.scss */
@import "settings";
@import "layout";
body {
background-color: $body-color;
color: $body-text;
}
@mixin fix-for-ie6($display) {
display: $display;
}
header {
@include fix-for-ie6(none);
}
header {
display: none;
}
.button {
border-radius: 2px;
background: #eee;
color: #420;
}
.submit {
@extend .button;
}
.next {
@extend .button;
}
.button, .submit, .next {
border-radius: 2px;
background: #eee;
color: #420;
}
<element class="block--modifier">
<element class="block__element" />
</element>
.block {
position:relative;
width: 50px;
&__element {
position:absolute;
}
&--modifier {
@extend .block;
width: 100px;
height: 10px;
}
}
.block, .block--modifier {
position: relative;
width: 50px;
}
.block__element {
position: absolute;
}
.block--modifier {
width: 100px;
height: 10px;
}
$ gem install compass
relative_assets = true
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
output_style = :expanded # After dev :compressed
line_comments = true
preferred_syntax = :scss
@import "compass/utilities/sprites";
@import "silk-icons/*.png";
.add-button {
@include silk-icons-sprite("add");
}
.silk-icons-sprite, .add-button {
background: url('../images/silk-icons-sfbf7044fd4.png') no-repeat;
}
.add-button {
background-position: 0 -16px;
}
$ npm install -g grunt-cli
{
"name": "project-name",
"version": "1.3.37",
"description": "An example project!",
"main": "",
"scripts": {
"test": "grunt test"
},
"author": "Gaya Kessler",
"license": "MIT",
"devDependencies": {
"grunt": "~0.4.2"
}
}
$ npm install grunt --save-dev
Blog: http://www.gayadesign.com
Slides: http://talk.gayadesign.com
Twitter: @gayadesign