Skip to content
Grav 2.0 is officially stable. Read the announcement →
Themes & Styling

Quark: How to change display height of Hero image

Solved by pamtbaau View solution

Started by Matthieu 6 years ago · 5 replies · 1249 views
6 years ago

@matteo, See '/user/themes/quark/scss/theme/_framework.scss': hero-large, hero-medium, hero-small, etc.

And its use ('hero-large') in frontmatter of 'item.md':

TXT
hero_classes: text-light title-h1h2 overlay-dark-gradient hero-large parallax
6 years ago

Thank you, but that does not solve my issue. It tracked it down to the
padding-top: 6rem;
padding-bottom: 7rem;
associated to class hero in theme.min.css
I do not manage to take them out, so I must sill have a misunderstanding on how this css is generated, and from where these informations are taken.

6 years ago Solution

@matteo,

If you don't want to build/compile SCSS, but instead override the generated css file css-compiled/theme.min.css, you can do the following:

  • In an inherited theme
  • Create file '/user/themes/<my-theme>/css/custom.css':
  • Add the following to 'custom.css'

    CSS
    // Use .hero-medium, or .hero-small, or ... depending on class set 
    // for `hero_classes` in the frontmatter of the page.
    .hero.hero-large {
      min-height: 500px;
    }
    
    .hero {
    padding-top: 6rem;
    padding-bottom: 7rem;
    }
    
  • Change the values for min-height, padding-top and padding-bottom to your liking.
6 years ago

Thank you, this is exactly what I wanted to do. This custom.css file will always override the definitions from the theme I inherited from ?

6 years ago

custom.css is the last css file loaded by Quark or its child themes and will hence override all earlier loaded stylesheets.

last edited 02/06/21 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by stuart young, 2 weeks ago
3 251 2 weeks ago
Themes & Styling · by Sebadamus, 3 weeks ago
5 319 3 weeks ago
Themes & Styling · by martynfoster735, 4 weeks ago
1 310 4 weeks ago
Themes & Styling · by Justin Young, 1 month ago
1 348 1 month ago
Themes & Styling · by Slebeig, 2 months ago
4 474 2 months ago