Skip to content

Add field-sizing utilities#14469

Merged
adamwathan merged 3 commits into
nextfrom
feat/v4-field-sizing-utilities
Sep 20, 2024
Merged

Add field-sizing utilities#14469
adamwathan merged 3 commits into
nextfrom
feat/v4-field-sizing-utilities

Conversation

@thecrypticace

Copy link
Copy Markdown
Contributor

This PR adds support for the field-sizing property which can be used to fit a text inputs, file inputs, textareas, and selects to the size of the text rather than some implicit default width.

@adamwathan

Copy link
Copy Markdown
Member

Nice 😎 Where should we stick this in the property-order.ts file do you think? 🤔

@thecrypticace

Copy link
Copy Markdown
Contributor Author

I was wondering if we needed to. What about after aspect-ratio? I put it there in the utilities file because it affects the size of some elements but isn't itself a way to set a specific size.

@adamwathan

Copy link
Copy Markdown
Member

Let's do it right before the aspect-ratio since aspect-ratio, width, and height all take precedence in the browser if you define them.

@thecrypticace thecrypticace force-pushed the feat/v4-field-sizing-utilities branch from dfbb5d5 to 0c92591 Compare September 20, 2024 14:44
Comment thread packages/tailwindcss/src/property-order.ts Outdated
@adamwathan adamwathan force-pushed the feat/v4-field-sizing-utilities branch from 5036a84 to 6c95e39 Compare September 20, 2024 14:50
@adamwathan adamwathan merged commit fe2610e into next Sep 20, 2024
@adamwathan adamwathan deleted the feat/v4-field-sizing-utilities branch September 20, 2024 14:50
adamwathan added a commit that referenced this pull request Sep 20, 2024
This PR adds support for the
[`field-sizing`](https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing)
property which can be used to fit a text inputs, file inputs, textareas,
and selects to the size of the text rather than some implicit default
width.

---------

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
Comment on lines +889 to +890
staticUtility('field-sizing-fixed', [['field-sizing', 'fixed']])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing field-sizing: normal

staticUtility('field-sizing-normal', [['field-sizing', 'normal']])

@thecrypticace thecrypticace Apr 20, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normal was replaced with content in late 2023 while the spec was still a work in progress

"end-auto",
"end-full",
"field-sizing-content",
"field-sizing-fixed",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing normal

"field-sizing-normal",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants