-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: conditionally import image style #12925
Conversation
🦋 Changeset detectedLatest commit: 1d928cf The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CodSpeed Performance ReportMerging #12925 will not alter performanceComparing Summary
|
@@ -26,15 +26,15 @@ describe('Content Collections - render()', () => { | |||
assert.equal($('ul li').length, 3); | |||
|
|||
// Includes styles | |||
assert.equal($('link[rel=stylesheet]').length, 2); | |||
assert.equal($('link[rel=stylesheet]').length, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are all tests that were changed when experimental images were added. This is just changing them back.
d7bbb08
to
22c58a2
Compare
Changes
Responsive images need to include global styles, and currently these are being included even if responsive images are not enabled. This PR adds wrapper components that just add the styles to the main component, and conditionally export these according to whether the flag is enabled. This is temporary until the feature is unflagged.
Alongside #12921, this fixes #12868
Testing
Adds tests to ensure the styles aren't added to sites without the flag enabled. There are existing tests that check that they are added to pages that do have them enabled.
This also adds tests to the MDX integration that were needed for #12921 and are now possible. These check whether the styles are being applied to pages with no images.
Docs