-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
NavbarLogo doesn't have width and height attribute #5724
Comments
As a further request: can we make all images within a Markdown file have the This ensures that there's no layout shift as the images load. |
Yes, agree that we should definitively do that! |
Hi, Can you provide some implementation insights for me to get started? |
Unfortunately not much, it's not something we have ever done yet in Docusaurus. Maybe we can look into converting this: module.exports = {
themeConfig: {
navbar: {
title: 'Site Title',
logo: {
src: 'img/logo.png',
srcDark: 'img/logo_dark.png',
},
},
},
}; Into this? module.exports = {
themeConfig: {
navbar: {
title: 'Site Title',
logo: {
src: {src: 'img/logo.png', width: 50, height: 50},
srcDark: {src: 'img/logo.png', width: 50, height: 50},
},
},
},
}; Not sure where this conversion should lead exactly, how expensive it is, and also we must consider that some people provide an absolute URL, or a SVG... Temporarily, we could allow providing width/height explicitly? module.exports = {
themeConfig: {
navbar: {
title: 'Site Title',
logo: {
src: 'img/logo.png',
width: 50,
height: 50,
className: "my-custom-logo"
},
},
},
}; |
🐛 Bug Report
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
The
img
tag in the NavbarLogo attribute in docusaurus.config.js file to add Logo to Navbar doesn't have any option/prop to set theheight
andwidth
of the logo. Because of this, the Lighthouse Report fails and suggests to addwidth
andheight
to the logo image.Have you read the Contributing Guidelines on issues?
Yes, I have Read it.
Steps to reproduce
width
andheight
attributeinspect
element, width and height attributes are missing.Expected behavior
There should be props for this in order to add height and width to image along with defaults.
Screen Shot
Your environment
I am new to the community and willing to contribute towards this issue. Please let me know more insights upon this. Would like to take this up!
The text was updated successfully, but these errors were encountered: