Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/fields/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Enhancements

- Export `build-style/*`, so the stylesheet can be imported as `@wordpress/fields/build-style/style.css` [#81769](https://github.com/WordPress/gutenberg/pull/81769)).

### Internal

- Point tsconfig references at split dependencies' build projects. ([#81509](https://github.com/WordPress/gutenberg/pull/81509), [#81514](https://github.com/WordPress/gutenberg/pull/81514))
Expand Down
30 changes: 30 additions & 0 deletions packages/fields/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@ Install the module
npm install @wordpress/fields --save
```

## Setup

This package requires CSS from this package and from multiple dependency packages.

### Within WordPress

To ensure proper load order, add the `wp-components` stylesheet as a dependency of your plugin's stylesheet. See [wp_enqueue_style documentation](https://developer.wordpress.org/reference/functions/wp_enqueue_style/#parameters) for how to specify dependencies.

WordPress registers no handle for this package's own stylesheet, so load it with your plugin's script:

```js
import '@wordpress/fields/build-style/style.css';
```

### Outside WordPress

Install and load these stylesheets in your application:

```bash
npm install @wordpress/fields @wordpress/theme @wordpress/components
```

```js
import '@wordpress/theme/design-tokens.css';
import '@wordpress/components/build-style/style.css';
import '@wordpress/fields/build-style/style.css';
```

RTL versions of the stylesheets are available in the same paths, but with `-rtl` appended to the filename (`style-rtl.css`). The design tokens stylesheet is universal and does not have a separate RTL version.

## Usage

<!-- START TOKEN(Autogenerated API docs) -->
Expand Down
3 changes: 2 additions & 1 deletion packages/fields/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"import": "./build-module/index.mjs",
"require": "./build/index.cjs"
},
"./package.json": "./package.json"
"./package.json": "./package.json",
"./build-style/*": "./build-style/*"
},
"types": "build-types",
"sideEffects": [
Expand Down
Loading