Skip to content
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

Merged
merged 12 commits into from May 15, 2023

Conversation

srambach
Copy link
Member

@srambach srambach commented May 4, 2023

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

@patternfly-build
Copy link

patternfly-build commented May 4, 2023

@srambach srambach force-pushed the 5469-move-bg-images-to-element branch from 8f8203a to f081220 Compare May 9, 2023 13:01
@srambach srambach changed the title 5469 move bg images to element feat(form-control): move background icons to element May 9, 2023
Copy link
Contributor

@mcoker mcoker left a 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 generic element 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;
Copy link
Contributor

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.

Suggested change
align-items: flex-start;
align-items: start;

height: var(--#{$form-control}--Height);

// truncate overflow text
& > *::placeholder {
Copy link
Contributor

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?

Suggested change
& > *::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"]) {
Copy link
Contributor

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.

Suggested change
&: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 {
Copy link
Contributor

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?

Suggested change
& > select {
& > select {

--#{$form-control}--m-warning--BackgroundPositionY: var(--#{$form-control}--textarea--m-warning--BackgroundPositionY);


& > textarea {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - redundant?

Suggested change
& > textarea {
> textarea {

resize: vertical;
}

&.pf-m-resize-horizontal {
&:has(textarea),
Copy link
Contributor

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?

Comment on lines 13 to 15
<div class="{{pfv}}form-control__toggle-icon">
<i class="fas fa-caret-down" aria-hidden="true"></i>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
<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}}
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

🥳

Comment on lines 348 to 349
padding-right: var(--#{$form-control}__utilities--PaddingRight);
padding-left: var(--#{$form-control}__utilities--PaddingLeft);
Copy link
Contributor

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?

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

More to come...

Comment on lines 51 to 58
// 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);
// };
Copy link
Contributor

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>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
</div>
</div>

Copy link
Contributor

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}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{/if}}
{{/if}}

Comment on lines +2 to +12
{{#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}}
Copy link
Contributor

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** |
Copy link
Contributor

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.
Copy link
Contributor

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:

Suggested change
| `.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.

Comment on lines 71 to 74
--#{$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);
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Member Author

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

Copy link
Contributor

@mcoker mcoker left a 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?

&[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. |
Copy link
Contributor

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.

Suggested change
| `.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. |

Comment on lines 179 to 184
| `.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.|
Copy link
Contributor

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.

Suggested change
| `.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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| `.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);
Copy link
Contributor

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

Suggested change
--#{$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);

Comment on lines 206 to 209
&.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);
Copy link
Contributor

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

Suggested change
&.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);

@srambach srambach force-pushed the 5469-move-bg-images-to-element branch from 4455d9b to 0dca624 Compare May 11, 2023 20:32
Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

LPTM 👍

Comment on lines 10 to 12
{{#ifAny form-control--HasIcon form-control--IsError form-control--IsSuccess form-control--IsWarning }}
{{> form-control-template-status}}
{{/ifAny}}
Copy link
Contributor

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 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{{#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"}}
Copy link
Contributor

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

Suggested change
{{> 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'}}

Copy link
Contributor

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?

Copy link
Contributor

@mcoker mcoker left a 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. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| `.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. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| `.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. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| `.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. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| `.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** |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| `.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);
Copy link
Contributor

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.

Suggested change
--#{$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);
Copy link
Contributor

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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

The select state modifiers need & - the padding is broken

Screenshot 2023-05-11 at 4 33 41 PM
Suggested change
.pf-m-error {
&.pf-m-error {

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);
Copy link
Contributor

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.

Suggested change
--#{$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>
Copy link
Contributor

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

Copy link
Contributor

@mcoker mcoker left a 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.

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

🚀

@mcoker mcoker merged commit bcd493a into patternfly:v5 May 15, 2023
1 check passed
@patternfly-build
Copy link

🎉 This PR is included in version 5.0.0-alpha.54 🎉

The release is available on:

Your semantic-release bot 📦🚀

mattnolting pushed a commit to mattnolting/patternfly that referenced this pull request May 18, 2023
mattnolting pushed a commit to mattnolting/patternfly that referenced this pull request Dec 12, 2023
@srambach srambach deleted the 5469-move-bg-images-to-element branch April 6, 2024 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants