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(gatsby-plugin-image): Correct image styles #28834

Merged
merged 3 commits into from
Jan 4, 2021
Merged

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Jan 4, 2021

This PR contains two bugfixes to the handling of styles in gatsby-plugin-image. First, it correctly applies some styles that were msising in SSR. Second it fixes a compatibility issue when using preact, where the "class" prop was not intercepted, and was instead passed-down to the img tag. The same would happen if using the class prop in React (instead of className), but it less of an issue as that's not explicitly allowed (though does normally work).

Fixes bug reported in #27950 (comment)

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 4, 2021
@ascorbic ascorbic added topic: media Related to gatsby-plugin-image, or general image/media processing topics and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 4, 2021
pvdz
pvdz previously approved these changes Jan 4, 2021
Copy link
Contributor

@pvdz pvdz left a comment

Choose a reason for hiding this comment

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

The in and delete patterns are really red flags for me. But I mean, it's valid code and not in a perf sensitive path so I'll leave it up to you :)

@ascorbic ascorbic added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Jan 4, 2021
@gatsbybot gatsbybot merged commit 3d6446c into master Jan 4, 2021
@gatsbybot gatsbybot deleted the fix/image-style-props branch January 4, 2021 11:46
vladar pushed a commit that referenced this pull request Jan 5, 2021
* fix(gatsby-plugin-image): Correct image styles

* Remove avif options from dom

* Remove in/delete

(cherry picked from commit 3d6446c)
gatsbybot pushed a commit that referenced this pull request Jan 5, 2021
* fix(gatsby-plugin-image): Correct image styles

* Remove avif options from dom

* Remove in/delete

(cherry picked from commit 3d6446c)

Co-authored-by: Matt Kane <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants