1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-11 23:55:16 +01:00

another grid rewrite, now exercise it

This commit is contained in:
Matthias Kretschmann 2015-08-10 00:48:31 +02:00
parent 8f27245841
commit 227b0a5ecc
15 changed files with 280 additions and 205 deletions

View File

@ -15,9 +15,9 @@ var siteNavigation = {
siteSearch: function() { siteSearch: function() {
var $content = $('.content'), var $content = $('.site__content'),
$searchlink = $('.search-btn'), $searchlink = $('.search-btn'),
$searcharea = $('.topbar .search-area'), $searcharea = $('.search-area'),
$searchfield = $('#search-input'), $searchfield = $('#search-input'),
$searchresults = $('#search-results'), $searchresults = $('#search-results'),
$searchpop = $('#search-popover'); $searchpop = $('#search-popover');
@ -36,7 +36,7 @@ var siteNavigation = {
searchInput: document.getElementById('search-input'), searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('search-results'), resultsContainer: document.getElementById('search-results'),
json: '/search.json', json: '/search.json',
searchResultTemplate: '<li class="col3"><a class="search-link" href="{url}">{title}</a></li>', searchResultTemplate: '<li class="grid__col"><a class="search-link" href="{url}">{title}</a></li>',
fuzzy: false fuzzy: false
}) })

View File

@ -7,11 +7,10 @@
.featured .featured
@extend .divider-bottom @extend .divider-bottom
padding-top: $line-height-computed padding-top: $line-height-computed
padding-bottom: $line-height-computed
@media $breakpoint2 @media $breakpoint2
padding-top: ($line-height-computed*2) padding-top: ($line-height-computed*2)
padding-bottom: ($line-height-computed*2) padding-bottom: $line-height-computed
.featured-link .featured-link
display: block display: block

View File

@ -25,11 +25,11 @@
color: darken($page-bg, 15%) color: darken($page-bg, 15%)
margin-right: 2px margin-right: 2px
.hentry, .hentry
.grid > .hentry
@extend .divider-bottom @extend .divider-bottom
padding-top: ($line-height-computed*2) padding-top: ($line-height-computed*2)
padding-bottom: ($line-height-computed*2) padding-bottom: ($line-height-computed*2)
width: 100%
@media $breakpoint2 @media $breakpoint2
padding-top: ($line-height-computed*4) padding-top: ($line-height-computed*4)

View File

@ -4,7 +4,7 @@
// Footer // Footer
// //
.footer .footer__content
@extend .textcenter @extend .textcenter
border-top: 1px solid rgba(255,255,255,.7) border-top: 1px solid rgba(255,255,255,.7)
box-shadow: inset 0 1px 4px alpha($brand-dark, .2) box-shadow: inset 0 1px 4px alpha($brand-dark, .2)

View File

@ -5,74 +5,129 @@
// //
// Prevents padding to be added *,
* *:before,
*:after
box-sizing: border-box box-sizing: border-box
.container //
padding-left: 7% // Base
padding-right: 7% //
width: 100%
@media $breakpoint2
padding-left: 15%
padding-right: 15%
.grid .grid
margin: auto
padding: 0
display: flex display: flex
flex-wrap: wrap flex-wrap: wrap
list-style: none
margin: 0
padding: 0
@media $breakpoint2 .grid__col
max-width: 35em flex: 1
> .col1,
> .col2, //
> .col3, // Alignment per row
> .col4, //
> .col5, .grid--top
> .col6 align-items: flex-start
.grid--bottom
align-items: flex-end
.grid--center
align-items: center
//
// Alignment per cell
//
.grid_col--top
align-self: flex-start
.grid_col--bottom
align-self: flex-end
.grid_col--center
align-self: center
//
// Gutters
//
.grid--gutters
margin: -($gutter-space) 0 $gutter-space (-($gutter-space))
> .grid__col
padding: $gutter-space 0 0 $gutter-space
//
// Columns
//
.grid
> .grid__col
flex: 1 flex: 1
flex: 0 0 100%
padding: 1em 0 0 1em
> .col6 .grid--1of6
padding-left: 0 > .grid__col
flex: 0 0 16.5%
> .col1-xs, .grid--2of6
> .col2-xs, > .grid__col
> .col3-xs, flex: 0 0 33%
> .col4-xs,
> .col5-xs,
> .col6-xs
flex: 1
padding: 1em 0 0 1em
> .col1-xs .grid--3of6,
flex: 0 0 16.666666667% .grid--half
> .col2-xs > .grid__col
flex: 0 0 33.333333333%
> .col3-xs
flex: 0 0 50% flex: 0 0 50%
> .col4-xs
flex: 0 0 66.666666666%
> .col5-xs
flex: 0 0 83.333333333%
> .col6-xs
flex: 0 0 100%
padding-left: 0
@media $breakpoint2 .grid--4of6
> .col1 > .grid__col
flex: 0 0 66%
.grid--5of6
> .grid__col
flex: 0 0 82.5%
@media $breakpoint2
.grid-medium--1of6
> .grid__col
flex: 0 0 16.5% flex: 0 0 16.5%
> .col2
.grid-medium--2of6
> .grid__col
flex: 0 0 33% flex: 0 0 33%
> .col3
.grid-medium--3of6,
.grid-medium--half
> .grid__col
flex: 0 0 50% flex: 0 0 50%
> .col4
.grid-medium--4of6
> .grid__col
flex: 0 0 66% flex: 0 0 66%
> .col5
.grid-medium--5of6
> .grid__col
flex: 0 0 82.5%
@media $breakpoint3
.grid-large--1of6
> .grid__col
flex: 0 0 16.5%
.grid-large--2of6
> .grid__col
flex: 0 0 33%
.grid-large--3of6,
.grid-large--half
> .grid__col
flex: 0 0 50%
.grid-large--4of6
> .grid__col
flex: 0 0 66%
.grid-large--5of6
> .grid__col
flex: 0 0 82.5% flex: 0 0 82.5%
> .col6
flex: 0 0 100%

View File

@ -4,10 +4,8 @@
// Header // Header
// //
// Topbar .header
///////////////////////////////////// width: 100%
.topbar
background: $body-bg background: $body-bg
margin-top: ($line-height-computed/2) margin-top: ($line-height-computed/2)
margin-bottom: ($line-height-computed/2) margin-bottom: ($line-height-computed/2)
@ -46,31 +44,24 @@
background-image: url('../img/logo@3x.png') background-image: url('../img/logo@3x.png')
background-size: 183px 62px background-size: 183px 62px
.header__title
margin: 0
// display toned down logo
// by default
@extend .logo
// Banner .header__logo
///////////////////////////////////// @extend .ir
// repeat logo
// but display hover version
@extend .logo
background-position: left bottom
.banner // hide by default
padding-top: 0 opacity: 0
// show smooooothly on hover
&:hover
opacity: 1
.banner-title &:active
margin: 0 top: 0
// display toned down logo
// by default
@extend .logo
.banner-logo
@extend .ir
// repeat logo
// but display hover version
@extend .logo
background-position: left bottom
// hide by default
opacity: 0
// show smooooothly on hover
&:hover
opacity: 1
&:active
top: 0

View File

@ -14,8 +14,9 @@
@import 'mixins' @import 'mixins'
// Core CSS // Core CSS
@import 'grid'
@import 'scaffolding' @import 'scaffolding'
@import 'grid'
@import 'layout'
@import 'typography' @import 'typography'
@import 'forms' @import 'forms'
@import 'buttons' @import 'buttons'

View File

@ -0,0 +1,61 @@
//
// kremalicious3
// --------------
// Layout
//
.site__content,
.header__content
.footer__content
padding: 0 7%
width: 100%
@media $breakpoint2
padding: 0 15%
.container
max-width: 35em
margin: 0 auto
// topbar and footer as fixed
// site background
/////////////////////////////////////
.site__document
background-color: $page-bg
border-top: 1px solid rgba(255,255,255,.7)
border-bottom: 1px solid rgba(255,255,255,.7)
box-shadow: 0 1px 4px alpha($brand-dark, .1), 0 -1px 4px alpha($brand-dark, .2)
@media only screen and (min-width: 40.625em) and (min-height: 650px)
body
position: relative
.site__document
@extend .transition
position: relative
z-index: 2
margin-top: 80px
margin-bottom: 500px
.menu-open &
margin-top: 220px
.header,
.footer
position: fixed
border: none
.header
z-index: 1
top: 0
border: none
.footer
z-index: 0
bottom: 0
box-shadow: none
.menu-open &
hide()

View File

@ -26,46 +26,3 @@ textarea
font-family: inherit font-family: inherit
font-size: inherit font-size: inherit
line-height: inherit line-height: inherit
// topbar and footer as fixed
// site background
/////////////////////////////////////
.document
background-color: $page-bg
border-top: 1px solid rgba(255,255,255,.7)
border-bottom: 1px solid rgba(255,255,255,.7)
box-shadow: 0 1px 4px alpha($brand-dark, .1), 0 -1px 4px alpha($brand-dark, .2)
@media only screen and (min-width: 40.625em) and (min-height: 650px)
body
position: relative
.document
@extend .transition
position: relative
z-index: 2
margin-top: 80px
margin-bottom: 500px
.menu-open &
margin-top: 220px
.topbar,
.footer
position: fixed
border: none
.topbar
z-index: 1
top: 0
border: none
.footer
z-index: 0
bottom: 0
box-shadow: none
.menu-open &
hide()

View File

@ -94,6 +94,11 @@ $link-color = lighten($brand-cyan, 5%)
$link-color-hover = lighten($link-color, 10%) $link-color-hover = lighten($link-color, 10%)
// Grid
/////////////////////////////////////
$gutter-space = $line-height-computed
// Components spacing // Components spacing
///////////////////////////////////// /////////////////////////////////////

View File

@ -1,7 +1,7 @@
{% if post.layout == "link" %} {% if post.layout == "link" %}
<article class="hentry format-link col6"> <article class="hentry format-link">
<header> <header>
<h1 class="entry-title"> <h1 class="entry-title">
<a href="{{ post.linkurl }}" title="Go to source: {{ post.linkurl | remove:'http://' | remove:'https://' | remove:'www.' }}"> <a href="{{ post.linkurl }}" title="Go to source: {{ post.linkurl | remove:'http://' | remove:'https://' | remove:'www.' }}">
@ -33,7 +33,7 @@
{% elsif post.layout == "photo" %} {% elsif post.layout == "photo" %}
<article class="hentry format-photo col6"> <article class="hentry format-photo">
<a class="photo-link" href="{{ post.url }}"> <a class="photo-link" href="{{ post.url }}">
<figure class="hmedia"> <figure class="hmedia">
@ -48,7 +48,7 @@
{% else %} {% else %}
<article class="hentry format-post col6"> <article class="hentry format-post">
<header> <header>
<h1 class="entry-title"><a href="{{ post.url }}">{{ post.title | titlecase }}</a></h1> <h1 class="entry-title"><a href="{{ post.url }}">{{ post.title | titlecase }}</a></h1>
</header> </header>

View File

@ -1,13 +1,15 @@
<aside class="grid featured"> <aside class="featured">
{% for post in site.posts %} <div class="grid grid--gutters">
{% if post.featured %} {% for post in site.posts %}
<article class="col2"> {% if post.featured %}
<a class="featured-link" href="{{ post.url }}" title="{{ post.title }}"> <article class="grid__col">
{% picture featured {{ post.image }} %} <a class="featured-link" href="{{ post.url }}" title="{{ post.title }}">
<h1 class="featured-title">{{ post.title | titlecase }}</h1> {% picture featured {{ post.image }} %}
</a> <h1 class="featured-title">{{ post.title | titlecase }}</h1>
</article> </a>
{% endif %} </article>
{% endfor %} {% endif %}
</aside> {% endfor %}
</div>
</aside>

View File

@ -1,13 +1,13 @@
<footer role="contentinfo" class="footer container"> <footer role="contentinfo" class="footer__content">
<div class="grid"> <div class="container">
<div class="vcard author col6"> <div class="vcard author">
<img class="avatar photo" src="/assets/img/avatar.jpeg" /> <img class="avatar photo" src="/assets/img/avatar.jpeg" />
<p class="footer-description">Blog of designer &amp; developer <a class="fn" rel="author" href="/about/">{{ site.author.name }}</a> <p class="footer-description">Blog of designer &amp; developer <a class="fn" rel="author" href="/about/">{{ site.author.name }}</a>
</div> </div>
<aside class="subscribe col6"> <aside class="subscribe">
<h1 class="subscribe-title">Subscribe</h1> <h1 class="subscribe-title">Subscribe</h1>
<p> <p>
<a class="btn rss" href="http://kremalicious.com/feed"> <a class="btn rss" href="http://kremalicious.com/feed">
@ -33,10 +33,7 @@
</p> </p>
</aside> </aside>
</div> <section class="footer-copyright">
<section class="footer-copyright" class="grid">
<div class="col6">
<p>© 2007 &ndash; {{ site.time | date: "%Y" }} <a href="http://matthiaskretschmann.com" rel="me">Matthias Kretschmann</a></p> <p>© 2007 &ndash; {{ site.time | date: "%Y" }} <a href="http://matthiaskretschmann.com" rel="me">Matthias Kretschmann</a></p>
<p> <p>
@ -47,8 +44,9 @@
View source View source
</a> </a>
</p> </p>
</div> </section>
</section>
</div>
</footer> </footer>

View File

@ -1,49 +1,53 @@
<div class="topbar container"> <header role="banner" class="header">
<div class="grid"> <div class="header__content">
<div class="container">
<header role="banner" class="banner col3-xs"> <div class="grid grid--half">
<h1 class="banner-title">
<a class="banner-logo" href="/">kremalicious</a>
</h1>
</header>
<nav role="navigation" class="nav-main col3-xs"> <div class="grid__col">
<button type="button" class="menu-btn"> <h1 class="header__title">
<svg class="icon icon-entypo icon-entypo-menu" role="img" aria-labelledby="title"> <a class="header__logo" href="/">kremalicious</a>
<title id="title">Menu</title> </h1>
<use xlink:href="/assets/img/sprite.svg#entypo-menu"></use> </div>
</svg>
</button> <nav role="navigation" class="nav-main grid__col">
</nav> <button type="button" class="menu-btn">
<svg class="icon icon-entypo icon-entypo-menu" role="img" aria-labelledby="title">
<title id="title">Menu</title>
<use xlink:href="/assets/img/sprite.svg#entypo-menu"></use>
</svg>
</button>
</nav>
<section class="site-search">
<button type="button" class="search-btn">
<svg class="icon icon-entypo icon-entypo-search" role="img" aria-labelledby="title">
<title id="title">Search</title>
<use xlink:href="/assets/img/sprite.svg#entypo-magnifying-glass"></use>
</svg>
</button>
<div class="search-area">
<input type="search" id="search-input" class="form-control input-search search-field" placeholder="Search everything">
<button class="close search-close">&times;</button>
</div>
<div id="search-popover" class="search-popover hide">
<ul id="search-results" class="search-results grid"></ul>
</div>
</section>
<section class="site-search">
<button type="button" class="search-btn">
<svg class="icon icon-entypo icon-entypo-search" role="img" aria-labelledby="title">
<title id="title">Search</title>
<use xlink:href="/assets/img/sprite.svg#entypo-magnifying-glass"></use>
</svg>
</button>
<div class="search-area">
<input type="search" id="search-input" class="form-control input-search search-field" placeholder="Search everything">
<button class="close search-close">&times;</button>
</div> </div>
</section>
<ul class="nav-popover grid hide">
{% for category in site.categories %}
<li class="grid__col grid--gutters grid-medium--half">
<a class="nav-link" href="/{{ category | first }}/">
{{ category | first }}
</a>
</li>
{% endfor %}
</ul>
</div>
</div> </div>
</header>
<ul class="nav-popover grid hide">
{% for category in site.categories %}
<li class="col3-xs col2">
<a class="nav-link" href="/{{ category | first }}/">
{{ category | first }}
</a>
</li>
{% endfor %}
</ul>
</div>
<div id="search-popover" class="search-popover container hide">
<ul id="search-results" class="search-results grid"></ul>
</div>

View File

@ -3,13 +3,15 @@
{% capture id %}{{ page.url | replace:'/','-' | replace_first:'-','' | replace:'.html','' | replace:'-index','' }}{% endcapture %} {% capture id %}{{ page.url | replace:'/','-' | replace_first:'-','' | replace:'.html','' | replace:'-index','' }}{% endcapture %}
<body class="page-{{ id | remove:'-' }}"> <body class="page-{{ id | remove:'-' }} site">
{% include header.html %} {% include header.html %}
<section role="document" class="document container"> <section role="document" class="site__document">
<div class="content"> <div class="site__content">
{{ content }} <div class="container">
{{ content }}
</div>
</div> </div>
</section> </section>