交互
用于控制表单控件尺寸的工具类。
Class | Styles |
---|---|
field-sizing-fixed | field-sizing: fixed; |
field-sizing-content | field-sizing: content; |
使用 field-sizing-content
工具类可以让表单控件根据内容自动调整尺寸:
在下方输入框中输入内容以观察尺寸变化
<textarea class="field-sizing-content ..." rows="2"> Latex Salesman, Vanderlay Industries</textarea>
使用 field-sizing-fixed
工具类可以让表单控件保持固定尺寸:
在下方输入框中输入内容以观察尺寸保持不变
<textarea class="field-sizing-fixed w-80 ..." rows="2"> Latex Salesman, Vanderlay Industries</textarea>
Prefix a field-sizing
utility with a breakpoint variant like md:
to only apply the utility at medium screen sizes and above:
<input class="field-sizing-content md:field-sizing-fixed ..." />
Learn more about using variants in the variants documentation.