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

Chore: Update index.scss to include gutenberg blocks library CSS #798

Merged
merged 3 commits into from
Jun 16, 2020

Conversation

derekshirk
Copy link
Contributor

@derekshirk derekshirk commented Jun 16, 2020

Overview

See #789, and Tyler's suggestion here.

In order to remedy a CSS source order loading issue that was causing the WordPress Gutenberg block library CSS from trumping our patterns CSS in Storybook previews, this PR does the following:

• Creates a new index-with-wp-block-library file that imports WP styles before our pattern styles (index.scss)
• Updates .storybook/preview.js to include the new index-with-wp-block-library instead of index
• Removes @wordpress/block-library/build-style/style.css from src/vendor/wordpress/gutenberg.stories.mdx, previously added in #778

Consideration

With #778 (WP) Gutenberg block styles were only loaded on the Gutenberg stories. With this update, as I understand it, the Gutenberg CSS will now be loaded on every Storybook page. If that is a concern we should explore other alternative approaches.

Screenshots

Before

Notice the secondary button is outlined with a black border and black text.

Screen Shot 2020-06-16 at 3 08 54 PM

After

Here, the secondary button is styled as expected with our c-button c-button--secondary styles.

Screen Shot 2020-06-16 at 2 22 30 PM

Testing

  1. View deploy preview
  2. Confirm the secondary button is outlined with a blue border and has blue text.

See #789

@derekshirk derekshirk self-assigned this Jun 16, 2020
@changeset-bot
Copy link

changeset-bot bot commented Jun 16, 2020

💥 No Changeset

Latest commit: ff1d84e

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@derekshirk
Copy link
Contributor Author

If these changes should be published to npm, you need to add a changeset.

I am unsure if this PR requires a changeset. 🤔

.storybook/preview.js Outdated Show resolved Hide resolved
@derekshirk derekshirk requested a review from tylersticka June 16, 2020 22:13
@derekshirk derekshirk marked this pull request as ready for review June 16, 2020 22:13
@derekshirk derekshirk merged commit 0537a69 into v-next Jun 16, 2020
@derekshirk derekshirk deleted the chore/css-import-gutenberg-blocks branch June 16, 2020 22:46
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