Skip to content

Commit

Permalink
Introduce semi-obscured cover variant
Browse files Browse the repository at this point in the history
Add `#cover` and `#cover-object-medium` tags to activate this feature.
  • Loading branch information
adamkudrna committed Mar 19, 2024
1 parent 7456759 commit ca62ecf
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ your machine.
directory. Optionally clone the theme to a place of your choice and create
a symlink in the said destination. Either way you should end up with this
structure:
`<YOUR_GHOST_INSTALLATION>/content/frontend-garden-ghost-theme`.
`<YOUR_GHOST_INSTALLATION>/content/themes/frontend-garden-ghost-theme`.

2. In the theme root run:

Expand Down
6 changes: 6 additions & 0 deletions assets/scss/styles/06-components/_article.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@
max-width: 42rem;
margin-left: -0.15em; // 2.
}

.article--cover .article__title,
.article--cover .article__summary {
width: clamp(24rem, 55vw, 50rem);
max-width: 100%;
}
7 changes: 7 additions & 0 deletions assets/scss/styles/06-components/_cover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@
}
}

.cover--object--medium {
$overlay-color: color.adjust(colors.$black, $alpha: -0.75);

--gradient-from: #{$overlay-color};
--gradient-to: #{color.adjust($overlay-color, $alpha: -1)};
}

.cover--object--dark {
$overlay-color: color.adjust(colors.$black, $alpha: -0.333);

Expand Down
4 changes: 4 additions & 0 deletions partials/post-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
cover--object
cover--object--light
{{/has}}
{{#has tag="#cover-object-medium"}}
cover--object
cover--object--medium
{{/has}}
{{#has tag="#cover-object-dark"}}
cover--object
cover--object--dark
Expand Down
6 changes: 5 additions & 1 deletion post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<main class="site__content">

{{#post}}
<article class="article">
<article class="article {{#has tag="#cover"}}article--cover{{/has}}">

<header
class="
Expand All @@ -20,6 +20,10 @@
cover--object
cover--object--light
{{/has}}
{{#has tag="#cover-object-medium"}}
cover--object
cover--object--medium
{{/has}}
{{#has tag="#cover-object-dark"}}
cover--object
cover--object--dark
Expand Down

0 comments on commit ca62ecf

Please sign in to comment.