-
Notifications
You must be signed in to change notification settings - Fork 759
[css-forms-1] Add UA style rules for text fields #11897
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -696,6 +696,51 @@ input[type=radio]:checked::checkmark { | |
| width: 100%; | ||
| } | ||
| ``` | ||
|
|
||
| ## Text fields | ||
|
|
||
| ```css | ||
| input:not([type]), | ||
| input:is([type=text], [type=search], [type=email], [type=password], [type=tel], [type=url], [type=number]), | ||
| textarea { | ||
| display: inline-grid; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should maybe use the modern syntax? |
||
| padding-inline: 2px; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be 0.125em? (2/16) |
||
| } | ||
|
|
||
| input:not([type]), | ||
| input:is([type=text], [type=search], [type=email], [type=password], [type=tel], [type=url], [type=number]) { | ||
| overflow-x: auto; | ||
| scrollbar-width: none; | ||
| padding-block: 1px; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be 0.0625em? (1/16)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally padding should be consistent across select, buttons and inputs |
||
| } | ||
|
|
||
| textarea { | ||
| overflow-y: auto; | ||
| padding-block: 2px; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
| resize: both; | ||
| } | ||
|
|
||
| ::placeholder { | ||
| color: color-mix(in srgb, currentColor 50%, transparent); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly too low contrast (same would apply to disabled button-like text) |
||
| display: none; | ||
| line-break: anywhere; | ||
| grid-area: 1/1; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Used to stack the elements atop each other. Not aware of a way to do this using flex? |
||
| } | ||
|
|
||
| :placeholder-shown::placeholder { | ||
| display: block; | ||
| } | ||
|
|
||
| ::field-text { | ||
| grid-area: 1/1; | ||
| min-block-size: 1lh; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This probably needs a |
||
| /* Should be cursor width but that's not exposed */ | ||
| min-inline-size: 1px; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this actually be 24px? So the textarea/input is never smaller than 24px x 24px?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if this really belongs on field-text, ditto for min-block-size/font-size. Ideally they'd just inherit what they need from the parent. |
||
| block-size: 100%; | ||
| inline-size: 100%; | ||
| } | ||
| ``` | ||
|
|
||
| ## Selects & buttons | ||
|
|
||
| ```css | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is every textual input?