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(chip, label): Add wrappers for content and actions to manage styling embedded components #5360
Conversation
Preview: https://patternfly-pr-5360.surge.sh A11y report: https://patternfly-pr-5360-a11y.surge.sh |
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-c-chip-actions__c-button--PaddingTop: var(--pf-global--spacer--xs); | ||
--pf-c-chip-actions__c-button--PaddingRight: var(--pf-global--spacer--sm); | ||
--pf-c-chip-actions__c-button--PaddingBottom: var(--pf-global--spacer--xs); | ||
--pf-c-chip-actions__c-button--PaddingLeft: var(--pf-global--spacer--sm); | ||
--pf-c-chip-actions__c-button--MarginTop: calc(var(--pf-c-chip--PaddingTop) * -1); | ||
--pf-c-chip-actions__c-button--MarginRight: calc(var(--pf-c-chip--PaddingRight) / 2 * -1); | ||
--pf-c-chip-actions__c-button--MarginBottom: calc(var(--pf-c-chip--PaddingBottom) * -1); | ||
--pf-c-chip-actions__c-button--FontSize: var(--pf-global--FontSize--xs); |
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-c-chip-actions__c-button--PaddingTop: var(--pf-global--spacer--xs); | |
--pf-c-chip-actions__c-button--PaddingRight: var(--pf-global--spacer--sm); | |
--pf-c-chip-actions__c-button--PaddingBottom: var(--pf-global--spacer--xs); | |
--pf-c-chip-actions__c-button--PaddingLeft: var(--pf-global--spacer--sm); | |
--pf-c-chip-actions__c-button--MarginTop: calc(var(--pf-c-chip--PaddingTop) * -1); | |
--pf-c-chip-actions__c-button--MarginRight: calc(var(--pf-c-chip--PaddingRight) / 2 * -1); | |
--pf-c-chip-actions__c-button--MarginBottom: calc(var(--pf-c-chip--PaddingBottom) * -1); | |
--pf-c-chip-actions__c-button--FontSize: var(--pf-global--FontSize--xs); | |
--pf-c-chip-actions--c-button--PaddingTop: var(--pf-global--spacer--xs); | |
--pf-c-chip-actions--c-button--PaddingRight: var(--pf-global--spacer--sm); | |
--pf-c-chip-actions--c-button--PaddingBottom: var(--pf-global--spacer--xs); | |
--pf-c-chip-actions--c-button--PaddingLeft: var(--pf-global--spacer--sm); | |
--pf-c-chip-actions--c-button--MarginTop: calc(var(--pf-c-chip--PaddingTop) * -1); | |
--pf-c-chip-actions--c-button--MarginRight: calc(var(--pf-c-chip--PaddingRight) / 2 * -1); | |
--pf-c-chip-actions--c-button--MarginBottom: calc(var(--pf-c-chip--PaddingBottom) * -1); | |
--pf-c-chip-actions--c-button--FontSize: var(--pf-global--FontSize--xs); |
--pf-c-button--PaddingTop: var(--pf-c-chip-actions__c-button--PaddingTop); | ||
--pf-c-button--PaddingRight: var(--pf-c-chip-actions__c-button--PaddingRight); | ||
--pf-c-button--PaddingBottom: var(--pf-c-chip-actions__c-button--PaddingBottom); | ||
--pf-c-button--PaddingLeft: var(--pf-c-chip-actions__c-button--PaddingLeft); | ||
--pf-c-button--FontSize: var(--pf-c-chip-actions__c-button--FontSize); | ||
|
||
margin-top: var(--pf-c-chip-actions__c-button--MarginTop); | ||
margin-right: var(--pf-c-chip-actions__c-button--MarginRight); | ||
margin-bottom: var(--pf-c-chip-actions__c-button--MarginBottom); |
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-c-button--PaddingTop: var(--pf-c-chip-actions__c-button--PaddingTop); | |
--pf-c-button--PaddingRight: var(--pf-c-chip-actions__c-button--PaddingRight); | |
--pf-c-button--PaddingBottom: var(--pf-c-chip-actions__c-button--PaddingBottom); | |
--pf-c-button--PaddingLeft: var(--pf-c-chip-actions__c-button--PaddingLeft); | |
--pf-c-button--FontSize: var(--pf-c-chip-actions__c-button--FontSize); | |
margin-top: var(--pf-c-chip-actions__c-button--MarginTop); | |
margin-right: var(--pf-c-chip-actions__c-button--MarginRight); | |
margin-bottom: var(--pf-c-chip-actions__c-button--MarginBottom); | |
--pf-c-button--PaddingTop: var(--pf-c-chip-actions--c-button--PaddingTop); | |
--pf-c-button--PaddingRight: var(--pf-c-chip-actions--c-button--PaddingRight); | |
--pf-c-button--PaddingBottom: var(--pf-c-chip-actions--c-button--PaddingBottom); | |
--pf-c-button--PaddingLeft: var(--pf-c-chip-actions--c-button--PaddingLeft); | |
--pf-c-button--FontSize: var(--pf-c-chip-actions--c-button--FontSize); | |
margin-top: var(--pf-c-chip-actions--c-button--MarginTop); | |
margin-right: var(--pf-c-chip-actions--c-button--MarginRight); | |
margin-bottom: var(--pf-c-chip-actions--c-button--MarginBottom); |
| `.pf-c-label__icon` | `<span>` | Initiates a label icon. | | ||
| `.pf-c-label__text` | `<span>` | Initiates label text. | | ||
| `.pf-c-label__editable-text` | `<button>`, `<input>` | Initiates editable label text. See the [editable](#editable) example for details about handling behavior in Javascript.| | ||
| `.pf-c-label__actions` | `<div>` | Creates a wrapper for label actions. **Required for removeable labels** | |
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-c-label__actions` | `<div>` | Creates a wrapper for label actions. **Required for removeable labels** | | |
| `.pf-c-label__actions` | `<span>` | Creates a wrapper for label actions. **Required for removable labels** | |
--pf-c-label-actions__c-button--FontSize: var(--pf-global--FontSize--xs); | ||
--pf-c-label-actions__c-button--MarginTop: calc(var(--pf-global--spacer--form-element) * -1); | ||
--pf-c-label-actions__c-button--MarginRight: calc(var(--pf-global--spacer--form-element) * -1); | ||
--pf-c-label-actions__c-button--MarginBottom: calc(var(--pf-global--spacer--form-element) * -1); | ||
--pf-c-label-actions__c-button--PaddingTop: var(--pf-global--spacer--xs); | ||
--pf-c-label-actions__c-button--PaddingRight: var(--pf-global--spacer--sm); | ||
--pf-c-label-actions__c-button--PaddingBottom: var(--pf-global--spacer--xs); | ||
--pf-c-label-actions__c-button--PaddingLeft: var(--pf-global--spacer--sm); |
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-c-label-actions__c-button--FontSize: var(--pf-global--FontSize--xs); | |
--pf-c-label-actions__c-button--MarginTop: calc(var(--pf-global--spacer--form-element) * -1); | |
--pf-c-label-actions__c-button--MarginRight: calc(var(--pf-global--spacer--form-element) * -1); | |
--pf-c-label-actions__c-button--MarginBottom: calc(var(--pf-global--spacer--form-element) * -1); | |
--pf-c-label-actions__c-button--PaddingTop: var(--pf-global--spacer--xs); | |
--pf-c-label-actions__c-button--PaddingRight: var(--pf-global--spacer--sm); | |
--pf-c-label-actions__c-button--PaddingBottom: var(--pf-global--spacer--xs); | |
--pf-c-label-actions__c-button--PaddingLeft: var(--pf-global--spacer--sm); | |
--pf-c-label-actions--c-button--FontSize: var(--pf-global--FontSize--xs); | |
--pf-c-label-actions--c-button--MarginTop: calc(var(--pf-global--spacer--form-element) * -1); | |
--pf-c-label-actions--c-button--MarginRight: calc(var(--pf-global--spacer--form-element) * -1); | |
--pf-c-label-actions--c-button--MarginBottom: calc(var(--pf-global--spacer--form-element) * -1); | |
--pf-c-label-actions--c-button--PaddingTop: var(--pf-global--spacer--xs); | |
--pf-c-label-actions--c-button--PaddingRight: var(--pf-global--spacer--sm); | |
--pf-c-label-actions--c-button--PaddingBottom: var(--pf-global--spacer--xs); | |
--pf-c-label-actions--c-button--PaddingLeft: var(--pf-global--spacer--sm); |
margin-top: var(--pf-c-chip__c-button--MarginTop); | ||
margin-right: var(--pf-c-chip__c-button--MarginRight); | ||
margin-bottom: var(--pf-c-chip__c-button--MarginBottom); | ||
.pf-c-chip__content { |
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.
can this be un-nested from the .pf-c-chip
parent container? It's creating extra specificity.
font-size: var(--pf-c-chip__content--FontSize); | ||
} | ||
|
||
.pf-c-chip__actions { |
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.
can this be un-nested from the .pf-c-chip
parent container? It's creating extra specificity.
.pf-c-badge { | ||
margin-left: var(--pf-c-chip__c-badge--MarginLeft); | ||
// Actions Button | ||
.pf-c-chip__actions .pf-c-button { |
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.
Can you nest this as .pf-c-button { ... }
under the existing .pf-c-chip__actions
selector?
--pf-c-button--FontSize: var(--pf-c-label-actions__c-button--FontSize); | ||
--pf-c-button--PaddingTop: var(--pf-c-label-actions__c-button--PaddingTop); | ||
--pf-c-button--PaddingRight: var(--pf-c-label-actions__c-button--PaddingRight); | ||
--pf-c-button--PaddingBottom: var(--pf-c-label-actions__c-button--PaddingBottom); | ||
--pf-c-button--PaddingLeft: var(--pf-c-label-actions__c-button--PaddingLeft); | ||
|
||
margin-top: var(--pf-c-label-actions__c-button--MarginTop); | ||
margin-right: var(--pf-c-label-actions__c-button--MarginRight); | ||
margin-bottom: var(--pf-c-label-actions__c-button--MarginBottom); |
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-c-button--FontSize: var(--pf-c-label-actions__c-button--FontSize); | |
--pf-c-button--PaddingTop: var(--pf-c-label-actions__c-button--PaddingTop); | |
--pf-c-button--PaddingRight: var(--pf-c-label-actions__c-button--PaddingRight); | |
--pf-c-button--PaddingBottom: var(--pf-c-label-actions__c-button--PaddingBottom); | |
--pf-c-button--PaddingLeft: var(--pf-c-label-actions__c-button--PaddingLeft); | |
margin-top: var(--pf-c-label-actions__c-button--MarginTop); | |
margin-right: var(--pf-c-label-actions__c-button--MarginRight); | |
margin-bottom: var(--pf-c-label-actions__c-button--MarginBottom); | |
--pf-c-button--FontSize: var(--pf-c-label-actions--c-button--FontSize); | |
--pf-c-button--PaddingTop: var(--pf-c-label-actions--c-button--PaddingTop); | |
--pf-c-button--PaddingRight: var(--pf-c-label-actions--c-button--PaddingRight); | |
--pf-c-button--PaddingBottom: var(--pf-c-label-actions--c-button--PaddingBottom); | |
--pf-c-button--PaddingLeft: var(--pf-c-label-actions--c-button--PaddingLeft); | |
margin-top: var(--pf-c-label-actions--c-button--MarginTop); | |
margin-right: var(--pf-c-label-actions--c-button--MarginRight); | |
margin-bottom: var(--pf-c-label-actions--c-button--MarginBottom); |
margin-right: var(--pf-c-label__c-button--MarginRight); | ||
margin-bottom: var(--pf-c-label__c-button--MarginBottom); | ||
margin-left: var(--pf-c-label__c-button--MarginLeft); | ||
.pf-c-label__actions { |
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.
can this be moved out of the parent .pf-c-label
selector?
font-size: var(--pf-c-label__actions--FontSize); | ||
} | ||
|
||
.pf-c-label__actions .pf-c-button { |
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.
can you nest this as .pf-c-button { ... }
under .pf-c-label__actions
?
{{{chip-content--attribute}}} | ||
{{/if}}> | ||
{{> @partial-block}} | ||
</span> |
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.
Can you add a newline at the end of the file?
| `.pf-c-label__icon` | `<span>` | Initiates a label icon. | | ||
| `.pf-c-label__text` | `<span>` | Initiates label text. | | ||
| `.pf-c-label__editable-text` | `<button>`, `<input>` | Initiates editable label text. See the [editable](#editable) example for details about handling behavior in Javascript.| | ||
| `.pf-c-label__actions` | `<div>` | Creates a wrapper for label actions. **Required for removable labels** | |
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-c-label__actions` | `<div>` | Creates a wrapper for label actions. **Required for removable labels** | | |
| `.pf-c-label__actions` | `<span>` | Creates a wrapper for label actions. **Required for removable labels** | |
--pf-c-chip-actions--c-button--PaddingTop: var(--pf-global--spacer--xs); | ||
--pf-c-chip-actions--c-button--PaddingRight: var(--pf-global--spacer--sm); | ||
--pf-c-chip-actions--c-button--PaddingBottom: var(--pf-global--spacer--xs); | ||
--pf-c-chip-actions--c-button--PaddingLeft: var(--pf-global--spacer--sm); | ||
--pf-c-chip-actions--c-button--MarginTop: calc(var(--pf-c-chip--PaddingTop) * -1); | ||
--pf-c-chip-actions--c-button--MarginRight: calc(var(--pf-c-chip--PaddingRight) / 2 * -1); | ||
--pf-c-chip-actions--c-button--MarginBottom: calc(var(--pf-c-chip--PaddingBottom) * -1); | ||
--pf-c-chip-actions--c-button--FontSize: var(--pf-global--FontSize--xs); |
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-c-chip-actions--c-button--PaddingTop: var(--pf-global--spacer--xs); | |
--pf-c-chip-actions--c-button--PaddingRight: var(--pf-global--spacer--sm); | |
--pf-c-chip-actions--c-button--PaddingBottom: var(--pf-global--spacer--xs); | |
--pf-c-chip-actions--c-button--PaddingLeft: var(--pf-global--spacer--sm); | |
--pf-c-chip-actions--c-button--MarginTop: calc(var(--pf-c-chip--PaddingTop) * -1); | |
--pf-c-chip-actions--c-button--MarginRight: calc(var(--pf-c-chip--PaddingRight) / 2 * -1); | |
--pf-c-chip-actions--c-button--MarginBottom: calc(var(--pf-c-chip--PaddingBottom) * -1); | |
--pf-c-chip-actions--c-button--FontSize: var(--pf-global--FontSize--xs); | |
--pf-c-chip__actions--c-button--PaddingTop: var(--pf-global--spacer--xs); | |
--pf-c-chip__actions--c-button--PaddingRight: var(--pf-global--spacer--sm); | |
--pf-c-chip__actions--c-button--PaddingBottom: var(--pf-global--spacer--xs); | |
--pf-c-chip__actions--c-button--PaddingLeft: var(--pf-global--spacer--sm); | |
--pf-c-chip__actions--c-button--MarginTop: calc(var(--pf-c-chip--PaddingTop) * -1); | |
--pf-c-chip__actions--c-button--MarginRight: calc(var(--pf-c-chip--PaddingRight) / 2 * -1); | |
--pf-c-chip__actions--c-button--MarginBottom: calc(var(--pf-c-chip--PaddingBottom) * -1); | |
--pf-c-chip__actions--c-button--FontSize: var(--pf-global--FontSize--xs); |
--pf-c-button--PaddingTop: var(--pf-c-chip-actions--c-button--PaddingTop); | ||
--pf-c-button--PaddingRight: var(--pf-c-chip-actions--c-button--PaddingRight); | ||
--pf-c-button--PaddingBottom: var(--pf-c-chip-actions--c-button--PaddingBottom); | ||
--pf-c-button--PaddingLeft: var(--pf-c-chip-actions--c-button--PaddingLeft); | ||
--pf-c-button--FontSize: var(--pf-c-chip-actions--c-button--FontSize); | ||
|
||
margin-top: var(--pf-c-chip-actions--c-button--MarginTop); | ||
margin-right: var(--pf-c-chip-actions--c-button--MarginRight); | ||
margin-bottom: var(--pf-c-chip-actions--c-button--MarginBottom); |
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-c-button--PaddingTop: var(--pf-c-chip-actions--c-button--PaddingTop); | |
--pf-c-button--PaddingRight: var(--pf-c-chip-actions--c-button--PaddingRight); | |
--pf-c-button--PaddingBottom: var(--pf-c-chip-actions--c-button--PaddingBottom); | |
--pf-c-button--PaddingLeft: var(--pf-c-chip-actions--c-button--PaddingLeft); | |
--pf-c-button--FontSize: var(--pf-c-chip-actions--c-button--FontSize); | |
margin-top: var(--pf-c-chip-actions--c-button--MarginTop); | |
margin-right: var(--pf-c-chip-actions--c-button--MarginRight); | |
margin-bottom: var(--pf-c-chip-actions--c-button--MarginBottom); | |
--pf-c-button--PaddingTop: var(--pf-c-chip__actions--c-button--PaddingTop); | |
--pf-c-button--PaddingRight: var(--pf-c-chip__actions--c-button--PaddingRight); | |
--pf-c-button--PaddingBottom: var(--pf-c-chip__actions--c-button--PaddingBottom); | |
--pf-c-button--PaddingLeft: var(--pf-c-chip__actions--c-button--PaddingLeft); | |
--pf-c-button--FontSize: var(--pf-c-chip__actions--c-button--FontSize); | |
margin-top: var(--pf-c-chip__actions--c-button--MarginTop); | |
margin-right: var(--pf-c-chip__actions--c-button--MarginRight); | |
margin-bottom: var(--pf-c-chip__actions--c-button--MarginBottom); |
--pf-c-label-actions--MarginRight: calc(var(--pf-global--spacer--form-element) * -1); | ||
|
||
// Actions button (close) | ||
--pf-c-label-actions--c-button--FontSize: var(--pf-global--FontSize--xs); | ||
--pf-c-label-actions--c-button--MarginTop: calc(var(--pf-global--spacer--form-element) * -1); | ||
--pf-c-label-actions--c-button--MarginBottom: calc(var(--pf-global--spacer--form-element) * -1); | ||
--pf-c-label-actions--c-button--PaddingTop: var(--pf-global--spacer--xs); | ||
--pf-c-label-actions--c-button--PaddingRight: var(--pf-global--spacer--sm); | ||
--pf-c-label-actions--c-button--PaddingBottom: var(--pf-global--spacer--xs); | ||
--pf-c-label-actions--c-button--PaddingLeft: var(--pf-global--spacer--sm); |
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.
While the margin-right looks ok visually, it's kind of an arbitrary choice in spacer as far as I can tell. It looks like the margins that reference the form-element spacer may just be out of date?
If we want to keep that same visual spacing, I think this formula for that negative margin works better and would scale well? Seems to scale as long as the action's right padding is greater than the right padding of the label.
--pf-c-label-actions--MarginRight: calc(var(--pf-global--spacer--form-element) * -1); | |
// Actions button (close) | |
--pf-c-label-actions--c-button--FontSize: var(--pf-global--FontSize--xs); | |
--pf-c-label-actions--c-button--MarginTop: calc(var(--pf-global--spacer--form-element) * -1); | |
--pf-c-label-actions--c-button--MarginBottom: calc(var(--pf-global--spacer--form-element) * -1); | |
--pf-c-label-actions--c-button--PaddingTop: var(--pf-global--spacer--xs); | |
--pf-c-label-actions--c-button--PaddingRight: var(--pf-global--spacer--sm); | |
--pf-c-label-actions--c-button--PaddingBottom: var(--pf-global--spacer--xs); | |
--pf-c-label-actions--c-button--PaddingLeft: var(--pf-global--spacer--sm); | |
--pf-c-label__actions--MarginRight: calc(var(--pf-c-label-actions--c-button--PaddingRight) * -1 + var(--pf-c-label--PaddingRight) / 2); | |
// Actions button (close) | |
--pf-c-label__actions--c-button--FontSize: var(--pf-global--FontSize--xs); | |
--pf-c-label__actions--c-button--MarginTop: calc(var(--pf-c-label__actions--c-button--PaddingTop) * -1); | |
--pf-c-label__actions--c-button--MarginBottom: calc(var(--pf-c-label__actions--c-button--PaddingBottom) * -1); | |
--pf-c-label__actions--c-button--PaddingTop: var(--pf-global--spacer--xs); | |
--pf-c-label__actions--c-button--PaddingRight: var(--pf-global--spacer--sm); | |
--pf-c-label__actions--c-button--PaddingBottom: var(--pf-global--spacer--xs); | |
--pf-c-label__actions--c-button--PaddingLeft: var(--pf-global--spacer--sm); |
Just a side note on that margin, ideally I think it could be setup like the label icon instead where the icon touches the start of the label's padding, regardless the size or padding or whatever. I think to do that, the actions margin-right would just be calc(var(--pf-c-label-actions--c-button--PaddingRight) * -1)
, but that ends up looking a little tight on the spacing, so we could add .fa-fw
to the close icons - that class also exists on the label icon. But that would need to be tested in react, too, to make sure it displays correctly.
margin-right: var(--pf-c-label-actions--MarginRight); | ||
font-size: var(--pf-c-label__actions--FontSize); | ||
|
||
& .pf-c-button { |
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-c-button { | |
.pf-c-button { |
font-size: var(--pf-c-chip__actions--FontSize); | ||
|
||
// Actions Button | ||
& .pf-c-button { |
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-c-button { | |
.pf-c-button { |
margin-top: var(--pf-c-label-actions--c-button--MarginTop); | ||
margin-bottom: var(--pf-c-label-actions--c-button--MarginBottom); |
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.
do you think it's beneficial to keep these on the button? I'm thinking whatever actions we have in here will all have the same padding, so it might be easier just to put it on the actions container?
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 the padding is on the button (and it needs to be for the clickable area) I think it's best to keep the negative margin on the same element.
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 comments, but looks like there are a lot of other places chips are used that need to be updated. An alternative could be to make chip.hbs
more intelligent like label.hbs
so it includes everything needed and can take a chip--id
that adds the id
and aria-label
stuff automatically.
cmichael-mac:patternfly cmichael$ grep -ri '{{#> chip \|{{#> chip}}' src/patternfly/
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip}}
src/patternfly//components/TextInputGroup/text-input-group--chip-group.hbs: {{#> chip chip--type="button" chip--modifier="pf-m-overflow"}}
# src/patternfly//components/Chip/examples/Chip.md:{{#> chip chip--type="div"}}
# src/patternfly//components/Chip/examples/Chip.md:{{#> chip chip--type="div"}}
# src/patternfly//components/Chip/examples/Chip.md:{{#> chip chip--type="div"}}
# src/patternfly//components/Chip/examples/Chip.md:{{#> chip chip--type="div"}}
# src/patternfly//components/Chip/examples/Chip.md:{{#> chip chip--type="button" chip--modifier="pf-m-overflow"}}
# src/patternfly//components/Chip/examples/Chip.md:{{#> chip chip--type="div" chip--modifier="pf-m-draggable"}}
src/patternfly//components/Toolbar/toolbar-item-chip-group.hbs: {{#> chip}}
src/patternfly//components/Toolbar/toolbar-item-chip-group.hbs: {{#> chip}}
src/patternfly//components/Toolbar/toolbar-item-chip-group.hbs: {{#> chip}}
src/patternfly//components/InlineEdit/examples/InlineEdit.md: {{#> chip chip--type="div" chip--modifier="pf-m-read-only"}}
src/patternfly//components/Select/select-chip-group-collapsed.hbs: {{#> chip}}
src/patternfly//components/Select/select-chip-group-collapsed.hbs: {{#> chip}}
src/patternfly//components/Select/select-chip-group-collapsed.hbs: {{#> chip}}
src/patternfly//components/Select/select-chip-group-collapsed.hbs: {{#> chip chip--type="button" chip--modifier="pf-m-overflow"}}
src/patternfly//components/Select/select-chip-group-expanded.hbs: {{#> chip}}
src/patternfly//components/Select/select-chip-group-expanded.hbs: {{#> chip}}
src/patternfly//components/Select/select-chip-group-expanded.hbs: {{#> chip}}
src/patternfly//components/Select/select-chip-group-expanded.hbs: {{#> chip}}
src/patternfly//components/Select/select-chip-group-expanded.hbs: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip chip--type="button" chip--modifier="pf-m-overflow"}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip chip--type="button" chip--modifier="pf-m-overflow"}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip chip--type="button" chip--modifier="pf-m-overflow"}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip chip--type="button" chip--modifier="pf-m-overflow"}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//components/ChipGroup/examples/ChipGroup.md: {{#> chip}}
src/patternfly//demos/DescriptionList/examples/DescriptionList.md: {{#> chip}}
src/patternfly//demos/Toolbar/examples/Toolbar.md: {{#> chip}}
src/patternfly//demos/Toolbar/examples/Toolbar.md: {{#> chip}}
src/patternfly//demos/Toolbar/examples/Toolbar.md: {{#> chip}}
src/patternfly//demos/Toolbar/examples/Toolbar.md: {{#> chip}}
src/patternfly//demos/Toolbar/examples/Toolbar.md: {{#> chip}}
src/patternfly//demos/Toolbar/examples/Toolbar.md: {{#> chip}}
| `.pf-c-button` | `.pf-c-chip__actions <button>` | Initiates the button used to remove the chip. | | ||
| `.pf-c-badge` | `.pf-c-chip__content <span>` | Initiates the badge inside the chip. | |
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 AFAIK we've moved away from calling other components out in the docs like this, I don't think we need to include them.
| `.pf-c-label__icon` | `<span>` | Initiates a label icon. | | ||
| `.pf-c-label__text` | `<span>` | Initiates label text. | | ||
| `.pf-c-label__editable-text` | `<button>`, `<input>` | Initiates editable label text. See the [editable](#editable) example for details about handling behavior in Javascript.| | ||
| `.pf-c-label__actions` | `<span>` | Creates a wrapper for label actions. **Required for removable labels** | | ||
| `.pf-c-button` | `.pf-c-label__actions <button>` | Initiates the button used to remove the label. | |
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.
same here, I don't think we need this.
{{/chip-text}} | ||
{{/chip-content}} | ||
{{#> chip-actions}} | ||
{{#> button button--modifier="pf-m-plain pf-m-small" button--attribute='aria-labelledby="remove_chip_one chip_one" aria-label="Remove" id="remove_chip_one"'}} |
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.
do you need .pf-m-small
on this one? I don't see it on any others.
{{#> button button--modifier="pf-m-plain pf-m-small" button--attribute='aria-labelledby="remove_chip_one chip_one" aria-label="Remove" id="remove_chip_one"'}} | |
{{#> button button--modifier="pf-m-plain" button--attribute='aria-labelledby="remove_chip_one chip_one" aria-label="Remove" id="remove_chip_one"'}} |
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.
LGTM! Just a few nits.
| `.pf-c-chip__content` | `<span>` | Creates a content wrapper for the chip. **Required** | | ||
| `.pf-c-chip__text` | `<span>` | Initiates the text inside the chip. **Required** | | ||
| `.pf-c-chip__icon` | `<span>` | Initiates the icon inside the chip. | | ||
| `.pf-c-chip__actions` | `<span>` | Creates a wrapper for chip actions. **Required for removeable chips** | |
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-c-chip__actions` | `<span>` | Creates a wrapper for chip actions. **Required for removeable chips** | | |
| `.pf-c-chip__actions` | `<span>` | Creates a wrapper for chip actions. **Required for removable chips** | |
{{#> chip-content}} | ||
{{#> chip-text chip-text--attribute=(concat 'id="' chip-group--id 'chip_one_select_collapsed"')}} | ||
Chip one | ||
{{/chip-text}} | ||
{{/chip-content}} | ||
{{#> chip-actions}} | ||
{{#> button button--modifier="pf-m-plain" button--attribute=(concat 'aria-labelledby="' chip-group--id 'remove_chip_one_select_collapsed ' chip-group--id 'chip_one_select_collapsed" aria-label="Remove" id="' chip-group--id 'remove_chip_one_select_collapsed"')}} | ||
<i class="fas fa-times" aria-hidden="true"></i> | ||
{{/button}} | ||
{{/chip-actions}} |
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 - looks like you've got some indentation stuff going on in a lot of blocks in this file.
{{#> button button--modifier="pf-m-plain" button--attribute=(concat 'aria-labelledby="' chip-group--id 'remove-chip-two ' chip-group--id 'chip-two" aria-label="Remove" id="' chip-group--id 'remove-chip-two"')}} | ||
<i class="fas fa-times" aria-hidden="true"></i> | ||
{{/button}} | ||
{{/chip-actions}} |
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.
indentation action in this file, too, for all of the {{/chip-actions}}
lines
🎉 This PR is included in version 5.0.0-alpha.22 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…ling embedded components (patternfly#5360)
…ling embedded components (patternfly#5360)
…ling embedded components (patternfly#5360)
Fixes #5199
This adds wrappers for content (chip only) and the close button (both chip and label) so that the styling of other components (button and badge) is unnecessary or isolated. The new wrappers are spaced using flex with a column gap.
Breaking changes:
pf-c-chip__actions
andpf-c-chip__content
--pf-c-chip__c-button--XXX
variables to be--pf-c-chip-actions__c-button--XXX
--pf-c-chip__c-badge--MarginLeft
is no longer needed and is removedpf-c-label__actions
--pf-c-label__c-button--XXX
variables to be--pf-c-label-actions__c-button--XXX