Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function Logo(props: Props): JSX.Element {
sources={sources}
height={logo.height}
width={logo.width}
alt={logo.alt || navbarTitle || title}
alt={logo.alt ?? (navbarTitle || title)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about the case of alt: undefined and navbar: { title: "TypeScript ESLint" }? Should we use alt="" as well (sounds more sensible to me)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty much of the mindset that if any text appears in the same link as the logo, the logo should have alt="" - since at that point, the logo serves only to adorn that text.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we use something closer to the line of logo.alt ?? (navbarTitle ? "" : title) then? (Plus a comment like "respect empty alt, don't show alt that's duplicated from navbar title")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure - I'll pull that out into its own declaration though, so that way it's not all inlined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

/>
);

Expand Down
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ const config = {
hideOnScroll: true,
title: 'Docusaurus',
logo: {
alt: 'Docusaurus Logo',
alt: '',
src: 'img/docusaurus.svg',
srcDark: 'img/docusaurus_keytar.svg',
width: 32,
Expand Down