Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v2): Allow the alt for the logo to be empty #3352

Merged
merged 1 commit into from
Aug 28, 2020

Conversation

Vinnl
Copy link
Contributor

@Vinnl Vinnl commented Aug 28, 2020

Motivation

See
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Img#Attributes

Setting this attribute to an empty string (alt="") indicates that
this image is not a key part of the content (it’s decoration or a
tracking pixel), and that non-visual browsers may omit it from
rendering.

Since the logo is indeed decorative and redundant with the actual
project name, an empty alt is fine.

We could also consider just making the attribute optional and defaulting to an empty string, since the logo is going to be redundant with title in the general case. I'm happy to update the PR to that, but since just allowing the empty string was the approach described in #3350, I went with that for now.

Fixes #3350.

Have you read the Contributing Guidelines on pull requests?

Yes.

Test Plan

Run the unit tests. Set up a new project, set the alt property for the logo in the navbar and footer to an empty string, then verify that it is not rejected.

See
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Img#Attributes

> Setting this attribute to an empty string (alt="") indicates that
> this image is not a key part of the content (it’s decoration or a
> tracking pixel), and that non-visual browsers may omit it from
> rendering.

Since the logo is indeed decorative and redundant with the actual
project name, an empty alt is fine.
@Vinnl Vinnl requested a review from lex111 as a code owner August 28, 2020 10:28
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 28, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 6d63797

https://deploy-preview-3352--docusaurus-2.netlify.app

@slorber
Copy link
Collaborator

slorber commented Aug 28, 2020

thanks ;)

@slorber slorber changed the title Allow the alt for the logo to be empty fix(v2): Allow the alt for the logo to be empty Aug 28, 2020
@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Aug 28, 2020
@slorber slorber merged commit 56c04c7 into facebook:master Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"navbar.logo.alt" is not allowed to be empty
4 participants