-
Notifications
You must be signed in to change notification settings - Fork 27
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
THEMES-1195 Updated headline, overline and image opacity #1690
THEMES-1195 Updated headline, overline and image opacity #1690
Conversation
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 made comments on the extra large manual promo, but they apply to all the promo blocks. We want to make sure we're using the "components" styling to keep things consistent and make sure inheritance is working correctly.
&__overline { | ||
&:hover { | ||
@include scss.block-properties("xl-manual-promo-overline-hover"); | ||
@include scss.block-components("xl-manual-promo-overline-hover"); | ||
} | ||
} | ||
&__headline { | ||
&:hover { | ||
@include scss.block-properties("xl-manual-promo-headline-hover"); | ||
@include scss.block-components("xl-manual-promo-headline-hover"); | ||
} | ||
} |
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.
We shouldn't need new tokens for the hover state specifically, just for overline and headline.
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.
@vgalatro Fixed this removing hover from here
@include scss.block-components("xl-manual-promo-headline-hover"); | ||
} | ||
} | ||
&__imgWithLink { |
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 class should target the image, whether or not it is linked. We can use the "components" styling to then target the link in the image block.
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.
@vgalatro Fixed this
"desktop": {} | ||
} | ||
}, | ||
"xl-manual-promo-img-with-link": { |
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.
As noted above, this should be changed to always target the image.
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.
@vgalatro Fixed this by adding image component to this
@@ -131,7 +135,10 @@ const ExtraLargeManualPromo = ({ customFields }) => { | |||
onClick={registerSuccessEvent} | |||
assistiveHidden={showHeadline && showDescription} | |||
> | |||
<Image {...imageParams} /> | |||
<Image | |||
className={`${linkURL ? `${BLOCK_CLASS_NAME}__imgWithLink` : ""}`} |
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.
Remove this conditional and always add a classname here, ${BLOCK_CLASS_NAME}__img
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.
@vgalatro updated this
"xl-manual-promo-img-with-link": { | ||
"styles": { | ||
"default": { | ||
"opacity": 0.8 |
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 work as
"components": {
"link-hover": {
"opacity": 0.8
}
}
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.
@vgalatro Instead of link-hover, it's working with image
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 is looking better, but I still found some issues. I made notes on the extra large promo block, but they apply to all blocks. We should be able to eliminate the *-promo-overline
tokens, cutting the complexity of the CSS we generate.
@include scss.block-properties("xl-manual-promo-overline-hover"); | ||
@include scss.block-components("xl-manual-promo-overline-hover"); | ||
} | ||
&__headline { | ||
@include scss.block-properties("xl-manual-promo-headline-hover"); | ||
@include scss.block-components("xl-manual-promo-headline-hover"); |
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.
Remove -hover
from these token names.
"styles": { | ||
"default": { | ||
"components": { | ||
"heading": { |
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 link-hover
, not heading
. This is making regular text headings grey.
"link-hover": { | ||
"opacity": 0.8 | ||
} |
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.
Needs to be wrapped in the "components" : { }
property.
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.
In the news.json
files for the other blocks the "image"
property also needs to be changed to "link-hover"
"desktop": {} | ||
} | ||
}, | ||
"xl-manual-promo-headline-hover": { |
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.
Make sure to remove -hover
from the token name here too.
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 we need to style the link
that's a child of the heading
component, we'll still need the *-promo-headline
tokens for the blocks.
"xl-manual-promo-overline-hover": { | ||
"styles": { | ||
"default": { | ||
"components": { | ||
"overline-hover": { | ||
"color": "var(--text-color-subtle)" | ||
} | ||
} | ||
}, | ||
"desktop": {} | ||
} | ||
}, |
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 more I look at it, I don't think we need this token at all. Since all we need to do is style the component itself the "overline-hover"
rule can be a part of "xl-manual-promo"
.
"link": { | ||
"font-family": "inherit", | ||
"font-size": "inherit", | ||
"font-weight": "inherit", | ||
"line-height": "inherit" | ||
}, | ||
"overline": { | ||
"color": "var(--text-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.
To go with the other comment, we can move
"overline-hover": {
"color": "var(--text-color-subtle)"
}
here, and eliminate the *-promo-overline
tokens.
@@ -96,12 +96,16 @@ const ExtraLargeManualPromo = ({ customFields }) => { | |||
return availableOverline || availableHeadline || availableImageURL || availableDescription ? ( | |||
<LazyLoad enabled={shouldLazyLoad}> | |||
<article className={BLOCK_CLASS_NAME}> | |||
{availableOverline ? <Overline href={overlineURL}>{availableOverline}</Overline> : null} | |||
{availableOverline ? ( | |||
<Overline href={overlineURL} className={`${BLOCK_CLASS_NAME}__overline`}> |
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.
No longer need the className
here.
&__overline { | ||
@include scss.block-properties("xl-manual-promo-overline-hover"); | ||
@include scss.block-components("xl-manual-promo-overline-hover"); | ||
} |
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 token may be removed.
@vgalatro, I removed all the hover tokens and adjusted styles according to links. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there may have been some confusion when we were talking about the changes needed. We still need a token targeting the images in each promo block, with the opacity property set to the link-hover component there. The way it is now, all of the links change opacity on hover, making them the incorrect color.
"xl-manual-promo-img": { | ||
"styles": { | ||
"default": { | ||
"link-hover": { | ||
"opacity": 0.8 | ||
} | ||
}, | ||
"desktop": {} | ||
} |
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.
Sorry if my comments caused some confusion, but we still need a token for the image container. The opacity
property affects text as well, so the links are too light.
The change needed here was to add the components wrapper like so:
"xl-manual-promo-img": {
"styles": {
"default": {
"components": {
"link-hover": {
"opacity": 0.8
}
}
},
"desktop": {}
}
}
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.
@@ -28,49 +28,22 @@ | |||
"justify-content": "center", | |||
"line-height": "var(--heading-level-1-line-height)" | |||
}, | |||
"link-hover": { | |||
"color": "var(--text-color-subtle)", | |||
"opacity": 0.8 |
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.
Adding opacity here is making the links too light of a 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.
@@ -131,7 +127,6 @@ const ExtraLargeManualPromo = ({ customFields }) => { | |||
component={Link} | |||
condition={linkURL} | |||
href={formatURL(linkURL)} | |||
className={`${BLOCK_CLASS_NAME}__img`} |
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.
We'll still need this class.
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.
&__img { | ||
@include scss.block-properties("xl-manual-promo-img"); | ||
@include scss.block-components("xl-manual-promo-img"); | ||
} |
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.
Keep the image token so we can apply the opacity to the correct 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.
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.
Everything is working, however I noticed there seems to be copy/paste errors in the token definitions inside the scss files. Once those are fixed I can approve this PR.
@include scss.block-properties("xl-manual-promo-img"); | ||
@include scss.block-components("xl-manual-promo-img"); |
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 should be xl-promo-img
.
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.
@include scss.block-properties("xl-manual-promo-img"); | ||
@include scss.block-components("xl-manual-promo-img"); |
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 should be large-manual-promo-img
.
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.
blocks/large-promo-block/_index.scss
Outdated
@include scss.block-properties("xl-manual-promo-img"); | ||
@include scss.block-components("xl-manual-promo-img"); |
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 should be large-promo-img
.
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.
@include scss.block-properties("xl-manual-promo-img"); | ||
@include scss.block-components("xl-manual-promo-img"); |
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 should be medium-manual-promo-img
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.
@include scss.block-properties("xl-manual-promo-img"); | ||
@include scss.block-components("xl-manual-promo-img"); |
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 should be medium-promo-img
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.
@include scss.block-properties("xl-manual-promo-img"); | ||
@include scss.block-components("xl-manual-promo-img"); |
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 should be small-manual-promo-img
blocks/small-promo-block/_index.scss
Outdated
@include scss.block-properties("xl-manual-promo-img"); | ||
@include scss.block-components("xl-manual-promo-img"); |
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 should be small-promo-img
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.
All the changes look good, approved!
Looks good to me. Ready to be merged. @vgalatro |
c8e2634
into
arc-themes-release-version-2.0.3
Description
Review doc: https://paper.dropbox.com/doc/Themes-hover-states-audit--B400R8DxsjiVy0YImyMBZ0B4Ag-JyHvxHuZttlIfj5BzjTI3
Redesigned button components: https://www.figma.com/file/vWVGgZfZVBdSX7ACo3kmjr/Enhanced-Styling-Design-System?type=design&node-id=7736%3A104212&t=wkfbbYPc5dtqGGKM-1 - Connect your Figma account
Jira Ticket
Acceptance Criteria
Applies to all promos (manual and non, S-XL):
image when link:
a. opacity change to 80%
overline (only on XL, L):
a. rest: $text-color
b. hover: $text-color-subtle
headline:
a. rest: $text-color
b. hover: $text-color-subtle
author name, when link (covered in linked ticket so no need to override but confirm as part of this ticket):
a. rest: $text-color
b. hover: $text-color-subtle
Test Steps
git checkout THEMES-1195
npx fusion start -f -l @wpmedia/extra-large-manual-promo-block,@wpmedia/extra-large-promo-block,@wpmedia/large-manual-promo-block,@wpmedia/large-promo-block,@wpmedia/medium-manual-promo-block,@wpmedia/medium-promo-block,@wpmedia/small-manual-promo-block,@wpmedia/small-promo-block
Dependencies or Side Effects
Author Checklist
The author of the PR should fill out the following sections to ensure this PR is ready for review.
npm run lint
to check for errors. Often,npm run lint:fix
will fix those errors and warnings.npm run test:coverage
to see your progress.npm run test
, made sure all tests are passingplease explain why (so that we can fix it whenever it gets refactored).
Reviewer Checklist
The reviewer of the PR should copy-paste this template into the review comments on review.