Skip to content

Commit

Permalink
Update applying-styles-with-stylesheets.md (#45604)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbossenger authored Nov 9, 2022
1 parent 41a0bd5 commit 3076dec
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,37 @@ registerBlockType( 'gutenberg-examples/example-02-stylesheets', {

{% end %}

### Build or add dependency

In order to include the blockEditor as a dependancy, make sure to run the build step, or update the asset php file.

{% codetabs %}
{% JSX %}

Build the scripts and update the asset file which is used to keep track of dependencies and the build version.
```bash
npm run build
```

{% Plain %}

Edit the asset file to include the block-editor dependancy for the scripts.

```php
<?php return
array( 'dependencies' =>
array(
'wp-blocks',
'wp-element',
'wp-block-editor',
'wp-polyfill'
),
'version' => '0.1'
);
```

{% end %}

### Enqueue stylesheets

Like scripts, you can enqueue your block's styles using the `block.json` file.
Expand Down

0 comments on commit 3076dec

Please sign in to comment.