orzih / mkdocs-with-pdf

Generate a single PDF file from MkDocs repository.
MIT License
332 stars 77 forks source link

Color of level 1 heading not changeable #37

Closed erwini closed 3 years ago

erwini commented 3 years ago

I want to change the textcolor from grey to another color for the level1 heading (h1). I was able to do it for h2 to h6 with the help of styles.scss in the template directory introduced in version 0.8.0

$tmag: #0f0;
h1 { color: $tmag;}
article h1,h2,h3,h4,h5,h6 {color: $tmag;}

any hint ?

orzih commented 3 years ago

try this:

$tmag: #0f0;
.md-typeset h1 { color: $tmag; }

// or

@media print {
  .md-typeset h1 { color: $tmag; } // for material theme
  article h1 { color: $tmag; } // other theme
}

// or

.md-typeset h1 { color: $tmag !important; } // for material theme
article h1 { color: $tmag !important; } // other theme
erwini commented 3 years ago

Tested. works. Always this small details. One question: for what is the parameter !important used. Seen it several times but no explanation found (yet). . Found documentation. It is a CSS command (using the correct search words at goggle). So this is fixed. Thanks for hints