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

FontSizePicker: Fix FontSizePicker Storybook control type and improve documentation #68936

4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Documentation

- `FontSizePicker`: Fix Storybook units control type to use `inline-check` and improve documentation clarifying unitless mode in `README.md` ([#68936](https://github.com/WordPress/gutenberg/pull/68936)).

### Bug Fixes

- `TextControl`: Ensures email and url inputs have consistent LTR alignment in RTL languages ([#68561](https://github.com/WordPress/gutenberg/pull/68561)).
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/font-size-picker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ Available units for custom font size selection.

The current font size value.

**Note**: For the `units` property to work, the current font size value must be specified as strings with units (e.g., `'12px'` instead of `12`). When the font size is provided as a number, the component operates in "unitless mode" where the `units` property has no effect.

- Required: No

### `withReset`: `boolean`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const meta: Meta< typeof FontSizePicker > = {
component: FontSizePicker,
argTypes: {
value: { control: false },
units: {
control: 'inline-check',
options: [ 'px', 'em', 'rem', 'vw', 'vh' ],
},
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/font-size-picker/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export type FontSizePickerProps = {
units?: string[];
/**
* The current font size value.
*
* Note: For the `units` property to work, the current font size value must be specified
* as strings with units (e.g., '12px' instead of 12). When the font size is provided
* as a number, the component operates in "unitless mode" where the `units` property has no effect.
*/
value?: number | string;
/**
Expand Down
Loading