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
feat(form-control): move background icons to element #5531
feat(form-control): move background icons to element #5531
Conversation
Preview: https://patternfly-pr-5531.surge.sh A11y report: https://patternfly-pr-5531-a11y.surge.sh |
8f8203a
to
f081220
Compare
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.
Looks pretty good to me!
- I see
.pf-c-form-control--[element]
classes on the form elements - are those needed? Generally speaking, I think it would be better to target the class than the html element across the board when we can. Though I believe if we want to keep the class, it should probably be__element
- we would use--element
in a var to target a genericelement
that's a child. - Adding a status to any of the text input examples that already have a non-status icon doesn't work as intended, but that can be a follow up if we want.
Now that we have a div wrapping these elements, I think we can move the borders to pseudo elements and not have to adjust heights and paddings and things according to the border width, which would simplify a lot of the CSS. I think it's worth taking a stab at this, wdyt? I'd be happy to run through that, too.
display: grid; | ||
grid-template-columns: 1fr auto; | ||
column-gap: var(--#{$form-control}--ColumnGap); | ||
align-items: flex-start; |
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.
this works, but since it's grid, I'd just use start
since it's well supported.
align-items: flex-start; | |
align-items: start; |
height: var(--#{$form-control}--Height); | ||
|
||
// truncate overflow text | ||
& > *::placeholder { |
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.
Just a nit, the &
and *
are redundant?
& > *::placeholder { | |
> ::placeholder { |
|
||
// stylelint-disable selector-not-notation | ||
// update to single :not() in breaking change | ||
&:not(.pf-m-success):not([aria-invalid="true"]) { | ||
&:not(.pf-m-success, .pf-m-warning, .pf-m-error,[aria-invalid="true"]) { |
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.
You should be able to remove this? That would go on the form element and the border has been moved to the parent.
&:not(.pf-m-success, .pf-m-warning, .pf-m-error,[aria-invalid="true"]) { | |
&:not(.pf-m-success, .pf-m-warning, .pf-m-error) { |
background-image: var(--#{$form-control}__select--BackgroundUrl); | ||
background-position: var(--#{$form-control}__select--BackgroundPosition); | ||
background-size: var(--#{$form-control}__select--BackgroundSize); | ||
& > select { |
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.
nit - I think the &
is redundant?
& > select { | |
& > select { |
--#{$form-control}--m-warning--BackgroundPositionY: var(--#{$form-control}--textarea--m-warning--BackgroundPositionY); | ||
|
||
|
||
& > textarea { |
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.
nit - redundant?
& > textarea { | |
> textarea { |
resize: vertical; | ||
} | ||
|
||
&.pf-m-resize-horizontal { | ||
&:has(textarea), |
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.
This selector won't work in FF or in pre 15.4 safari. Is it needed?
<div class="{{pfv}}form-control__toggle-icon"> | ||
<i class="fas fa-caret-down" aria-hidden="true"></i> | ||
</div> |
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.
nit
<div class="{{pfv}}form-control__toggle-icon"> | |
<i class="fas fa-caret-down" aria-hidden="true"></i> | |
</div> | |
<div class="{{pfv}}form-control__toggle-icon"> | |
<i class="fas fa-caret-down" aria-hidden="true"></i> | |
</div> |
{{> form-control-icon form-control--HasIcon="exclamation-triangle"}} | ||
{{else if form-control--IsError}} | ||
{{> form-control-icon form-control--HasIcon="exclamation-circle"}} | ||
{{/if}} |
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.
Looks like this file is missing a new line at EOF
@@ -1,33 +1,6 @@ | |||
// @debug $form-control; // check your variable names located in src/patternfly/sass-utilities/component-namespaces.scss | |||
// Input - success | |||
$pf-v5-c-form-control--success--Color: $pf-v5-global--success-color--100 !default; |
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.
🥳
padding-right: var(--#{$form-control}__utilities--PaddingRight); | ||
padding-left: var(--#{$form-control}__utilities--PaddingLeft); |
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.
Just a nit but since this basically just overlays the element behind it, do we need a left padding?
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.
More to come...
scripts/helpers.mjs
Outdated
// export const ifAnyHELP = function () { | ||
// const args = Array.prototype.slice.call(arguments, 0, -1); | ||
// const options = arguments[arguments.length - 1]; | ||
// const anyTruthy = args.some(arg => arg); | ||
// }; | ||
|
||
// return anyTruthy ? options.fn(this) : options.inverse(this); | ||
// }; |
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.
Did you intend to leave this in?
{{{form-control-icon--attribute}}} | ||
{{/if}}> | ||
<i class="fas fa-{{form-control--HasIcon}}" aria-hidden="true"></i> | ||
</div> |
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.
</div> | |
</div> | |
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.
Just want to make sure you saw this, this file is missing a new line at EOF
{{> form-control-icon form-control--HasIcon="exclamation-triangle"}} | ||
{{else if form-control--IsError}} | ||
{{> form-control-icon form-control--HasIcon="exclamation-circle"}} | ||
{{/if}} |
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.
{{/if}} | |
{{/if}} | |
{{#if form-control--IsExpanded}} pf-m-expanded{{/if}} | ||
{{#if form-control--IsDisabled}} pf-m-disabled{{/if}} | ||
{{#if form-control--IsReadonly}} pf-m-readonly{{/if}} | ||
{{#if form-control--IsRequired}} pf-m-required{{/if}} | ||
{{#if form-control--IsPlaceholder}} pf-m-placeholder{{/if}} | ||
{{#if form-control--IsPlain}} pf-m-plain{{/if}} | ||
{{#if form-control--IsSuccess}} pf-m-success{{/if}} | ||
{{#if form-control--IsWarning}} pf-m-warning{{/if}} | ||
{{#if form-control--IsError}} pf-m-error{{/if}} | ||
{{#if form-control--HasIcon}} pf-m-icon{{/if}} | ||
{{#if form-control--modifier}} {{form-control--modifier}}{{/if}} |
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.
👍 Love this update!
|
||
### Usage | ||
| Class | Applied to | Outcome | | ||
| -- | -- | -- | | ||
| `.pf-v5-c-form-control` | `<input>`,`<textarea>`, `<select>` | Initiates an input, textarea or select. For styling of checkboxes or radios see the [checkbox component](/components/checkbox) or [radio component](/components/radio). **Required** | | ||
| `.pf-v5-c-form-control` | `<div>` | Initiates a container for an input, textarea or select. For styling of checkboxes or radios see the [checkbox component](/components/checkbox) or [radio component](/components/radio). **Required** | | ||
| `.pf-v5-c-form-control` | `<input>`,`<textarea>`, `<select>` | Initiates an input, textarea or select. **Required** | |
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.
Is the intent that either a div or input/textarea/select can have this class? Based on the examples it seems like line 172 here should be removed.
| `.pf-m-placeholder` | `select.pf-v5-c-form-control` | Modifies a form select for placeholder styles. This modifier is set programatically based on the chosen option. | | ||
| `.pf-m-plain` | `input[readonly].pf-v5-c-form-control`, `textarea[readonly].pf-v5-c-form-control` | Modifies an `<input>` or `<textarea>` with a `readonly` attribute to be presented as normal text. | | ||
| `.pf-m-error` | `.pf-v5-c-form-control` | Modifies a form control for the error (invalid) state. | | ||
| `.pf-v5-c-form-control__icon` | `div` | Creates a container for an icon associated with a text input. |
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.
Looks like .pf-v5-c-form-control__utilities
is missing from the docs, same for pf-m-status
and pf-m-icon
. One other nit:
| `.pf-v5-c-form-control__icon` | `div` | Creates a container for an icon associated with a text input. | |
| `.pf-v5-c-form-control__icon` | `div` | Creates a container for an icon associated with a form control. |
--#{$form-control}--invalid--BorderBottomWidth: var(--#{$pf-global}--BorderWidth--md); | ||
--#{$form-control}--invalid--PaddingBottom: calc(var(--#{$pf-global}--spacer--form-element) - var(--#{$form-control}--invalid--BorderBottomWidth)); | ||
--#{$form-control}--invalid--BorderBottomColor: var(--#{$pf-global}--danger-color--100); | ||
--#{$form-control}--invalid--PaddingRight: var(--#{$pf-global}--spacer--xl); |
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.
Not a blocker for this PR, but @mcoker would it make sense to update these --invalid
vars to ...--m-invalid
?
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.
@thatblindgeye yep, nice catch. Since it's a modifier now, this would be --m-invalid
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've been debating on this. It could also be --m-error
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.
Just some nits, none are blocking. I say we merge and follow up?
Also I think this needs to be &.pf-m-readonly
?
patternfly/src/patternfly/components/FormControl/themes/dark/form-control.scss
Lines 21 to 23 in 4455d9b
&[readonly] { | |
border-bottom-color: var(--#{$pf-global}--palette--black-700); // should be a var? | |
} |
| `.pf-m-resize-horizontal` | `textarea.pf-m-form-control` | Modifies a `textarea.pf-v5-c-form-control` element so it can only be resized horizontally along the x-axis. | | ||
| `.pf-v5-c-form-control` | `<div>` | Initiates a container for an input, textarea or select. For styling of checkboxes or radios see the [checkbox component](/components/checkbox) or [radio component](/components/radio). **Required** | | ||
| `.pf-v5-c-form-control__utilities` | `<div>` | Initiates a container for elements like icons to be associated with the form control. | | ||
| `.pf-v5-c-form-control__icon` | `<div>` | Creates a container for an icon associated with a text input. | |
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.
Since this element is used for status icons, that applies to any control.
| `.pf-v5-c-form-control__icon` | `<div>` | Creates a container for an icon associated with a text input. | | |
| `.pf-v5-c-form-control__icon` | `<div>` | Creates a container for an icon associated with a form control. | |
| `.pf-m-resize-vertical` | `.pf-m-form-control` | Modifies a `pf-v5-c-form-control` element containing a text area so it can only be resized vertically. | | ||
| `.pf-m-resize-horizontal` | `.pf-m-form-control` | Modifies a `.pf-v5-c-form-control` element containing a textarea so it can only be resized horizontally. | | ||
| `.pf-m-resize-both` | `.pf-m-form-control` | Modifies a `.pf-v5-c-form-control` element containing a textarea so it resizes in both directions. | | ||
| `.pf-m-icon` | `.pf-v5-c-form-control` | Modifies a form control to allow for an icon. | | ||
| `.pf-m-readonly` | `.pf-v5-c-form-control` | Modifies a form control for a readonly input, textarea, or select.| | ||
| `.pf-m-disabled` | `.pf-v5-c-form-control` | Modifies a form control for a disabled input, textarea, or select.| |
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.
You could probably update the wording of "Modifies a .pf-v5-c-form-control
element" to "Modifies a form control" - that seems to be the wording in the other docs descriptions.
| `.pf-m-resize-vertical` | `.pf-m-form-control` | Modifies a `pf-v5-c-form-control` element containing a text area so it can only be resized vertically. | | |
| `.pf-m-resize-horizontal` | `.pf-m-form-control` | Modifies a `.pf-v5-c-form-control` element containing a textarea so it can only be resized horizontally. | | |
| `.pf-m-resize-both` | `.pf-m-form-control` | Modifies a `.pf-v5-c-form-control` element containing a textarea so it resizes in both directions. | | |
| `.pf-m-icon` | `.pf-v5-c-form-control` | Modifies a form control to allow for an icon. | | |
| `.pf-m-readonly` | `.pf-v5-c-form-control` | Modifies a form control for a readonly input, textarea, or select.| | |
| `.pf-m-disabled` | `.pf-v5-c-form-control` | Modifies a form control for a disabled input, textarea, or select.| | |
| `.pf-m-resize-vertical` | `.pf-v5-c-form-control` | Modifies a `.pf-v5-c-form-control` element containing a textarea so it can only be resized vertically. | | |
| `.pf-m-resize-horizontal` | `.pf-v5-c-form-control` | Modifies a `.pf-v5-c-form-control` element containing a textarea so it can only be resized horizontally. | | |
| `.pf-m-resize-both` | `.pf-v5-c-form-control` | Modifies a `.pf-v5-c-form-control` element containing a textarea so it resizes in both directions. | | |
| `.pf-m-icon` | `.pf-v5-c-form-control` | Modifies a form control to allow for an icon. | | |
| `.pf-m-readonly` | `.pf-v5-c-form-control` | Modifies a form control for a readonly input, textarea, or select.| | |
| `.pf-m-disabled` | `.pf-v5-c-form-control` | Modifies a form control for a disabled input, textarea, or select.| |
| `.pf-m-expanded` | `.pf-v5-c-form-control` | Modifies a form control for the expanded state. This is used when clicking in the text input toggles something open/closed. | | ||
| `.pf-m-placeholder` | `.pf-v5-c-form-control` | Modifies a form select for placeholder styles. This modifier is set programatically based on the chosen option. | | ||
| `.pf-m-plain` | `.pf-v5-c-form-control` | Modifies a form control containing an `<input>` or `<textarea>` with a `readonly` attribute to be presented as normal text. | | ||
| `.pf-m-status`| `.pf-v5-c-form-control__icon` | Modified a form control icon to show status. |
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.
| `.pf-m-status`| `.pf-v5-c-form-control__icon` | Modified a form control icon to show status. | |
| `.pf-m-status`| `.pf-v5-c-form-control__icon` | Modifies a form control icon to show status. | |
--#{$form-control}--PaddingRight: var(--#{$form-control}--m-success--PaddingRight); | ||
--#{$form-control}--PaddingBottom: var(--#{$form-control}--m-success--PaddingBottom); | ||
--#{$form-control}--BorderBottomColor: var(--#{$form-control}--m-success--BorderBottomColor); | ||
--#{$form-control}__icon--m-status--Color: var(--#{$form-control}--m-success__icon--Color); |
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.
This should be updated for the other states, too
--#{$form-control}__icon--m-status--Color: var(--#{$form-control}--m-success__icon--Color); | |
--#{$form-control}__icon--m-status--Color: var(--#{$form-control}--m-success__icon--m-status--Color); |
&.pf-m-disabled { | ||
--#{$form-control}--BackgroundColor: var(--#{$form-control}--disabled--BackgroundColor); | ||
--#{$form-control}--Color: var(--#{$form-control}--disabled--Color); | ||
--#{$form-control}__toggle-icon--Color: var(--#{$form-control}--disabled__toggle-icon--Color); |
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.
Just tagged a few here, but I think there are others that should be updated to --m-disabled
&.pf-m-disabled { | |
--#{$form-control}--BackgroundColor: var(--#{$form-control}--disabled--BackgroundColor); | |
--#{$form-control}--Color: var(--#{$form-control}--disabled--Color); | |
--#{$form-control}__toggle-icon--Color: var(--#{$form-control}--disabled__toggle-icon--Color); | |
&.pf-m-disabled { | |
--#{$form-control}--BackgroundColor: var(--#{$form-control}--m-disabled--BackgroundColor); | |
--#{$form-control}--Color: var(--#{$form-control}--m-disabled--Color); | |
--#{$form-control}__toggle-icon--Color: var(--#{$form-control}--m-disabled__toggle-icon--Color); |
4455d9b
to
0dca624
Compare
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.
LPTM 👍
{{#ifAny form-control--HasIcon form-control--IsError form-control--IsSuccess form-control--IsWarning }} | ||
{{> form-control-template-status}} | ||
{{/ifAny}} |
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.
👍👍👍
{{/if}} | ||
>{{#if @partial-block}}{{> @partial-block}}{{/if}}</select> | ||
{{#> form-control-utilities}} | ||
{{#ifAny form-control--HasIcon form-control--IsError form-control--IsSuccess form-control--IsWarning }} |
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.
{{#ifAny form-control--HasIcon form-control--IsError form-control--IsSuccess form-control--IsWarning }} | |
{{#ifAny form-control--HasIcon form-control--IsError form-control--IsSuccess form-control--IsWarning}} |
@@ -0,0 +1,7 @@ | |||
{{#if form-control--IsSuccess}} | |||
{{> form-control-icon form-control-icon--IsStatus="true" form-control--HasIcon="check-circle"}} |
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.
Nit: any bool
value doesn't need quotation marks. I know that's inconsistent with most other components, but I'd like to move toward that. And I think we can start when making updates.
Second Nit: As our .hbs
functions library grows and our components become more sophisticated, our string values may need to contain double quotes. Example being that we are starting to allow components and/or partials to pass text parameters. component--text='Hello'
Can we use single quotes ''
as a standard for string values?
Wdty @mcoker
{{> form-control-icon form-control-icon--IsStatus="true" form-control--HasIcon="check-circle"}} | |
{{> form-control-icon form-control-icon--IsStatus=true form-control--HasIcon='check-circle'}} |
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.
@mattnolting that all sounds good to me, with the work you've done looking at how our templates can improve, maybe we can meet and go over your suggestions and make changes like this and and make sure it's documented?
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.
A couple of things that need updated, but it's all CSS so we can merge and follow up later if you'd prefer.
| `.pf-v5-c-form-control__toggle-icon` | `<div>` | Initiates a toggle icon for a form select. | | ||
| `.pf-m-resize-vertical` | `.pf-m-form-control` | Modifies a `pf-v5-c-form-control` element containing a text area so it can only be resized vertically. | | ||
| `.pf-m-resize-horizontal` | `.pf-m-form-control` | Modifies a `.pf-v5-c-form-control` element containing a textarea so it can only be resized horizontally. | | ||
| `.pf-m-resize-vertical` | `.pf-m-form-control` | Modifies a form control element containing a text area so it can only be resized vertically. | |
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.
| `.pf-m-resize-vertical` | `.pf-m-form-control` | Modifies a form control element containing a text area so it can only be resized vertically. | | |
| `.pf-m-resize-vertical` | `.pf-m-form-control` | Modifies a form control element containing a textarea so it can only be resized vertically. | |
| `.pf-v5-c-form-control__toggle-icon` | `<div>` | Initiates a toggle icon for a form select. | | ||
| `.pf-m-resize-vertical` | `.pf-m-form-control` | Modifies a `pf-v5-c-form-control` element containing a text area so it can only be resized vertically. | | ||
| `.pf-m-resize-horizontal` | `.pf-m-form-control` | Modifies a `.pf-v5-c-form-control` element containing a textarea so it can only be resized horizontally. | | ||
| `.pf-m-resize-vertical` | `.pf-m-form-control` | Modifies a form control element containing a text area so it can only be resized vertically. | |
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.
| `.pf-m-resize-vertical` | `.pf-m-form-control` | Modifies a form control element containing a text area so it can only be resized vertically. | | |
| `.pf-m-resize-vertical` | `.pf-v5-c-form-control` | Modifies a form control element containing a textarea so it can only be resized vertically. | |
| `.pf-v5-c-form-control__utilities` | `<div>` | Initiates a container for elements like icons to be associated with the form control. | | ||
| `.pf-v5-c-form-control__icon` | `<div>` | Creates a container for an icon associated with a form control. | | ||
| `.pf-v5-c-form-control__toggle-icon` | `<div>` | Initiates a toggle icon for a form select. | | ||
| `.pf-m-resize-vertical` | `.pf-v5-c-form-control` | Modifies a form control element containing a text area so it can only be resized vertically. | |
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.
| `.pf-m-resize-vertical` | `.pf-v5-c-form-control` | Modifies a form control element containing a text area so it can only be resized vertically. | | |
| `.pf-m-resize-vertical` | `.pf-v5-c-form-control` | Modifies a form control element containing a textarea so it can only be resized vertically. | |
| `.pf-v5-c-form-control__utilities` | `<div>` | Initiates a container for elements like icons to be associated with the form control. | | ||
| `.pf-v5-c-form-control__icon` | `<div>` | Creates a container for an icon associated with a form control. | | ||
| `.pf-v5-c-form-control__toggle-icon` | `<div>` | Initiates a toggle icon for a form select. | | ||
| `.pf-m-resize-vertical` | `.pf-v5-c-form-control` | Modifies a form control element containing a text area so it can only be resized vertically. | |
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.
| `.pf-m-resize-vertical` | `.pf-v5-c-form-control` | Modifies a form control element containing a text area so it can only be resized vertically. | | |
| `.pf-m-resize-vertical` | `.pf-v5-c-form-control` | Modifies a form control element containing a textarea so it can only be resized vertically. | |
| `.pf-v5-c-form-control` | `<input>`,`<textarea>`, `<select>` | Initiates an input, textarea or select. For styling of checkboxes or radios see the [checkbox component](/components/checkbox) or [radio component](/components/radio). **Required** | | ||
| `.pf-m-resize-vertical` | `textarea.pf-m-form-control` | Modifies a `textarea.pf-v5-c-form-control` element so it can only be resized vertically along the y-axis. | | ||
| `.pf-m-resize-horizontal` | `textarea.pf-m-form-control` | Modifies a `textarea.pf-v5-c-form-control` element so it can only be resized horizontally along the x-axis. | | ||
| `.pf-v5-c-form-control` | `<div>` | Initiates a container for an input, text area or select. For styling of checkboxes or radios see the [checkbox component](/components/checkbox) or [radio component](/components/radio). **Required** | |
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.
| `.pf-v5-c-form-control` | `<div>` | Initiates a container for an input, text area or select. For styling of checkboxes or radios see the [checkbox component](/components/checkbox) or [radio component](/components/radio). **Required** | | |
| `.pf-v5-c-form-control` | `<div>` | Initiates a container for an input, textarea, or select. For styling of checkboxes or radios see the [checkbox component](/components/checkbox) or [radio component](/components/radio). **Required** | |
--#{$form-control}--disabled--Color: var(--#{$pf-global}--disabled-color--100); | ||
--#{$form-control}--disabled--BackgroundColor: var(--#{$pf-global}--disabled-color--300); | ||
--#{$form-control}--disabled--BorderColor: transparent; | ||
--#{$form-control}--m-disabled--Color: var(--#{$pf-global}--m-disabled-color--100); |
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.
The global vars need the m-
removed, since that will break the styling.
--#{$form-control}--m-disabled--Color: var(--#{$pf-global}--m-disabled-color--100); | |
--#{$form-control}--m-disabled--Color: var(--#{$pf-global}--disabled-color--100); |
position: relative; | ||
display: grid; | ||
grid-template-columns: 1fr auto; | ||
column-gap: var(--#{$form-control}--ColumnGap); |
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.
Not sure if you saw this. Is the gap used anywhere?
background-image: var(--#{$form-control}__select--BackgroundUrl), var(--#{$form-control}--invalid--BackgroundUrl); | ||
background-position: var(--#{$form-control}__select--BackgroundPosition), var(--#{$form-control}--invalid--BackgroundPosition); | ||
background-size: var(--#{$form-control}__select--BackgroundSize), var(--#{$form-control}--invalid--BackgroundSize); | ||
.pf-m-error { |
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.
background-position: var(--#{$form-control}__select--BackgroundPosition), var(--#{$form-control}--invalid--BackgroundPosition); | ||
background-size: var(--#{$form-control}__select--BackgroundSize), var(--#{$form-control}--invalid--BackgroundSize); | ||
.pf-m-error { | ||
--#{$form-control}--PaddingRight: var(--#{$form-control}--select--m-error--PaddingRight); |
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.
These vars need --m-[status]
after the base form control class in the name.
--#{$form-control}--PaddingRight: var(--#{$form-control}--select--m-error--PaddingRight); | |
--#{$form-control}--PaddingRight: var(--#{$form-control}--m-error--select--PaddingRight); |
{{{form-control-icon--attribute}}} | ||
{{/if}}> | ||
<i class="fas fa-{{form-control--HasIcon}}" aria-hidden="true"></i> | ||
</div> |
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.
Just want to make sure you saw this, this file is missing a new line at EOF
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.
A couple of things that need updated, but it's all CSS so we can merge and follow up later if you'd prefer.
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.
🚀
🎉 This PR is included in version 5.0.0-alpha.54 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #5469 #4900 #2702
Note: examples using form control still need to be updated
This changes from using a background image on a form control to using a wrapper around the form control with associated utility container for icon, status icons, and toggle icon.
note: There is some existing code for placeholder text color that doesn't seem to quite work right and the existing feature is not quite as I'd expect so I'd like to discuss @mcoker