canvas layout styling

This commit is contained in:
David Darnes 2019-11-06 13:11:17 +07:00
parent c09023b4da
commit 03f315fde2
5 changed files with 48 additions and 34 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,16 +1,15 @@
/* Content grid /* Content grid
/* ---------------------------------------------------------- */ /* ---------------------------------------------------------- */
.gh-content { .gh-canvas {
display: grid; display: grid;
grid-row-gap: 1.5em;
grid-template-columns: grid-template-columns:
[full-start] [full-start]
minmax(calc(calc(100% - 720px) / 2), 1fr) minmax(calc(calc(100% - 720px) / 2), 1fr)
[wide-start] [wide-start]
1fr 1fr
[main-start] [main-start]
repeat(10, [col-start] 1fr) repeat(10, [col-start] 1fr)
[main-end] [main-end]
1fr 1fr
[wide-end] [wide-end]
@ -20,7 +19,7 @@
} }
@media (max-width: 600px) { @media (max-width: 600px) {
.gh-content { .gh-canvas {
grid-template-columns: grid-template-columns:
[full-start] [full-start]
minmax(calc(calc(100% - 720px) / 2), 1fr) minmax(calc(calc(100% - 720px) / 2), 1fr)
@ -33,7 +32,7 @@
} }
} }
.gh-content > * { .gh-canvas > * {
grid-column: main-start / main-end; grid-column: main-start / main-end;
} }
@ -102,21 +101,28 @@ tfoot {
/* Cards /* Cards
/* ---------------------------------------------------------- */ /* ---------------------------------------------------------- */
.kg-card { .gh-content-body > * + * {
margin: 7vw 0; margin-top: 1.5em;
}
.gh-content-body > h1 + *,
.gh-content-body > h2 + *,
.gh-content-body > h3 + *,
.gh-content-body > h4 + *,
.gh-content-body > h5 + *,
.gh-content-body > h6 + * {
margin-top: 0;
} }
/* Do we need this anymore? :not(.kg-card):not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) + .kg-card {
.kg-embed-card { margin-top: 7vw;
display: flex; }
flex-direction: column;
align-items: center; .kg-card + :not(.kg-card):not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) {
width: 100%; margin-top: 7vw;
} }
*/
.kg-card figcaption { .kg-card figcaption {
padding: 1.5rem; padding: 1.5rem 1.5rem 0;
font-size: 1.3rem; font-size: 1.3rem;
line-height: 1.4em; line-height: 1.4em;
font-weight: 600; font-weight: 600;
@ -125,13 +131,21 @@ tfoot {
opacity: 0.4; opacity: 0.4;
} }
.gh-content > pre { .gh-canvas > pre {
overflow: scroll; overflow: scroll;
border-radius: 5px; border-radius: 5px;
box-shadow: 0 2px 6px -2px rgba(0,0,0,.1), 0 0 1px rgba(0,0,0,.4); box-shadow: 0 2px 6px -2px rgba(0,0,0,.1), 0 0 1px rgba(0,0,0,.4);
padding: 16px 20px; padding: 16px 20px;
} }
.kg-embed-card {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}
/* Card captions /* Card captions
/* ---------------------------------------------------------- */ /* ---------------------------------------------------------- */
.kg-width-full.kg-card-hascaption { .kg-width-full.kg-card-hascaption {

View File

@ -1,9 +1,9 @@
{{!< default}} {{!< default}}
{{#post}} {{#post}}
<article class="post-content {{post_class}} {{#unless feature_image}}no-image{{/unless}}"> <article class="gh-page {{post_class}} {{#unless feature_image}}no-image{{/unless}}">
<div class="post-content-body"> <div class="gh-content-body gh-canvas">
{{content}} {{content}}
</div> </div>

View File

@ -3,25 +3,25 @@
{{#post}} {{#post}}
<article class="gh-post {{post_class}}"> <article class="gh-post {{post_class}}">
<header class="gh-post-header"> <header class="gh-post-header gh-canvas">
<h1 class="gh-post-title">{{title}}</h1> <h1 class="gh-post-title">{{title}}</h1>
{{#if custom_excerpt}}
<p class="gh-post-excerpt">{{custom_excerpt}}</p>
{{/if}}
{{#if feature_image}}
<div class="gh-post-image">
<img class="kg-image" src="{{feature_image}}" alt="{{title}}" />
</div>
{{/if}}
</header> </header>
{{#if custom_excerpt}} <div class="gh-content-body gh-canvas">
<p class="gh-post-excerpt">{{custom_excerpt}}</p>
{{/if}}
{{#if feature_image}}
<div class="gh-post-image">
<img class="kg-image" src="{{feature_image}}" alt="{{title}}" />
</div>
{{/if}}
<div class="gh-post-body">
{{content}} {{content}}
</div> </div>
<footer class="gh-post-footer"> <footer class="gh-post-footer gh-canvas">
<div class="gh-post-authors"> <div class="gh-post-authors">
Written by {{#foreach authors}}<a href="{{url}}">{{name}}</a>{{/foreach}} Written by {{#foreach authors}}<a href="{{url}}">{{name}}</a>{{/foreach}}
@ -52,4 +52,4 @@ images.forEach(function (image) {
</script> </script>
{{/contentFor}} {{/contentFor}}
{{!-- The #contentFor helper sends everything in it to the matching #block helper in default.hbs --}} {{!-- The #contentFor helper sends everything in it to the matching #block helper in default.hbs --}}