Skip to content

Commit e96ce4c

Browse files
committed
Better CSS inlining
1 parent 7f75780 commit e96ce4c

19 files changed

Lines changed: 232 additions & 130 deletions

_includes/css/carousel.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*!
2+
* inuitcss, by @csswizardry
3+
*
4+
* github.com/inuitcss | inuitcss.com
5+
*/.carousel{overflow:hidden;width:100%;text-align:center}.carousel__panes{margin:0;padding:0;list-style:none;position:relative;display:table;width:500%;overflow:hidden;-webkit-filter:blur(0);-moz-filter:blur(0);filter:blur(0);-webkit-animation:carousel 45s alternate infinite;-moz-animation:carousel 45s alternate infinite;animation:carousel 45s alternate infinite}.carousel__panes:hover{-webkit-animation-play-state:paused;-moz-animation-play-state:paused;animation-play-state:paused}.carousel__pane{position:relative;display:table-cell;vertical-align:middle;width:20%}.carousel__link{color:inherit;border-bottom:1px solid #ddd;font-weight:300;-webkit-transition:0.2s border-color;-moz-transition:0.2s border-color;transition:0.2s border-color}.carousel__link:hover,.carousel__link:active,.carousel__link:focus{text-decoration:none;border-bottom-color:#c4c4c4}@-webkit-keyframes carousel{0%,
6+
17.5%{-webkit-transform:translate3d(0, 0, 0);-webkit-filter:blur(0)}20.625%,
7+
38.125%{-webkit-transform:translate3d(-20%, 0, 0);-webkit-filter:blur(0)}41.25%,
8+
58.75%{-webkit-transform:translate3d(-40%, 0, 0);-webkit-filter:blur(0)}61.875%,
9+
79.375%{-webkit-transform:translate3d(-60%, 0, 0);-webkit-filter:blur(0)}82.5%,
10+
100%{-webkit-transform:translate3d(-80%, 0, 0);-webkit-filter:blur(0)}19.0625%,
11+
39.6875%,
12+
60.3125%,
13+
80.9375%{-webkit-filter:blur(2px)}}@-moz-keyframes carousel{0%,
14+
17.5%{-moz-transform:translate3d(0, 0, 0);-moz-filter:blur(0)}20.625%,
15+
38.125%{-moz-transform:translate3d(-20%, 0, 0);-moz-filter:blur(0)}41.25%,
16+
58.75%{-moz-transform:translate3d(-40%, 0, 0);-moz-filter:blur(0)}61.875%,
17+
79.375%{-moz-transform:translate3d(-60%, 0, 0);-moz-filter:blur(0)}82.5%,
18+
100%{-moz-transform:translate3d(-80%, 0, 0);-moz-filter:blur(0)}19.0625%,
19+
39.6875%,
20+
60.3125%,
21+
80.9375%{-moz-filter:blur(2px)}}@keyframes carousel{0%,
22+
17.5%{transform:translate3d(0, 0, 0);filter:blur(0)}20.625%,
23+
38.125%{transform:translate3d(-20%, 0, 0);filter:blur(0)}41.25%,
24+
58.75%{transform:translate3d(-40%, 0, 0);filter:blur(0)}61.875%,
25+
79.375%{transform:translate3d(-60%, 0, 0);filter:blur(0)}82.5%,
26+
100%{transform:translate3d(-80%, 0, 0);filter:blur(0)}19.0625%,
27+
39.6875%,
28+
60.3125%,
29+
80.9375%{filter:blur(2px)}}

_includes/css/client-list.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*!
2+
* inuitcss, by @csswizardry
3+
*
4+
* github.com/inuitcss | inuitcss.com
5+
*/.client-list-title{text-align:center;font-size:16px;font-size:1rem;line-height:1.5;text-transform:uppercase;letter-spacing:0.1em;color:#fcc1ce;-webkit-font-smoothing:auto}.client-list{margin:0;padding:0;list-style:none;text-align:center}.client-list__item{display:inline-block;padding:12px}@media screen and (min-width: 720px){.client-list__item{padding:24px}}.client-list__logo{background-color:#fcc1ce;height:24px;transition:0.2s}.client-list__logo:hover{background-color:#f9f9f9}@media screen and (min-width: 720px){.client-list__logo{height:48px}}

_includes/css/csswizardry.min.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_includes/css/feature-list.css

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_includes/css/page-head--masthead.css

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_includes/csswizardry.min.css

Lines changed: 0 additions & 30 deletions
This file was deleted.

_includes/head.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,19 @@
2020
<link rel="preconnect" href="https://www.google-analytics.com">
2121

2222
<style>
23-
{% include csswizardry.min.css %}
23+
24+
{% include css/csswizardry.min.css %}
25+
26+
{% if page.page-class == "page--home" %}
27+
{% include css/page-head--masthead.css %}
28+
{% include css/carousel.css %}
29+
{% include css/client-list.css %}
30+
{% endif %}
31+
32+
{% if page.page-class == "page--case-studies" or page.page-class == "page--services" %}
33+
{% include css/feature-list.css %}
34+
{% endif %}
35+
2436
</style>
2537

2638
<title>{{ page.title }} &ndash; CSS Wizardry &ndash; CSS, OOCSS, front-end architecture, performance and more, by Harry Roberts</title>

css/_components.page-head.scss

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
#PAGE-HEAD
33
\*------------------------------------*/
44

5-
$header-border-width: 6px;
6-
$header-max-height: 480px;
7-
85
/**
96
* The site’s main page-head can have two different states:
107
*
@@ -42,83 +39,3 @@ $header-max-height: 480px;
4239

4340

4441

45-
46-
/**
47-
* Large site headers act more like mastheads. They have a faux-fluid-height
48-
* which is controlled by the wrapping element inside it.
49-
*
50-
* 1. Mastheads will typically have dark backgrounds, so we need to make sure
51-
* the contrast is okay. This value is subject to change as the background
52-
* image changes.
53-
* 2. We need to delegate a lot of the masthead’s layout to its wrapper element
54-
* rather than the masthead itself: it is to this wrapper that most things
55-
* are positioned.
56-
* 3. The wrapper needs positioning context for us to lay our nav and masthead
57-
* text in.
58-
* 4. Faux-fluid-height technique: simply create the illusion of fluid height by
59-
* creating space via a percentage padding, and then position everything over
60-
* the top of that. This percentage gives us a 16:9 ratio.
61-
* 5. When the viewport is at 758px wide, our 16:9 ratio means that the masthead
62-
* is currently rendered at 480px high. Let’s…
63-
* 6. …seamlessly snip off the fluid feature at this height, and…
64-
* 7. …fix the height at 480px. This means that we should see no jumps in height
65-
* as the masthead moves from fluid to fixed. This actual value takes into
66-
* account the padding and the top border on the header itself.
67-
*/
68-
.page-head--masthead {
69-
70-
// Optional Base64 version instead of a gradient.
71-
$bg-grad: linear-gradient(to right, #807363 0%, #251d16 50%, #3f302b 75%, #100b09 100%);
72-
$bg-grad: url('data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAABkAAD/7gAmQWRvYmUAZMAAAAABAwAVBAMGCg0AAAICAAACpgAAAzEAAAO5/9sAhAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAgICAgICAgICAgIDAwMDAwMDAwMDAQEBAQEBAQIBAQICAgECAgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwP/wgARCAALABADAREAAhEBAxEB/8QAswABAQAAAAAAAAAAAAAAAAAACAcBAQADAAAAAAAAAAAAAAAAAAUBBAYQAAECBgIDAAAAAAAAAAAAAAIAAwETBDQFBhEyFBYHEQAABAQFAgcBAAAAAAAAAAABEQIDEgQUBQBBIhMVITUxMkJTJDQlBhIAAQMDAwUAAAAAAAAAAAAAAQAxEhFBAvDBA5Gh8TJSEwACAgEDBAMBAQAAAAAAAAABEQAhMUFRYfBxgZGh0eGx8f/aAAwDAQACEQMRAAABIJaIutSiMk7MtIZ//9oACAEBAAEFAvtFQORf23C0+Jd3iZ7ttfX/2gAIAQIAAQUCF0H0EDFY/jx4Xf8A/9oACAEDAAEFApRtp6AKpuHrb//aAAgBAgIGPwKvHkCKeVTN6nsi3suR5ae09l//2gAIAQMCBj8CjkDKqEGiOqDtbZcfzprwX//aAAgBAQEGPwL+NtNtFqbfVakuAzLmAOT0+8gBQCFEKCFnPwTiQTKpeBty2SdYt95DwcupsVTqGFISn4odIBIh6kOLR3Xssp9Omq4KN6Kmy2vc9ZRQ5YtR7OxybZ15UkUGo9v9PjIfOWkjh1Y//9oACAEBAwE/IQzU4QJMiWMLKuHEQEIQwd1BBgCcgs+sNdO8Q/8AOpMxIf/aAAgBAgMBPyEqFDBIwDlnhc4hA1qVsSma8zWRlafGHF5Tnj7yujn/2gAIAQMDAT8hNBiNDUjAW7geV2PcGfUev1ng6v8AcqNodyfWp02p/9oADAMBAAIRAxEAABDTX//aAAgBAQMBPxAeMugFju1xEgYfPigDqLBGYpOhGhiR2dLUBNF8pp//2gAIAQIDAT8QYe2yPKCTGAaCjOsFQAqIRQFjLyDkggz9sKv1E/Bc77GqLDpZtT//2gAIAQMDAT8QdksHDCFIPIwswqRmZIroIoIFWzBAJzPxWb+TdeSp2QC1SL6H5XP/2Q==');
73-
74-
margin-bottom: 0;
75-
background-color: #2e2620;
76-
background-image: url(/img/css/masthead.jpg), $bg-grad;
77-
background-position: center center;
78-
@include vendor(background-size, cover);
79-
color: $color-masthead; /* [1] */
80-
border-top-color: $color-masthead;
81-
border-bottom-width: 0;
82-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1) inset;
83-
84-
@include media-query(lap-and-up) {
85-
background-image: url(/img/css/masthead-medium.jpg), $bg-grad;
86-
}
87-
88-
@include media-query(desk) {
89-
background-image: url(/img/css/masthead-large.jpg), $bg-grad;
90-
}
91-
92-
> .wrapper { /* [2] */
93-
position: relative; /* [3] */
94-
padding-top: 56.25%; /* [4] */
95-
96-
@media screen and (min-width: 758px) { /* [5] */
97-
padding-top: 0; /* [6] */
98-
height: $header-max-height - double($spacing-unit) - $header-border-width; /* [7] */
99-
}
100-
101-
}
102-
103-
}
104-
105-
/**
106-
* Mastheads will have some large text in them. Let’s position that bottom-left.
107-
*/
108-
.page-head__text {
109-
margin: 0;
110-
position: absolute;
111-
bottom: 0;
112-
left: auto;
113-
color: $color-masthead;
114-
@include font-size(24px);
115-
116-
@include media-query(lap-and-up) {
117-
@include font-size(48px);
118-
}
119-
120-
@include media-query(desk) {
121-
@include font-size(72px);
122-
}
123-
124-
}

css/_components.photos.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*------------------------------------*\
2+
#PHOTOS
3+
\*------------------------------------*/
4+
5+
/**
6+
* Horribly hard-coded, but when the figure outdents, the image becomes a
7+
* fixed width: we can apply a Base64 placeholder background to it.
8+
*/
9+
@media screen and (min-width: $mq-figure) {
10+
11+
.c-photo-me {
12+
width: 750px;
13+
height: 500px;
14+
background-image: url('data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAABkAAD/7gAmQWRvYmUAZMAAAAABAwAVBAMGCg0AAAH4AAACjQAAAvUAAANe/9sAhAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAgICAgICAgICAgIDAwMDAwMDAwMDAQEBAQEBAQIBAQICAgECAgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwP/wgARCAALABADAREAAhEBAxEB/8QAtAABAQEAAAAAAAAAAAAAAAAACAkKAQEBAQAAAAAAAAAAAAAAAAAABgUQAAECBQUAAAAAAAAAAAAAAAYAARECEwUVMQMEFDQRAAADBwIGAwAAAAAAAAAAABECEwABEgMEFAUhFVEykiNTBiU1FhIAAAMGBQUAAAAAAAAAAAAAARECACExAxMEEEFRElJxIkKSwhMAAQMCBQUBAAAAAAAAAAAAAQARITFRQWFxseEQ8IGRofH/2gAMAwEAAhEDEQAAAc/4wq7LI0hq01on/9oACAEBAAEFAkJj0vLEdmNYs7uK/9oACAECAAEFAkNs0hAhyOW//9oACAEDAAEFAleWrWJtbv4//9oACAECAgY/AmtlKMQmTNpadqsLKke6q4iOCoVHezf/2gAIAQMCBj8CadLSAAuWkz1emPTLC5qcc4ePD5b/2gAIAQEBBj8CaR7XPgkEwvtLsHTp032J8hQmrKt1XURFOeZSS3y0nFECmeIaNKh5lCAMADE4BV7fVpxbCXe6Xm65Qb389cp7ThkbfZPgUhihDu+XRNv/2gAIAQEDAT8hUGzj03YI4Bc5Ya4dYX4XR3D87v8A/9oACAECAwE/IUZrIkRaOheUaLJR5UNqXrgv/9oACAEDAwE/IUQxEaq6ItH0GVDVPo79Sq3Z5X//2gAMAwEAAhEDEQAAEAr/AP/aAAgBAQMBPxBBpdu5ANT8XKIS92ujMO+Hm9Mznt1f/9oACAECAwE/EED+cSkEhmCABZ4BBqE170Y9xPpb3P4vLZqv/9oACAEDAwE/EEH1jaA3hAN4qMTESCHQVZa+ce4uto/+bXQZP//Z');
15+
background-size: cover;
16+
}
17+
18+
}

css/_includes/css/*.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
Errno::ENOENT: No such file or directory - *.scss
3+
4+
Backtrace:
5+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin/compiler.rb:484:in `read'
6+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin/compiler.rb:484:in `update_stylesheet'
7+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets'
8+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin/compiler.rb:209:in `each'
9+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin/compiler.rb:209:in `update_stylesheets'
10+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin/compiler.rb:294:in `watch'
11+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin.rb:109:in `method_missing'
12+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/exec/sass_scss.rb:360:in `watch_or_update'
13+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/exec/sass_scss.rb:51:in `process_result'
14+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/exec/base.rb:52:in `parse'
15+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/exec/base.rb:19:in `parse!'
16+
/Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/bin/sass:13:in `<top (required)>'
17+
/usr/local/bin/sass:23:in `load'
18+
/usr/local/bin/sass:23:in `<main>'
19+
*/
20+
body:before {
21+
white-space: pre;
22+
font-family: monospace;
23+
content: "Errno::ENOENT: No such file or directory - *.scss"; }

0 commit comments

Comments
 (0)