Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/lib/frontend/templates/views/shared/layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ d.Node pageLayoutNode({
),
if (searchBanner != null)
d.div(
classes: ['_banner-bg'],
classes: ['_banner-bg', 'pub-dark-bg'],
child: d.div(
classes: ['container', if (isLanding) 'home-banner'],
children: [
Expand Down Expand Up @@ -343,7 +343,7 @@ d.Node _siteFooterNode({

return d.element(
'footer',
classes: ['site-footer'],
classes: ['site-footer', 'pub-dark-bg'],
children: [
link('${urls.dartSiteRoot}/', 'Dart language', sep: false),
if (moderationNode != null) moderationNode,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/frontend/templates/views/shared/site_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ d.Node siteHeaderNode({
required SearchForm? searchForm,
}) {
return d.div(
classes: ['site-header'],
classes: ['site-header', 'pub-dark-bg'],
children: [
d.button(classes: ['hamburger'], ariaLabel: 'menu toggle'),
if (pageType != PageType.landing)
Expand Down
12 changes: 12 additions & 0 deletions pkg/web_css/lib/src/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ a {
@include variables.brightness-on-hover;
}

// Sections with a permanently dark background (header, footer, banner) use
// brightness(120%) on hover in both themes, overriding the light-mode default.
.light-theme .pub-dark-bg a:hover {
filter: brightness(120%);
}

// Links directly wrapping a monochrome icon rely on the icon's opacity-based
// hover feedback; suppress the brightness filter to avoid stacking effects.
a:has(> .pub-monochrome-icon):hover {
filter: none;
}

main {
min-height: calc(100vh - 130px); // top nav (50) + footer (80)
margin-bottom: 32px;
Expand Down
3 changes: 2 additions & 1 deletion pkg/web_css/lib/src/_site_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
opacity: 1.0;

&:hover {
opacity: 0.8;
// The header has a dark background; brighten on hover instead of dimming.
filter: brightness(120%);
}
}

Expand Down