Skip to content

Commit 3a0b58d

Browse files
committed
Redesign
1 parent 08c3691 commit 3a0b58d

File tree

36 files changed

+2308
-1188
lines changed

36 files changed

+2308
-1188
lines changed

_includes/footer.html

+30-49
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,47 @@
1-
<footer class="site-footer">
2-
3-
<div class="wrap">
4-
5-
<h2 class="footer-heading">{{ site.title }}</h2>
6-
7-
<div class="footer-col-1 column">
8-
<ul>
9-
<li>{{ site.title }}</li>
10-
<li><a href="mailto:{{ site.email }}">{{ site.email }}</a></li>
11-
</ul>
12-
</div>
13-
14-
<div class="footer-col-2 column">
15-
<ul>
16-
{% if site.github_username %}<li>
17-
<a href="https://github.com/{{ site.github_username }}">
1+
<footer class="Footer">
2+
<div class="FixedWidth">
3+
<div class="Footer-Right">
4+
<p class="RssSubscribe">
5+
<a href="{{ "/feed.xml" | prepend: site.baseurl }}">subscribe via RSS</a>
6+
</p>
7+
<ul class="Socials">
8+
<li class="Social">
9+
<a title="Github: dimaip" href="https://github.com/dimaip">
1810
<span class="icon github">
19-
<svg version="1.1" class="github-icon-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
20-
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
11+
<svg version="1.1" class="github-icon-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
2112
<path fill-rule="evenodd" clip-rule="evenodd" fill="#C2C2C2" d="M7.999,0.431c-4.285,0-7.76,3.474-7.76,7.761
22-
c0,3.428,2.223,6.337,5.307,7.363c0.388,0.071,0.53-0.168,0.53-0.374c0-0.184-0.007-0.672-0.01-1.32
23-
c-2.159,0.469-2.614-1.04-2.614-1.04c-0.353-0.896-0.862-1.135-0.862-1.135c-0.705-0.481,0.053-0.472,0.053-0.472
24-
c0.779,0.055,1.189,0.8,1.189,0.8c0.692,1.186,1.816,0.843,2.258,0.645c0.071-0.502,0.271-0.843,0.493-1.037
25-
C4.86,11.425,3.049,10.76,3.049,7.786c0-0.847,0.302-1.54,0.799-2.082C3.768,5.507,3.501,4.718,3.924,3.65
26-
c0,0,0.652-0.209,2.134,0.796C6.677,4.273,7.34,4.187,8,4.184c0.659,0.003,1.323,0.089,1.943,0.261
27-
c1.482-1.004,2.132-0.796,2.132-0.796c0.423,1.068,0.157,1.857,0.077,2.054c0.497,0.542,0.798,1.235,0.798,2.082
28-
c0,2.981-1.814,3.637-3.543,3.829c0.279,0.24,0.527,0.713,0.527,1.437c0,1.037-0.01,1.874-0.01,2.129
29-
c0,0.208,0.14,0.449,0.534,0.373c3.081-1.028,5.302-3.935,5.302-7.362C15.76,3.906,12.285,0.431,7.999,0.431z"/>
13+
c0,3.428,2.223,6.337,5.307,7.363c0.388,0.071,0.53-0.168,0.53-0.374c0-0.184-0.007-0.672-0.01-1.32
14+
c-2.159,0.469-2.614-1.04-2.614-1.04c-0.353-0.896-0.862-1.135-0.862-1.135c-0.705-0.481,0.053-0.472,0.053-0.472
15+
c0.779,0.055,1.189,0.8,1.189,0.8c0.692,1.186,1.816,0.843,2.258,0.645c0.071-0.502,0.271-0.843,0.493-1.037
16+
C4.86,11.425,3.049,10.76,3.049,7.786c0-0.847,0.302-1.54,0.799-2.082C3.768,5.507,3.501,4.718,3.924,3.65
17+
c0,0,0.652-0.209,2.134,0.796C6.677,4.273,7.34,4.187,8,4.184c0.659,0.003,1.323,0.089,1.943,0.261
18+
c1.482-1.004,2.132-0.796,2.132-0.796c0.423,1.068,0.157,1.857,0.077,2.054c0.497,0.542,0.798,1.235,0.798,2.082
19+
c0,2.981-1.814,3.637-3.543,3.829c0.279,0.24,0.527,0.713,0.527,1.437c0,1.037-0.01,1.874-0.01,2.129
20+
c0,0.208,0.14,0.449,0.534,0.373c3.081-1.028,5.302-3.935,5.302-7.362C15.76,3.906,12.285,0.431,7.999,0.431z"></path>
3021
</svg>
3122
</span>
32-
<span class="username">{{ site.github_username }}</span>
3323
</a>
34-
</li>{% endif %}
35-
{% if site.twitter_username %}<li>
36-
<a href="https://twitter.com/{{ site.twitter_username }}">
24+
</li>
25+
<li class="Social">
26+
<a title="Twitter: dimaip" href="https://twitter.com/dimaip">
3727
<span class="icon twitter">
38-
<svg version="1.1" class="twitter-icon-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
39-
viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
28+
<svg version="1.1" class="twitter-icon-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
4029
<path fill="#C2C2C2" d="M15.969,3.058c-0.586,0.26-1.217,0.436-1.878,0.515c0.675-0.405,1.194-1.045,1.438-1.809
41-
c-0.632,0.375-1.332,0.647-2.076,0.793c-0.596-0.636-1.446-1.033-2.387-1.033c-1.806,0-3.27,1.464-3.27,3.27
42-
c0,0.256,0.029,0.506,0.085,0.745C5.163,5.404,2.753,4.102,1.14,2.124C0.859,2.607,0.698,3.168,0.698,3.767
43-
c0,1.134,0.577,2.135,1.455,2.722C1.616,6.472,1.112,6.325,0.671,6.08c0,0.014,0,0.027,0,0.041c0,1.584,1.127,2.906,2.623,3.206
44-
C3.02,9.402,2.731,9.442,2.433,9.442c-0.211,0-0.416-0.021-0.615-0.059c0.416,1.299,1.624,2.245,3.055,2.271
45-
c-1.119,0.877-2.529,1.4-4.061,1.4c-0.264,0-0.524-0.015-0.78-0.046c1.447,0.928,3.166,1.469,5.013,1.469
46-
c6.015,0,9.304-4.983,9.304-9.304c0-0.142-0.003-0.283-0.009-0.423C14.976,4.29,15.531,3.714,15.969,3.058z"/>
30+
c-0.632,0.375-1.332,0.647-2.076,0.793c-0.596-0.636-1.446-1.033-2.387-1.033c-1.806,0-3.27,1.464-3.27,3.27
31+
c0,0.256,0.029,0.506,0.085,0.745C5.163,5.404,2.753,4.102,1.14,2.124C0.859,2.607,0.698,3.168,0.698,3.767
32+
c0,1.134,0.577,2.135,1.455,2.722C1.616,6.472,1.112,6.325,0.671,6.08c0,0.014,0,0.027,0,0.041c0,1.584,1.127,2.906,2.623,3.206
33+
C3.02,9.402,2.731,9.442,2.433,9.442c-0.211,0-0.416-0.021-0.615-0.059c0.416,1.299,1.624,2.245,3.055,2.271
34+
c-1.119,0.877-2.529,1.4-4.061,1.4c-0.264,0-0.524-0.015-0.78-0.046c1.447,0.928,3.166,1.469,5.013,1.469
35+
c6.015,0,9.304-4.983,9.304-9.304c0-0.142-0.003-0.283-0.009-0.423C14.976,4.29,15.531,3.714,15.969,3.058z"></path>
4736
</svg>
4837
</span>
49-
<span class="username">{{ site.twitter_username }}</span>
5038
</a>
51-
</li>{% endif %}
39+
</li>
5240
</ul>
5341
</div>
54-
55-
<div class="footer-col-3 column">
56-
<p class="text">{{ site.description }}</p>
57-
</div>
58-
5942
</div>
60-
6143
</footer>
6244

63-
6445
<script>
6546
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
6647
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@@ -70,4 +51,4 @@ <h2 class="footer-heading">{{ site.title }}</h2>
7051
ga('create', 'UA-52948019-1', 'auto');
7152
ga('send', 'pageview');
7253

73-
</script>
54+
</script>

_includes/head.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
<meta charset="utf-8">
33
<meta http-equiv="X-UA-Compatible" content="IE=edge">
44
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
5-
<meta name="viewport" content="width=device-width">
5+
<meta name=viewport content="width=device-width, initial-scale=1">
66
<meta name="description" content="{{ site.description }}">
77
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
8-
9-
<!-- Custom CSS -->
8+
<!-- Custom CSS -->
109
<link rel="stylesheet" href="{{ "/css/my.css" | prepend: site.baseurl }}">
1110

1211
</head>

_includes/header.html

+7-20
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
1-
<header class="site-header">
1+
<header class="Header">
22

3-
<div class="wrap">
4-
<div class="site-title">
5-
<a class="site-title__link" href="{{ site.baseurl }}/">{{ site.title }}</a>
6-
<div class="site-title__moto" href="{{ site.baseurl }}/">{{ site.moto }}</div>
3+
<div class="FixedWidth">
4+
<div class="SiteTitle">
5+
<a class="SiteTitle-Link" href="{{ site.baseurl }}/">{{ site.title }}</a>
6+
<div class="SiteTitle-Moto" href="{{ site.baseurl }}/">{{ site.moto }}</div>
77
</div>
8-
<nav class="site-nav">
9-
<a href="#" class="menu-icon">
10-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
11-
viewBox="0 0 18 15" enable-background="new 0 0 18 15" xml:space="preserve">
12-
<path fill="#505050" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0
13-
h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
14-
<path fill="#505050" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484
15-
h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
16-
<path fill="#505050" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0
17-
c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
18-
</svg>
19-
</a>
20-
<div class="trigger">
8+
<nav class="Nav">
219
{% for page in site.pages %}
22-
{% if page.title %}<a class="page-link" href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a>{% endif %}
10+
{% if page.title %}<a class="Nav-Link" href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a>{% endif %}
2311
{% endfor %}
24-
</div>
2512
</nav>
2613

2714
</div>

_layouts/default.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77

88
{% include header.html %}
99

10-
<div class="page-content">
11-
<div class="wrap">
10+
<div class="FixedWidth">
1211
{{ content }}
13-
</div>
1412
</div>
1513

1614
{% include footer.html %}

_layouts/page.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
layout: default
33
---
4-
<div class="post">
4+
<div class="Post">
55

6-
<header class="post-header">
7-
<h1>{{ page.title }}</h1>
6+
<header class="PostHeader">
7+
<h1 class="H1">{{ page.title }}</h1>
88
</header>
99

10-
<article class="post-content">
10+
<article class="PostContent MarkDown">
1111
{{ content }}
1212
</article>
1313

_layouts/post.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
layout: default
33
---
4-
<div class="post">
4+
<div class="Post">
55

6-
<header class="post-header">
7-
<h1>{{ page.title }}</h1>
8-
<p class="meta">{{ page.date | date: "%b %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</p>
6+
<header class="PostHeader">
7+
<h1 class="H1">{{ page.title }}</h1>
8+
<p class="PostHeader-Meta">{{ page.date | date: "%b %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}</p>
99
</header>
1010

11-
<article class="post-content">
11+
<article class="PostContent MarkDown">
1212
{{ content }}
1313
</article>
1414

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
layout: post
3+
title: "Styleguide-driven Atomic Design pattern"
4+
date: 2014-07-07 23:23:32
5+
tags: css styleguide atomic-design
6+
comments: true
7+
---
8+
9+
#Preface
10+
I wanted to write a long post about all and everything in web development, but this proved to be very difficult, that's why I turn it into a collection of links and just an overview of technology, and write so more detailed posts on each technology later.
11+
12+
#The problem
13+
I have learned CSS back in 2005. Since then I've been thinking about writing CSS as a rather boring and mundane task. It's nothing like Domain Driven Design or MVC architecture, just a number of declarations bound by a selector.
14+
Over time I've noticed one ugly tendency: as the project grows, CSS code becomes the most ugly code of the project, looking like some stinking spaghetti. During last few months, I've discovered how flawed my practices had been, now I want to share the fruit of my latest discoveries with you, my dear reader!
15+
16+
The BAD way:
17+
18+
> 1. Designer prepares design combs in Photoshop and hands it in to you.
19+
> 2. You prepare a semantic HTML5 markup, with all of those `section` and `article` and what not.
20+
> 3. Then you go page by page and write CSS code, targeting your html elements and so-called 'semantic' class names like `.news`
21+
22+
What you got:
23+
24+
> 1. CSS that is a pain to maintain. For every new page of website you have to write new code.
25+
> 2. Inconsistent design: how many shades of grey has designer used? Different margins on every page. You bet!
26+
> 3. CSS tied deeply with HTML structure. Change markup and styles would have to change too. No good!
27+
> 4. Designer and developer don't have a common language to talk about design.
28+
29+
Here comes a set of patterns and tools to remedy the situation!
30+
31+
#Styleguide
32+
The foundation for any complex website design should come in a form of a styleguide -- a collection of reusable modules and patterns, out of which the pages are built.
33+
Styleguide is a bridge between a designer and a developer, a common language for the project. It takes time to build, but then constructing new pages becomes like playing Lego -- a lot of fun!
34+
35+
Nowadays styleguides don't come in the form of multipage PDF documents -- styleguide must live in a browser and be deeply tied with your CSS code, in fact that's where it must originate from. But more on that latter.
36+
37+
To read:
38+
1. alistapart
39+
40+
#Atomic design
41+
This may be my most valuable discovery -- atomic design pattern by Brad Frost.
42+
Atomic design is a language to talk about your web page elements: breaking design down to atoms and molecules is very energising!
43+
An *atom*: smallest particle of your design, something that is undividable and used everywhere like different types of headings, base colours and so on. By itself it may not carry a lot of sense.
44+
A *molecule*: a molecule usually joins a couple of atoms. i.e. a searchbox molecule may consist of a label + input field + a button atoms.
45+
An *organism*: even larger part of webpage. Consists of a combination of molecules i.e. a website header organism = site-title+menu+searchbox molecules.
46+
47+
For more details head straight to Brad Frost's [Pattern lab], you'll find some great examples there, though I can't recommend his tools or the style of writing CSS he uses.
48+
49+
50+
##Atoms
51+
* Unbreakable units of design.
52+
* Rarely applied directly in HTML, more like silent placeholders -- more often extended in molecules.
53+
54+
##Molecules
55+
* Compound units, consisting of multiple _atoms_.
56+
* Include atoms via SASS `extend`.
57+
* In backend, molecules may be defined in separate partials, though not necessary.
58+
* We don't create @extend molecules as we do with atoms.
59+
60+
##Organisms
61+
* Organisms, in its own place, consist of multiple molecules.
62+
* Almost certainly each organism is defined in separate partial in backend.
63+
64+
With atomic design, now you have a ubiquitous way to talk about your design elements with absolutely non-techie people (like designers).
65+
66+
#OOCSS, SMACSS
67+
68+
#BEM
69+
Block, Element, Modifier, a great naming scheme for your CSS classes.
70+
```
71+
.block__element--modifier
72+
.search-box{}
73+
.search-box__button{}
74+
.search-box--small{}
75+
```
76+
Getting your mind around BEM.
77+
78+
#Designer+Developer
79+
Every designer should understand the medium he's designing for, that's why any designer must know how to code!
80+
For the same reason, and developer should now something about #UX and the basics of designing things.
81+
Ideal situation, of course, is when designer and developer are the same person!
82+
[link to spiekermann]
83+
84+
#Tools
85+
Now for the little nifty tools I use to implement the forementioned.
86+
87+
* Hologram -- helps you to build styleguides directly from your CSS stylesheets.
88+
* CSScritic -- CSS _IS_ testable! Especially helpful during refactoring.
89+
* Browsersync -- better then live-reload: no need for a browser extension, view your site simultenuasly on multiple devices. Who would resist of building a test lab?
90+
* GruntJS -- Here's my grunt file to automate the tools above.
91+
* SublimeText -- userfreindly editor with hell of power. There's even a VIM mode!
92+
93+
94+
#PSD is a clue
95+
#Web Components?
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
layout: post
3+
title: "5 tips on making your Foundation based site faster"
4+
date: 2014-07-18 23:23:32
5+
tags: css optimisation foundation
6+
comments: true
7+
---
8+
I'm so ashamed for the performance of the sites I used to build. Hundreds of requests, megabytes of code… oh poor mobile visitors! I knew I had to stop being lazy and finally do something about it!
9+
In this post I'm going to suggest a few easy steps towards making your css framework based sites more speedy.
10+
11+
## 1. Partial load of components
12+
This one is easy. Don't import all of the Foundation's components into your stylesheet, you won't need them all! Foundation is really good at making code modular, that's why I'm not ashamed of using it even on production website, and only for mock-ups.
13+
Comment out general Foundation import:
14+
15+
```
16+
@import "Foundation";
17+
```
18+
And only import things as you need them.
19+
```
20+
@import …
21+
```
22+
23+
## 2. Don't output unneeded classes to HTML, use mixins
24+
25+
Another strong point about Foundation, is that you can avoid outputing unneccessary style defenitions at all.
26+
For example, for the `block-grid` component you probably don't need all of possible definitions for different screens and sizes in your code.
27+
Solution: use mixins!
28+
First disable output of block-grid's styles into the stylesheet: `asdfas`
29+
And than import desired mixin where needed.
30+
```
31+
32+
```
33+
34+
## 3. Remove unused styles (with unCSS)
35+
36+
This is a good test of how well you did with previous advices. Determine how many style definitions you have left in your stylesheet. I used the extension for Firefox called AAA, you may look for other tools as well. After optimization, I only had about 15% of overhead in CSS, which is only I couple of KB's. I suggest that you try to optimize CSS on your own, but if you give up, try to use unCSS utillity. It works as a grunt plugin, so there should be no problem adding it to your Gruntfile.js.
37+
38+
## 4. Lazy load everything you can
39+
40+
### JS
41+
42+
If you have not overused JavaScript, your page should look pretty fine without it, except for few animations. So why make people wait for your JS code to load?
43+
I've seen people using `defer` and `async` attributes for this purpose, but with most browsers it wouldn't work! Use this old school code instead:
44+
45+
```
46+
```
47+
### CSS
48+
49+
Yes, CSS is render-blocking too. If you have a large CSS file you'll make your user stare at a blank screen while CSS is loading. On mobile, that may be a problem.
50+
51+
There is only one real solution: separate CSS code for above-the-fold content from your main CSS, load it first and defer loading of main CSS with this script:
52+
53+
```
54+
```
55+
56+
But if your CSS is written in a modular way, it will be very hard to separate the code which is responsible just for this part of the page. There are tools which help you do it (), but I decided that in my case it's not worth it.
57+
58+
To make the pain of mobile users a little easier, I've thought out an idea of using CSS loading screen, which will reassure the user that the page is loading indeed, and may even show some critical information. Here I've written about this technique in greater detail: []()
59+
60+
### HTML
61+
62+
If your landing page is very heavy, I suggest to leave only the most critical top-most parts in HTML, and load the rest with AJAX requests. News, related articles, all but the most important content are a good candidates for being pushed out of main HTML.
63+
It should be pretty straightforward using jQuery, so I'm not going to write about it.
64+
65+
## 5. Learn atomic design or other OOCSS technique
66+
67+
This is probably the hardest part: learn to write CSS in a modular way! This is not just some technique, and therefore requires you [put your thought in it]. Google-up OOCSS, SMACSS, atomic design and learn to think about your CSS code in a new way.
68+
Once refactored, your code size will decrease dramatically and will scale great! And maintanace will become a joy, guranteed! :)
69+
70+
71+
72+
##Conclusion
73+
Go for the low hanging fruit.

0 commit comments

Comments
 (0)