Compare commits

...

33 Commits

Author SHA1 Message Date
0721600075 v5.5.0 2023-06-22 17:17:43 +08:00
a18367200f Updated post content grid for additional widths 2023-06-22 16:37:59 +08:00
294b1e30e5 v5.4.12 2023-06-20 12:09:25 +08:00
aa8ca0794b Fixed main nav background color in dark mode
closes https://github.com/TryGhost/Casper/issues/942
2023-06-20 12:09:08 +08:00
ba0b3d08cc v5.4.11 2023-05-09 13:30:12 +08:00
50d5727f77 Fixed mobile menu background in dark mode
no issues

- when there's no publication cover and the color scheme is in dark mode, the mobile menu had white background
- this fixes the issue by adding explicit dark mode rules to the styles
2023-05-09 13:27:37 +08:00
23f7c30365 v5.4.10 2023-04-21 09:49:57 +01:00
8ff3c6fcf1 Fixed main nav to make it work with the announcement bar 2023-04-21 09:49:37 +01:00
5c7fb39df9 v5.4.9 2023-04-10 13:42:17 +08:00
4851606d9d Rebuilt assets 2023-04-10 13:41:59 +08:00
afca9cb27e Fix problem showing dropdown after window resize
When the browser window is resized, a new click event listener is added
to the window but the old one is not removed. The old one ends up
preventing the newly-made dropdown from opening.

Fix this by remembering the click event listener function added to the
window, and remove it before making the new dropdown after a window
resize.
2023-04-10 13:40:33 +08:00
b56bec2cb8 Fixed header action background color for smaller screens
closes #934

- the accent color is used for the header background, so we don't need to add explicit dark mode color to the action on mobile screens
2023-04-10 13:24:11 +08:00
0c4164c5bd v5.4.8 2023-03-28 16:01:50 +08:00
e6326eadf9 Added a class name to the powered by text
no issues

- our other themes have this class, and this makes it consistent across over all offcial themes
2023-03-28 16:01:24 +08:00
3ed94d68fa Update dependency gscan to v4.36.1 2023-03-07 09:25:32 +01:00
505503a63b v5.4.7 2023-03-01 13:54:29 +08:00
bd3fc7c2af Fixed textarea color in dark mode 2023-03-01 13:53:58 +08:00
5e0f765852 v5.4.6 2023-02-28 13:57:36 +08:00
4293dab0a7 Fixed burger menu icon visibility on dark mode
refs #925
2023-02-28 13:57:05 +08:00
f00918589f Update comment grammar 2023-02-27 17:13:31 +08:00
0200889148 Fix Table of Contents Numbering in screen.css 2023-02-27 15:39:25 +08:00
248c122f86 re-add aria-label to search button for screen readers
This was added by https://github.com/TryGhost/Casper/pull/896 

but then appears to have been accidentally reverted in the merge of https://github.com/TryGhost/Casper/pull/906
2023-02-27 15:10:09 +08:00
a007415d89 v5.4.5 2023-01-20 09:50:01 +01:00
31188ce3c0 Fixed author's cover image not showing up
no refs.

The author's cover image didn't show up on the theme because the author template used `feature_image` instead of `cover_image`.
2023-01-19 09:51:08 +01:00
e1967f8546 v5.4.4 2022-12-16 12:35:19 +08:00
5259d551f5 Fixed mobile navbar height 2022-12-16 12:33:11 +08:00
115d1d820c Fixed sign in link placement on mobile screen
fixes #913
2022-12-16 12:12:22 +08:00
81e4dfd52d Minor spacing adjustment 2022-12-16 12:02:08 +08:00
cc4d828575 Fixed logo visibility when the header is hidden 2022-12-16 11:57:59 +08:00
ebb2538215 v5.4.3 2022-12-15 10:12:38 +08:00
3767e3d994 Adjusted the pagination to dark mode 2022-12-15 10:00:58 +08:00
6d290485dc Fixed account button background 2022-12-15 09:55:41 +08:00
7da41d344f Added sign in link to the navbar 2022-12-14 16:42:46 +08:00
11 changed files with 694 additions and 383 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,20 +6,19 @@ production stylesheet in assets/built/screen.css
1. Global Styles
2. Layout
3. Special Templates
4. Site Header
5. Site Navigation
6. Post Feed
7. Single Post
7.1. Post Byline
7.2. Members Subscribe Form
7.4. Related Posts
7.5. Koenig Styles
7.6 Comments
8. Author Template
3. Site Header
4. Site Navigation
5. Post Feed
6. Single Post
6.1. Post Byline
6.2. Subscribe
6.3. Read More
6.4. Comments
7. Author Template
8. Tag Template
9. Error Template
11. Site Footer
12. Dark Mode
10. Site Footer
11. Dark Mode
*/
@ -64,6 +63,7 @@ production stylesheet in assets/built/screen.css
/* ---------------------------------------------------------- */
.viewport {
position: relative;
display: flex;
flex-direction: column;
min-height: 100vh;
@ -87,7 +87,7 @@ production stylesheet in assets/built/screen.css
}
/* 4. Site Header
/* 3. Site Header
/* ---------------------------------------------------------- */
.site-header {
@ -247,18 +247,18 @@ production stylesheet in assets/built/screen.css
font-size: 3.4rem !important;
}
.site-description {
font-size: 2.8rem !important;
font-size: 2.2rem !important;
}
.site-logo + .site-description {
margin-top: 12px !important;
}
.site-title + .site-description {
margin-top: 4px !important;
margin-top: 12px !important;
}
}
/* 5. Site Navigation
/* 4. Site Navigation
/* ---------------------------------------------------------- */
.gh-head {
@ -266,6 +266,7 @@ production stylesheet in assets/built/screen.css
font-size: 1.6rem;
line-height: 1.3em;
background-color: #fff;
z-index: 150;
}
.has-cover:not(.home-template) .gh-head {
@ -303,17 +304,17 @@ production stylesheet in assets/built/screen.css
grid-template-columns: auto 1fr auto;
}
.is-head-left-logo.home-template .gh-head-logo {
.is-head-left-logo.home-template .gh-head:not(.is-header-hidden) .gh-head-logo {
display: none;
}
.is-head-left-logo.home-template .gh-head-menu {
.is-head-left-logo.home-template .gh-head:not(.is-header-hidden) .gh-head-menu {
margin-left: -40px;
}
@media (min-width: 992px) {
.is-head-left-logo .gh-head-menu {
margin-right: 32px;
margin-right: 64px;
margin-left: 16px;
}
}
@ -412,7 +413,7 @@ production stylesheet in assets/built/screen.css
}
.gh-head-logo.no-image {
margin-top: -2px;
margin-top: -5px;
}
.has-cover .gh-head-logo {
@ -566,6 +567,17 @@ production stylesheet in assets/built/screen.css
text-align: right;
}
.gh-head-members {
display: flex;
gap: 20px;
align-items: center;
}
.gh-head-link {
font-weight: 500;
color: inherit;
}
.gh-head-button {
display: inline-flex;
justify-content: center;
@ -585,6 +597,14 @@ production stylesheet in assets/built/screen.css
background: #fff;
}
@media (max-width: 767px) {
.gh-head-members {
flex-direction: column-reverse;
gap: 16px;
width: 100%;
}
}
/* Search
/* ---------------------------------------------------------- */
@ -614,13 +634,13 @@ production stylesheet in assets/built/screen.css
margin-right: -4px;
}
@media (max-width: 991px) {
@media (max-width: 767px) {
.gh-head-actions .gh-search {
display: none;
}
}
@media (min-width: 992px) {
@media (min-width: 768px) {
.gh-head-brand .gh-search {
display: none;
}
@ -682,7 +702,7 @@ production stylesheet in assets/built/screen.css
/* ---------------------------------------------------------- */
/* IDs needed to ensure sufficient specificity */
@media (max-width: 991px) {
@media (max-width: 767px) {
#gh-head {
height: 64px;
}
@ -744,6 +764,11 @@ production stylesheet in assets/built/screen.css
transform: translateY(-4px);
}
#gh-head :is(.gh-head-button, .gh-head-link) {
opacity: 0;
transform: translateY(8px);
}
#gh-head .gh-head-button {
width: 100%;
font-size: 1.8rem;
@ -754,10 +779,9 @@ production stylesheet in assets/built/screen.css
.gh-head-open #gh-head {
position: fixed;
right: 0;
left: 0;
inset: 0;
z-index: 3999999;
height: 100vh;
height: 100%;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
}
@ -794,20 +818,24 @@ production stylesheet in assets/built/screen.css
flex-direction: column;
gap: 12px;
align-items: center;
padding: max(4vmin, 20px) 0;
padding: max(4vmin, 20px) 0 max(4vmin, 28px);
background-color: #fff;
}
.gh-head-open #gh-head .gh-head-button {
.gh-head-open #gh-head :is(.gh-head-button, .gh-head-link) {
opacity: 1;
transition: transform 0.4s, opacity 0.4s;
transition-delay: 0.2s;
transform: translateY(0);
}
.gh-head-open #gh-head .gh-head-link {
transition-delay: 0.4s;
}
}
/* 6. Post Feed
/* 5. Post Feed
/* ---------------------------------------------------------- */
.post-feed {
@ -1181,7 +1209,7 @@ html.no-infinite-scroll .pagination {
}
/* 7. Single Post
/* 6. Single Post
/* ---------------------------------------------------------- */
.article {
@ -1268,27 +1296,26 @@ is laid out on top of. Canvas just defines the grid, we don't
use it for applying any other styles. */
.gh-canvas {
--gap: max(4vmin, 20px);
--main: min(var(--content-width, 720px), 100% - var(--gap) * 2);
--wide: minmax(0, calc((var(--container-width, 1200px) - var(--content-width, 720px)) / 2));
--full: minmax(var(--gap), 1fr);
display: grid;
grid-template-columns:
[full-start]
minmax(max(4vmin, 20px), auto)
[wide-start]
minmax(auto, 240px)
[main-start]
min(720px, calc(100% - max(8vmin, 40px)))
[main-end]
minmax(auto, 240px)
[wide-end]
minmax(max(4vmin, 20px), auto)
[full-end]
;
[full-start] var(--full)
[wide-start] var(--wide)
[main-start] var(--main) [main-end]
var(--wide) [wide-end]
var(--full) [full-end];
}
.gh-canvas > * {
grid-column: main-start / main-end;
}
.kg-width-wide {
.kg-width-wide,
.kg-content-wide > div {
grid-column: wide-start / wide-end;
}
@ -1660,7 +1687,7 @@ iframe.instagram-media + script + :not([id]) {
}
/* 7.1. Post Byline
/* 6.1. Post Byline
/* ---------------------------------------------------------- */
.article-byline {
@ -1723,7 +1750,7 @@ iframe.instagram-media + script + :not([id]) {
}
/* 7.3. Subscribe
/* 6.2. Subscribe
/* ---------------------------------------------------------- */
.footer-cta {
@ -1773,7 +1800,7 @@ iframe.instagram-media + script + :not([id]) {
}
/* 7.4. Read more
/* 6.3. Read more
/* ---------------------------------------------------------- */
.read-more-wrap {
@ -1812,7 +1839,7 @@ iframe.instagram-media + script + :not([id]) {
}
}
/* 7.6. Comments
/* 6.4. Comments
/* ---------------------------------------------------------- */
.comments {
display: flex;
@ -1850,7 +1877,7 @@ iframe.instagram-media + script + :not([id]) {
}
/* 8. Author Template
/* 7. Author Template
/* ---------------------------------------------------------- */
.author-profile-pic {
@ -1984,7 +2011,7 @@ iframe.instagram-media + script + :not([id]) {
}
/* 11. Site Footer
/* 10. Site Footer
/* ---------------------------------------------------------- */
.site-footer {
@ -2071,7 +2098,7 @@ iframe.instagram-media + script + :not([id]) {
}
/* 12. Dark Mode
/* 11. Dark Mode
/* ---------------------------------------------------------- */
html.dark-mode body {
@ -2091,13 +2118,14 @@ html.dark-mode figcaption a {
color: #fff;
}
html.dark-mode .gh-head {
html.dark-mode body:not(.has-cover) .gh-head {
background: var(--color-darkmode);
color: #fff;
}
html.dark-mode .gh-burger-box {
color: #fff;
html.dark-mode .gh-burger::before,
html.dark-mode .gh-burger::after {
background-color: #fff;
}
html.dark-mode .site-header-content {
@ -2108,7 +2136,7 @@ html.dark-mode .post-card-image {
background: var(--color-darkmode);
}
html.dark-mode :is(.post-card-tags, .post-card-meta, .article-tag a, .byline-meta-content) {
html.dark-mode :is(.post-card-tags, .post-card-meta, .article-tag a, .byline-meta-content, .pagination .page-number) {
color: color-mod(var(--color-secondary-text) l(-22%));
}
@ -2124,6 +2152,10 @@ html.dark-mode .post-card-excerpt {
color: var(--color-secondary-text);
}
html.dark-mode .pagination a {
color: #fff;
}
html.dark-mode .author-profile-location {
color: #fff;
}
@ -2227,7 +2259,7 @@ html.dark-mode .gh-content table:not(.gist table) td {
border: color-mod(var(--color-darkmode) l(+8%)) 1px solid;
}
html.dark-mode .gh-content input {
html.dark-mode .gh-content :is(input, textarea) {
color: color-mod(var(--color-midgrey) l(-30%));
}
@ -2253,6 +2285,13 @@ html.dark-mode .footer-cta-title {
color: #fff;
}
@media (max-width: 767px) {
html.dark-mode .gh-head-open:not(.has-cover) #gh-head,
html.dark-mode .gh-head-open:not(.has-cover) #gh-head .gh-head-actions {
background: var(--color-darkmode);
}
}
@media (prefers-color-scheme: dark) {
html.auto-color body {
color: rgba(255, 255, 255, 0.75);
@ -2271,13 +2310,14 @@ html.dark-mode .footer-cta-title {
color: #fff;
}
html.auto-color .gh-head {
html.auto-color body:not(.has-cover) .gh-head {
background: var(--color-darkmode);
color: #fff;
}
html.auto-color .gh-burger-box {
color: #fff;
html.auto-color .gh-burger::before,
html.auto-color .gh-burger::after {
background-color: #fff;
}
html.auto-color .site-header-content {
@ -2288,7 +2328,7 @@ html.dark-mode .footer-cta-title {
background: var(--color-darkmode);
}
html.auto-color :is(.post-card-tags, .post-card-meta, .article-tag a, .byline-meta-content) {
html.auto-color :is(.post-card-tags, .post-card-meta, .article-tag a, .byline-meta-content, .pagination .page-number) {
color: color-mod(var(--color-secondary-text) l(-22%));
}
@ -2304,6 +2344,10 @@ html.dark-mode .footer-cta-title {
color: var(--color-secondary-text);
}
html.auto-color .pagination a {
color: #fff;
}
html.auto-color .author-profile-location {
color: #fff;
}
@ -2407,7 +2451,7 @@ html.dark-mode .footer-cta-title {
border: color-mod(var(--color-darkmode) l(+8%)) 1px solid;
}
html.auto-color .gh-content input {
html.auto-color .gh-content :is(input, textarea) {
color: color-mod(var(--color-midgrey) l(-30%));
}
@ -2432,6 +2476,13 @@ html.dark-mode .footer-cta-title {
html.auto-color .footer-cta-title {
color: #fff;
}
@media (max-width: 767px) {
html.auto-color .gh-head-open:not(.has-cover) #gh-head,
html.auto-color .gh-head-open:not(.has-cover) #gh-head .gh-head-actions {
background: var(--color-darkmode);
}
}
}
/*

View File

@ -1,7 +1,8 @@
(function () {
const mediaQuery = window.matchMedia('(max-width: 991px)');
const mediaQuery = window.matchMedia('(max-width: 767px)');
const menu = document.querySelector('.gh-head-menu');
const head = document.querySelector('.gh-head');
const menu = head.querySelector('.gh-head-menu');
const nav = menu.querySelector('.nav');
if (!nav) return;
@ -15,6 +16,7 @@
});
}
var windowClickListener;
const makeDropdown = function () {
if (mediaQuery.matches) return;
const submenuItems = [];
@ -61,19 +63,21 @@
document.body.classList.toggle('is-dropdown-open');
});
window.addEventListener('click', function (e) {
windowClickListener = function (e) {
if (!toggle.contains(e.target) && document.body.classList.contains('is-dropdown-open')) {
document.body.classList.remove('is-dropdown-open');
}
});
};
window.addEventListener('click', windowClickListener);
}
imagesLoaded(logo, function () {
imagesLoaded(head, function () {
makeDropdown();
});
window.addEventListener('resize', function () {
setTimeout(function () {
window.removeEventListener('click', windowClickListener);
nav.innerHTML = navHTML;
makeDropdown();
}, 1);

View File

@ -9,17 +9,17 @@
{{#author}}
<section class="post-card post-card-large">
{{#if feature_image}}
{{#if cover_image}}
<div class="post-card-image-link">
{{!-- This is a responsive image, it loads different sizes depending on device
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
<img class="post-card-image"
srcset="{{img_url feature_image size="s"}} 300w,
{{img_url feature_image size="m"}} 600w,
{{img_url feature_image size="l"}} 1000w,
{{img_url feature_image size="xl"}} 2000w"
srcset="{{img_url cover_image size="s"}} 300w,
{{img_url cover_image size="m"}} 600w,
{{img_url cover_image size="l"}} 1000w,
{{img_url cover_image size="xl"}} 2000w"
sizes="(max-width: 1000px) 400px, 800px"
src="{{img_url feature_image size="m"}}"
src="{{img_url cover_image size="m"}}"
alt="{{title}}"
/>
</div>

View File

@ -21,17 +21,17 @@
<body class="{{body_class}} is-head-{{#match @custom.navigation_layout "Logo on cover"}}left-logo{{else match @custom.navigation_layout "Logo in the middle"}}middle-logo{{else}}stacked{{/match}}{{#match @custom.title_font "=" "Elegant serif"}} has-serif-title{{/match}}{{#match @custom.body_font "=" "Modern sans-serif"}} has-sans-body{{/match}}{{#if @custom.show_publication_cover}} has-cover{{/if}}">
<div class="viewport">
<header id="gh-head" class="gh-head outer">
<header id="gh-head" class="gh-head outer{{#match @custom.header_style "Hidden"}} is-header-hidden{{/match}}">
<div class="gh-head-inner inner">
<div class="gh-head-brand">
<a class="gh-head-logo" href="{{@site.url}}">
<a class="gh-head-logo{{#unless @site.logo}} no-image{{/unless}}" href="{{@site.url}}">
{{#if @site.logo}}
<img src="{{@site.logo}}" alt="{{@site.title}}">
{{else}}
{{@site.title}}
{{/if}}
</a>
<button class="gh-search gh-icon-btn" data-ghost-search>{{> "icons/search"}}</button>
<button class="gh-search gh-icon-btn" aria-label="Search this site" data-ghost-search>{{> "icons/search"}}</button>
<button class="gh-burger"></button>
</div>
@ -39,7 +39,7 @@
{{navigation}}
{{#unless @site.members_enabled}}
{{#match @custom.navigation_layout "Stacked"}}
<button class="gh-search gh-icon-btn" data-ghost-search>{{> "icons/search"}}</button>
<button class="gh-search gh-icon-btn" aria-label="Search this site" data-ghost-search>{{> "icons/search"}}</button>
{{/match}}
{{/unless}}
</nav>
@ -51,15 +51,18 @@
{{/match}}
{{else}}
<button class="gh-search gh-icon-btn" data-ghost-search>{{> "icons/search"}}</button>
{{#unless @member}}
{{#unless @site.members_invite_only}}
<a class="gh-head-button" href="#/portal/signup" data-portal="signup">Subscribe</a>
<div class="gh-head-members">
{{#unless @member}}
{{#unless @site.members_invite_only}}
<a class="gh-head-link" href="#/portal/signin" data-portal="signin">Sign in</a>
<a class="gh-head-button" href="#/portal/signup" data-portal="signup">Subscribe</a>
{{else}}
<a class="gh-head-button" href="#/portal/signin" data-portal="signin">Sign in</a>
{{/unless}}
{{else}}
<a class="gh-head-button" href="#/portal/signin" data-portal="signin">Login</a>
<a class="gh-head-button" href="#/portal/account" data-portal="account">Account</a>
{{/unless}}
{{else}}
<a class="gh-head-button" href="#/portal/account" data-portal="account">Account</a>
{{/unless}}
</div>
{{/unless}}
</div>
</div>
@ -77,7 +80,7 @@
<nav class="site-footer-nav">
{{navigation type="secondary"}}
</nav>
<div><a href="https://ghost.org/" target="_blank" rel="noopener">Powered by Ghost</a></div>
<div class="gh-powered-by"><a href="https://ghost.org/" target="_blank" rel="noopener">Powered by Ghost</a></div>
</div>
</footer>

View File

@ -1,9 +1,9 @@
{{!--
There are two error files in this theme, one for 404s and one for all other errors.
This file is the latter, and handle all 400/500 errors that might occur.
This file is the latter, and handles all 400/500 errors that might occur.
Because 500 errors in particular usuall happen when a server is struggling, this
Because 500 errors in particular usually happen when a server is struggling, this
template is as simple as possible. No template dependencies, no JS, no API calls.
This is to prevent rendering the error-page itself compounding the issue causing
the error in the first place.

View File

@ -2,7 +2,7 @@
"name": "casper",
"description": "A clean, minimal default theme for the Ghost publishing platform",
"demo": "https://demo.ghost.io",
"version": "5.4.2",
"version": "5.5.0",
"engines": {
"ghost": ">=5.0.0"
},
@ -49,7 +49,7 @@
"autoprefixer": "10.4.7",
"beeper": "2.1.0",
"cssnano": "5.1.12",
"gscan": "4.34.0",
"gscan": "4.36.1",
"gulp": "4.0.2",
"gulp-concat": "2.6.1",
"gulp-livereload": "4.0.2",

835
yarn.lock

File diff suppressed because it is too large Load Diff