-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Allow configuring logo dimensions #1237
Comments
Hi @TheTripleV, your solution, although it follows the html best practices, is limitative to big portion of users. Currently, the logo Forcing a fixed unit The layout shift is definitely something to keep in mind thought and we'll try to look for a solution in future releases that might be less imposing to users. For now, you can still add a fixed |
I don't think image distortion will occur. If I am understanding correctly, when an So, the full snippet would be closer to: <picture width="PREVIOUS_IMG_WIDTH", height="PREVIOUS_IMG_HEIGHT">
{%- if sphinx_version_info < (4, 0) -%}
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}" width="{{ src_wdith }}" height="{{ src_height }}"/>
{%- else %}
<img src="{{ logo_url }}" class="logo" alt="{{ _('Logo') }}" width="{{ src_wdith }}" height="{{ src_height }}"/>
{%- endif %}
</picture> The old |
Ah yes, sorry, I didn't notice the picture tag. |
The logo image does not currently specify the width and height or aspect ratio of the logo image. Because of this, the browser cannot reserve space for the image and layout shift occurs.
In layout.html, modifying
to
would decrease cumulative layout shift.
This example solution requires 2 additional configuration options to be added.
The text was updated successfully, but these errors were encountered: