Skip to content

Commit

Permalink
Docs: Clarify the status of the wp-block-styles theme support, and it…
Browse files Browse the repository at this point in the history
…s intent (#58915)

* Docs: Clarify the status of the wp-block-styles theme support, and its intent to be used in classic themes

* Add heading for opinionated block styles

* Switch to verb "opt in"

Co-authored-by: Ramon <ramonjd@users.noreply.github.com>

---------

Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: simison <simison@git.wordpress.org>
  • Loading branch information
5 people authored Feb 12, 2024
1 parent 535252e commit 7011e5a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/how-to-guides/themes/theme-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,18 @@ add_action( 'after_setup_theme', 'mytheme_setup_theme_supported_features' );

Core blocks include default structural styles. These are loaded in both the editor and the front end by default. An example of these styles is the CSS that powers the columns block. Without these rules, the block would result in a broken layout containing no columns at all.

The block editor allows themes to opt-in to slightly more opinionated styles for the front end. An example of these styles is the default color bar to the left of blockquotes. If you'd like to use these opinionated styles in your theme, add theme support for `wp-block-styles`:
### Opinionated block styles

The block editor allows themes to opt in to slightly more opinionated styles for the front end. An example of these styles is the default color bar to the left of blockquotes. If you'd like to use these opinionated styles in a classic theme, add theme support for `wp-block-styles`:

```php
add_theme_support( 'wp-block-styles' );
```

You can see the CSS that will be included in the [block library theme file](https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/theme.scss).

For block themes or themes providing a `theme.json` file, it is not recommended to use this theme support. Instead, to ensure there is no styling conflict between global styles rules and block styles, add the desired block styles to the theme's `theme.json` file.

### Wide Alignment:

Some blocks such as the image block have the possibility to define a "wide" or "full" alignment by adding the corresponding classname to the block's wrapper ( `alignwide` or `alignfull` ). A theme can opt-in for this feature by calling:
Expand Down

0 comments on commit 7011e5a

Please sign in to comment.