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
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- `ComboboxControl`: ([#80471](https://github.com/WordPress/gutenberg/pull/80471))
- `GradientPicker`, `ColorPalette`: ([#80473](https://github.com/WordPress/gutenberg/pull/80473)).
- `BaseControl` ([#80001](https://github.com/WordPress/gutenberg/pull/80001))
- `TextareaControl` ([#81353](https://github.com/WordPress/gutenberg/pull/81353))

### Enhancements

Expand Down
5 changes: 2 additions & 3 deletions packages/components/src/textarea-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import clsx from 'clsx';
import { useInstanceId } from '@wordpress/compose';
import { forwardRef } from '@wordpress/element';
import BaseControl from '../base-control';
import { StyledTextarea } from './styles/textarea-control-styles';
import styles from './style.module.scss';
import type { TextareaControlProps } from './types';
import type { WordPressComponentProps } from '../context';
import styles from './style.module.scss';

function UnforwardedTextareaControl(
props: WordPressComponentProps< TextareaControlProps, 'textarea', false >,
Expand Down Expand Up @@ -38,7 +37,7 @@ function UnforwardedTextareaControl(
help={ help }
className={ classes }
>
<StyledTextarea
<textarea
className={ clsx(
'components-textarea-control__input',
styles.textarea
Expand Down
51 changes: 51 additions & 0 deletions packages/components/src/textarea-control/style.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
@use "@wordpress/base-styles/mixins" as *;
@use "../utils/theme-variables" as *;

.textarea {
width: 100%;
display: block;
background: $components-color-background;
color: $components-color-foreground;
/* stylelint-disable-next-line plugin/use-logical-properties-and-values -- Preserve Emotion `resize: vertical`; `block` is not equivalent in vertical writing modes. */
resize: vertical;

@include input-control;

// Vertical padding is to match the standard 40px control height when rows=1,
// in conjunction with the 20px line-height.
// "Standard" metrics are 10px 12px, but subtracts 1px each to account for the border width.
line-height: 20px;
padding: 9px 11px;

// Matching the 20px line-height + the 9px top and bottom padding.
min-height: 38px;

&:disabled {
background: $components-color-gray-100;
border-color: $components-color-gray-400;
color: $components-color-gray-600;
}

// Use opacity to work in various editor styles.
// Keep the legacy vendor placeholders from the Emotion styles for parity
&::-webkit-input-placeholder {
color: $components-color-dark-gray-placeholder;
}

&::-moz-placeholder {
color: $components-color-dark-gray-placeholder;
}

&:-ms-input-placeholder {
color: $components-color-dark-gray-placeholder;
}

:global(.is-dark-theme) & {
&::-webkit-input-placeholder {
color: $components-color-light-gray-placeholder;
}

&::-moz-placeholder {
color: $components-color-light-gray-placeholder;
}

&:-ms-input-placeholder {
color: $components-color-light-gray-placeholder;
}
}
}

This file was deleted.

5 changes: 0 additions & 5 deletions tools/eslint/suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -896,11 +896,6 @@
"count": 1
}
},
"packages/components/src/textarea-control/styles/textarea-control-styles.ts": {
"no-restricted-imports": {
"count": 1
}
},
"packages/components/src/toggle-group-control/toggle-group-control/utils.ts": {
"react-hooks/refs": {
"count": 11
Expand Down
Loading