8000 fix(alert): update title tokens by andrew-ronaldson · Pull Request #6775 · patternfly/patternfly · GitHub
[go: up one dir, main page]

Skip to content

fix(alert): update title tokens#6775

Merged
mcoker merged 13 commits intopatternfly:v6from
andrew-ronaldson:title-tokens
Jun 24, 2024
Merged

fix(alert): update title tokens#6775
mcoker merged 13 commits intopatternfly:v6from
andrew-ronaldson:title-tokens

Conversation

@andrew-ronaldson
Copy link
Collaborator
@andrew-ronaldson andrew-ronaldson commented Jun 11, 2024

fixes #6754

@patternfly-build
Copy link
Collaborator
patternfly-build commented Jun 11, 2024

Includes: notification drawer, card, hint and popover.
@andrew-ronaldson andrew-ronaldson marked this pull request as ready for review June 11, 2024 19:56
@andrew-ronaldson andrew-ronaldson requested review from lboehling, srambach and thatblindgeye and removed request for lboehling, srambach and thatblindgeye June 11, 2024 19:56
@andrew-ronaldson andrew-ronaldson marked this pull request as draft June 11, 2024 19:58
@lboehling
Copy link

lookin gooood but i'm noticing the icons are little out of alignment
image

@srambach
Copy link
Member

lookin gooood but i'm noticing the icons are little out of alignment

Yeah - there's a little adjustment on the icon that we can change. Line 32 --#{$alert}__icon--MarginBlockStart: #{pf-size-prem(4px)};

@srambach
Copy link
Member

On popover, the close button overlaps the body text a little now and the baseline of the text isn't aligned with the close button. @mcoker do you think we need a header wrapper?

2024-06-11_16-34-44.mp4

@mcoker
Copy link
Contributor
mcoker commented Jun 11, 2024

@andrew-ronaldson @lboehling looks like the popover close button is misaligned from this style failing from --pf-t--global--spacer--control--vertical--compact not being defined.

--#{$popover}__close--InsetBlockStart: calc(var(--#{$popover}__content--PaddingBlockStart) - (var(--pf-t--global--spacer--control--vertical--compact) * 1.5)); // align top of button with top of text

We can resolve it by changing the calc() to use --pf-t--global--spacer--action--vertical--plain as the offset to move the button up (by it's own top padding) - assuming that is the correct semantic token for the vertical padding on plain buttons. @lboehling can you verify that's the correct token for a plain button's top padding? Here's what the updated calc() would look like:

calc(var(--#{$popover}__content--PaddingBlockStart) - var(--pf-t--global--spacer--action--vertical--plain);

That doesn't have to happen in this PR though, if we want to get this through and follow up on that button - up to you @andrew-ronaldson

As an aside, a couple of questions from looking at this:

  • do we need to add --pf-t--global--spacer--control--vertical--compact back, or any like it?
  • I noticed we have these tokens - assuming they're still valid, should these be named --action instead of --button?
    --pf-t--global--spacer--button--vertical--compact: var(--pf-t--global--spacer--100);
    --pf-t--global--spacer--button--horizontal--compact: var(--pf-t--global--spacer--300);

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.

Left some feedback for your perusal good sir  🥸

Comment on lines +37 to +38
--#{$alert}__title--FontFamily: var(--pf-t--global--font--family--body);
--#{$alert}__title--FontSize: var(--pf-t--global--font--size--body--default);
Copy link
Contributor
@mcoker mcoker Jun 11, 2024

Choose a reason for hiding this comment

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

It's fine to have these as component vars, especially if we want to open the font-family and font-size to be themed, but technically we don't need them, since they should inherit both of these styles from the global styles. In particular, I'd say we drop --#{$alert}__title--FontFamily unless you want users to customize it. We only set the font-family to --pf-t--global--font--size--body--default in 2 other places:

  • Multiple file upload "separator" text (the word "or" here - https://patternfly-pr-6775.surge.sh/components/file-upload/multiple-file-upload#basic)
    --#{$multiple-file-upload}__title-text-separator--FontFamily: var(--pf-t--global--font--family--body);
    • That's because the word "or" is part of the title, and the title uses the --heading font-family, so we need to reset it for the "or" text.
  • Popover title text, which I'd advocate removing unless we expect the font-family to be themed. My guess as to why it's set is similar to what I'm assuming the change in this PR is. There was previously a declaration for font-family to set it to the --heading font (for v5 or pre-now), so we updated the existing token to use --body, when it could just be removed entirely since the font-family for everything will be --body by default from PF's global styles

10BC0
--#{$alert}__title--FontFamily: var(--pf-t--global--font--family--body);
--#{$alert}__title--FontSize: var(--pf-t--global--font--size--body--default);
--#{$alert}__title--FontWeight: var(--pf-t--global--font--weight--body--bold);
--#{$alert}__title--LineHeight: var(--pf-t--global--font--line-height--heading);
Copy link
Contributor

Choose a reason for hiding this comment

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

We should remove this line-height--heading var if we don't expect users to theme the font-family. It was only there before because we always declare line-height use line-height--heading any time we use the font--family--heading token. PF global styles set line-height--body on everything by default.

Comment on lines 16 to 19
--#{$hint}__title--FontFamily: var(--pf-t--global--font--family--body);
--#{$hint}__title--FontSize: var(--pf-t--global--font--size--body--default);
--#{$hint}__title--FontWeight: var(--pf-t--global--font--weight--body--bold);
--#{$hint}__title--LineHeight: var(--pf-t--global--font--line-height--heading);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here about removing font-family and line-height unless we expect users to theme the font-family for hint titles. We can also technically remove --#{$hint}__title--FontSize: var(--pf-t--global--font--size--body--default); since the component will inherit the default body font-size from our global styles, though it's totally fine to leave it if we expect users to theme the font-size, which seems totally fair.

Comment on lines 65 to 68
--#{$notification-drawer}__list-item-header-title--FontFamily: var(--pf-t--global--font--family--body);
--#{$notification-drawer}__list-item-header-title--FontSize: var(--pf-t--global--font--size--body--default);
--#{$notification-drawer}__list-item-header-title--FontWeight: var(--pf-t--global--font--weight--body--bold);
--#{$notification-drawer}__list-item-header-title--LineHeight: var(--pf-t--global--font--line-height--heading);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here as in alert, hint, and popover.

Comment on lines +59 to +60
--#{$popover}__title-text--FontFamily: var(--pf-t--global--font--family--body);
--#{$popover}__title-text--FontSize: var(--pf-t--global--font--size--body--lg);
--#{$popover}__title-text--FontSize: var(--pf-t--global--font--size--body--default);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here as alert, hint, and notification drawer.

Local isn't working so pushing for the surge demo
removed font-family, size and line-height since they match the globals
updated the popover close button and removed conflicts with global variables.
@andrew-ronaldson andrew-ronaldson linked an issue Jun 17, 2024 that may be closed by this pull request
@andrew-ronaldson andrew-ronaldson marked this pull request as ready for review June 17, 2024 12:17
// Icon
--#{$alert}__icon--Color: var(--pf-t--global--icon--color--regular);
--#{$alert}__icon--MarginBlockStart: #{pf-size-prem(4px)};
--#{$alert}__icon--MarginBlockStart: #{pf-size-prem(2px)};
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what else changed, but 4 looks right to me now. 🙈

Copy link
Member
@srambach srambach left a comment

Choose a reason for hiding this comment

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

Alignments look great now

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 a few nits!

--#{$notification-drawer}__list-item-header-title--FontFamily: var(--pf-t--global--font--family--heading);
--#{$notification-drawer}__list-item-header-title--FontSize: var(--pf-t--global--font--size--heading--xs);
--#{$notification-drawer}__list-item-header-title--FontWeight: var(--pf-t--global--font--weight--heading--bold);
--#{$notification-drawer}__list-item-header-title--LineHeight: var(--pf-t--global--font--line-height--heading);
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 we removed the __list-item-header-title (title in an individual notification item) font vars, then updated properties for __header-title. Was that intentional, or did you mean to make property updates to this block?

.#{$notification-drawer}__list-item-header-title {
font-family: var(--#{$notification-drawer}__list-item-header-title--FontFamily);
font-size: var(--#{$notification-drawer}__list-item-header-title--FontSize);
font-weight: var(--#{$notification-drawer}__list-item-header-title--FontWeight);
line-height: var(--#{$notification-drawer}__list-item-header-title--LineHeight);

--#{$popover}__title-text--FontFamily: var(--pf-t--global--font--family--body);
--#{$popover}__title-text--FontSize: var(--pf-t--global--font--size--body--lg);
--#{$popover}__title-text--FontWeight: var(--pf-t--global--font--weight--body--bold);
--#{$popover}__title-text--FontSize: var(--pf-t--global--font--size--heading--xs);
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 is using a body font, I'd think we wouldn't want to use the heading font-size? Technically it should work just fine, but AFAIK we aren't mixing the body and heading tokens. The equivalent in the body font-size tokens would be --pf-t--global--font--size--body--lg.

thanks @mcoker

Co-authored-by: Michael Coker <35148959+mcoker@users.noreply.github.com>
@andrew-ronaldson andrew-ronaldson requested a review from mcoker June 24, 2024 13:04
--#{$popover}__title-icon--MarginInlineEnd: var(--pf-t--global--spacer--sm);
--#{$popover}__title-icon--Color: var(--pf-t--global--icon--color--regular);
--#{$popover}__title-icon--FontSize: var(--pf-t--global--font--size--heading--xs);
--#{$popover}__title-icon--FontSize: var(--pf-t--global--font--size--body--default);
Copy link
Contributor

Choose a reason for hiding this comment

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

B61A
Suggested change
--#{$popover}__title-icon--FontSize: var(--pf-t--global--font--size--body--default);
--#{$popover}__title-icon--FontSize: var(--pf-t--global--icon--size--font--body--default);

--#{$notification-drawer}__list-item-header-title--FontFamily: var(--pf-t--global--font--family--heading);
--#{$notification-drawer}__list-item-header-title--FontSize: var(--pf-t--global--font--size--heading--xs);
--#{$notification-drawer}__list-item-header-title--FontWeight: var(--pf-t--global--font--weight--heading--bold);
--#{$notification-drawer}__list-item-header-title--LineHeight: var(--pf-t--global--font--line-height--heading);
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 we're still using this --LineHeight here, which we can remove

line-height: var(--#{$notification-drawer}__list-item-header-title--LineHeight);

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.

🐝utiful!!!

@mcoker mcoker merged commit 67781ff into patternfly:v6 Jun 24, 2024
@lboehling
Copy link

pretty pretty!!!

@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 6.0.0-alpha.171 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update text tokens across a few component titles

5 participants

0