rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
17.28k stars 1.59k forks source link

How to change max content width of single page? #2098

Open armoha opened 1 year ago

armoha commented 1 year ago

Question

I want wide width for overview table page, but don't need to change width of other pages.

Example: https://armoha.github.io/eud_book_en/

/* theme/css/variables.css */
:root {
    /* this applies to every pages */
    --content-max-width: 1350px;
}

Version

mdbook v0.4.30
AlessandroMattiazzi commented 1 year ago

You can add a simple javascipt and use this code:

if (window.location.pathname.endsWith('page_name.html')) 
{
  document.documentElement.style.setProperty('--content-max-width', '1350px');
}
asggWa commented 11 months ago

/ theme/css/variables.css / :root { / this applies to every pages / --content-max-width: 1350px; } / theme/css/variables.css / :other{ / this not applies to every pages / --content-max-width: 100%; }