Repository navigation
feat(theme): align the textarea recipe with Open Components - #380
Merged
alexgrozav merged 2 commits intoOct 29, 2026
Merged
Conversation
The textarea now meets the stylesheet rules on the Open Components Textarea page. It's never shorter than its rows, since the nested textarea gets a min-height of its rows in lines. On touch screens its text is at least 16px and the field at least 44px tall. A new autogrow axis, off by default, grows it with its text through field-sizing up to its data-max-rows, in browsers that support field-sizing. Tests cover each rule by its ID, a contrast test covers every color and variant in both themes, and the Storybook examples now label every textarea.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…n the block axis On touch screens the 44px minimum sat on the wrapper, so a one-row textarea was only a 24px target. The nested textarea now gets it, keeping its rows where typed attr() works. The vertical resize default also sets resize: block where browsers support it, so it follows the writing mode. The docs count 17 compound entries and cite their browser-support claims.
7 of 13 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Brings
useTextareaRecipein line with the stylesheet rules on the Open Components Textarea page, on top of the shared field surface the Input change already aligned.min-height: calc(attr(rows type(<number>), 2) * 1lh), so resizing or growing never makes it shorter than its rows. Browsers without typedattr()drop the declaration, androwsstill sets the starting height.autogrowaxis,falseby default, adds a-autogrowmarker. Inside@supports (field-sizing: content), it setsfield-sizing: content, turns resizing off and capsmax-heightat the rows in the textarea'sdata-max-rows. Withoutfield-sizingthe textarea keeps its resize handle.@media (any-pointer: coarse)the textarea's text is at least 16px, and the textarea itself, which takes the tap, is at least 44px tall, whatever its rows.verticalstays the default value, and now also emitsresize: blockinside@supports (resize: block), so it follows the writing mode.none,horizontalandbothstay for compatibility, and the docs say they don't meet the rule.@color.focusring in every state, the:has()state hooks, hover behindhover-capable, forced colors, more contrast and logical padding.textareaContrast.test.tsfor every color × variant in both themes, the placeholder and a count in the suffix included.dir="auto".Related issue
None.
Type of change
Checklist
feat(theme): …)pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm testand everything passespnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/testsdist/,.styleframe/)mainand stays focused in scopeNotes / screenshots
pnpm testpasses exceptapps/playground/test/theme.test.ts, which fails the same way on the base branch under Node 26 (localStorageis not available without--localstorage-file).main.minorbecause of the newautogrowaxis. No axis, value, default or export is renamed or removed.textarea/countandtextarea/announce-countneed script, so they stay with the UI libraries. Over the limit, the textarea'saria-invalid="true"gives it the invalid look.