Align navbar container with wider article layout for improved consistency
This commit is contained in:
1 parent
25d7a7a5d2
commit
3bc9f8ce36
2 files changed
+15
-5
No files matched your search
@@ -252,6 +252,12 @@ body > .container-wide {
|
|||||||
max-width: 1400px;
|
max-width: 1400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Align the navbar's inner container with the wider article layout so the
|
||||||
|
brand lines up with the ToC and the nav items line up with the right sidebar. */
|
||||||
|
body.has-toc .navbar .container {
|
||||||
|
max-width: 1400px;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|||||||
@@ -14,13 +14,18 @@
|
|||||||
: 'light';
|
: 'light';
|
||||||
$blowditBg = $blowditThemeBg[$blowditTheme];
|
$blowditBg = $blowditThemeBg[$blowditTheme];
|
||||||
$blowditScheme = ($blowditTheme === 'light') ? 'light' : 'dark';
|
$blowditScheme = ($blowditTheme === 'light') ? 'light' : 'dark';
|
||||||
|
|
||||||
|
// Pre-compute before <body> so we can stamp the has-toc class on it,
|
||||||
|
// which lets CSS align the navbar container with the wider article container.
|
||||||
|
$blowditIsArticle = ($WHERE_AM_I === 'page' && isset($page) && !$page->isStatic() && !$url->notFound());
|
||||||
|
$blowditHasHeadings = $blowditIsArticle && (bool) preg_match('/<h[234]/i', $page->content());
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<?php echo Theme::lang() ?>" data-theme="<?php echo $blowditTheme ?>" style="background-color: <?php echo $blowditBg ?>; color-scheme: <?php echo $blowditScheme ?>;">
|
<html lang="<?php echo Theme::lang() ?>" data-theme="<?php echo $blowditTheme ?>" style="background-color: <?php echo $blowditBg ?>; color-scheme: <?php echo $blowditScheme ?>;">
|
||||||
<head>
|
<head>
|
||||||
<?php include(THEME_DIR_PHP.'head.php'); ?>
|
<?php include(THEME_DIR_PHP.'head.php'); ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body<?php echo $blowditHasHeadings ? ' class="has-toc"' : ''; ?>>
|
||||||
|
|
||||||
<!-- Load Bludit Plugins: Site Body Begin -->
|
<!-- Load Bludit Plugins: Site Body Begin -->
|
||||||
<?php Theme::plugins('siteBodyBegin'); ?>
|
<?php Theme::plugins('siteBodyBegin'); ?>
|
||||||
@@ -94,10 +99,9 @@
|
|||||||
|
|
||||||
// The hero (and the relocated search) only appear on the blog front page.
|
// The hero (and the relocated search) only appear on the blog front page.
|
||||||
$heroVisible = ($WHERE_AM_I === 'home' && Paginator::currentPage() == 1);
|
$heroVisible = ($WHERE_AM_I === 'home' && Paginator::currentPage() == 1);
|
||||||
// True when viewing a single non-static article.
|
// Reuse the values pre-computed before <body> (avoids calling $page->content() twice).
|
||||||
$isArticlePage = ($WHERE_AM_I === 'page' && isset($page) && !$page->isStatic() && !$url->notFound());
|
$isArticlePage = $blowditIsArticle;
|
||||||
// Show 3-column layout (left ToC + content + right sidebar) only when the article has headings.
|
$hasHeadings = $blowditHasHeadings;
|
||||||
$hasHeadings = $isArticlePage && (bool) preg_match('/<h[234]/i', $page->content());
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
|
|||||||
Reference in new issue
Block a user