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(plugin-netlify-cms): exclude cms.css from index.html #32106

Merged
merged 2 commits into from
Jun 29, 2021

Conversation

erezrokah
Copy link
Contributor

Description

During the migration from Gatsby v2 to v3, html-webpack-exclude-assets-plugin was commented out since it doesn't support webpack 5.

This PR uses html-webpack-skip-assets-plugin to restore the same functionality as before.

Without this fix cms.css is added to the CMS index.html, thus styles are applied globally (to the CMS itself).
With the fix styles are only applied to the CMS preview pane via

CMS.registerPreviewStyle(`cms.css`)

Related Issues

Fixes #31909

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 24, 2021
@LekoArts LekoArts added topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 25, 2021
@LekoArts
Copy link
Contributor

Thanks! Fortunately the author already published your changes in 1.0.2 so you can change your code a bit and remove the TODO :)

@erezrokah
Copy link
Contributor Author

Thanks! Fortunately the author already published your changes in 1.0.2 so you can change your code a bit and remove the TODO :)

Thanks for the quick review @LekoArts, fixed in d7c087b

@LekoArts LekoArts merged commit 6ce7c62 into master Jun 29, 2021
@LekoArts LekoArts deleted the fix/cms_plugin_css branch June 29, 2021 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[gatsby-plugin-netlify-cms] Global styles not confined to preview pane
2 participants