A11Y: Allow header logo/title to hide, if needed ()

This commit is contained in:
Kris 2023-02-14 09:04:48 -05:00 committed by GitHub
parent dfffb43933
commit 2dbcea9eee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions
app/assets
javascripts/discourse/app/widgets
stylesheets/common/base

@ -13,6 +13,12 @@ export default createWidget("home-logo", {
href: getURL("/"), href: getURL("/"),
}, },
buildClasses() {
if (this.attrs.minimized) {
return "title--minimized";
}
},
href() { href() {
const href = this.settings.href; const href = this.settings.href;
return typeof href === "function" ? href() : href; return typeof href === "function" ? href() : href;

@ -50,6 +50,15 @@
a:visited { a:visited {
color: var(--header_primary); color: var(--header_primary);
} }
&:not(.title--minimized) {
// allows large logos to be hidden if there are too many other header elements
// this prioritizes nav elements, especially in cases of high zoom levels
overflow: hidden;
a {
min-width: 0;
}
}
} }
#site-logo { #site-logo {