Skip to content

Update functions.image.php#116

Merged
mambax7 merged 3 commits intoXoopsModules25x:masterfrom
BigKev73:patch-28
Feb 18, 2021
Merged

Update functions.image.php#116
mambax7 merged 3 commits intoXoopsModules25x:masterfrom
BigKev73:patch-28

Conversation

@BigKev73
Copy link
Copy Markdown
Contributor

Removing the height value can lead to CLS. So the better option is to add a height: auto style tag and restore the height value. This way the browser knows the size of the image ahead of time and calculates the height based on the available max-width. Thereby preventing the CLS from happening.

Removing the height value can lead to CLS. So the better option is to add a height: auto style tag and restore the height value. This way the browser knows the size of the image ahead of time and calculates the height based on the available max-width. Thereby preventing the CLS from happening.
One more change so the image when viewed without a thumbnail has the correct width and height set for the browser.
Removed un-needed px markers from width and height markers since those are not in a style tag, they are not needed.
@mambax7 mambax7 merged commit 7602510 into XoopsModules25x:master Feb 18, 2021
@mambax7
Copy link
Copy Markdown
Contributor

mambax7 commented Feb 18, 2021

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants