ahmadawais / create-guten-block

📦 A zero-configuration #0CJS developer toolkit for building WordPress Gutenberg block plugins.
https://Awais.dev/cgb-post
MIT License
3.15k stars 328 forks source link

👌 IMPROVE: Styles from wp-editor with context #267

Closed Connum closed 4 years ago

Connum commented 4 years ago

Only add wp-editor as block CSS dependency when in admin context, in order to avoid WordPress enqueuing additional backend CSS in the frontend leading to unnecessary requests.

This addresses issue #210.

ahmadawais commented 4 years ago

@asharirfan @saqibameen test this one and approve the PR so I can release a new version.

ahmadawais commented 4 years ago

Thank you! @Connum

Successfully published:

piotr-bajer commented 4 years ago

Hi, would it be better to change the dependency to like array( 'wp-block-library' ) here: https://github.com/ahmadawais/create-guten-block/commit/f24100b25a9c92fdbdc5ce46f009d22144cfb56f#diff-4317d120593768bbdedb26f6949dadadR35 ?

This way the additional scripts are not loaded and we have a chance to overwrite the default styles for core blocks since the styles are loaded after core styles?