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

THEMES-1195 Updated headline, overline and image opacity #1690

Merged
merged 19 commits into from
Jul 27, 2023

Conversation

malavikakoppula
Copy link
Contributor

@malavikakoppula malavikakoppula commented Jun 29, 2023

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):

  1. image when link:

    a. opacity change to 80%

  2. overline (only on XL, L):

    a. rest: $text-color

    b. hover: $text-color-subtle

  3. headline:

    a. rest: $text-color

    b. hover: $text-color-subtle

  4. 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

  1. Checkout this branch git checkout THEMES-1195
  2. Run fusion repo with linked blocks 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
  3. add all the blocks and inspect on hover to check the color

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.

  • Confirmed all the test steps a reviewer will follow above are working.
  • Confirmed there are no linter errors. Please run npm run lint to check for errors. Often, npm run lint:fix will fix those errors and warnings.
  • Ran this code locally and checked that there are not any unintended side effects. For example, that a CSS selector is scoped only to a particular block.
  • Confirmed this PR has reasonable code coverage. You can run npm run test:coverage to see your progress.
    • Confirmed this PR has unit test files
    • Ran npm run test, made sure all tests are passing
    • If the amount of work to write unit tests for this change are excessive,
      please explain why (so that we can fix it whenever it gets refactored).
  • Confirmed relevant documentation has been updated/added.

Reviewer Checklist

The reviewer of the PR should copy-paste this template into the review comments on review.

  • Linting code actions have passed.
  • Ran the code locally based on the test instructions.
    • I don’t think this is needed to be tested locally. For example, a padding style change (storybook?) or a logic change (write a test).
  • I am a member of the engine theme team so that I can approve and merge this. If you're not on the team, you won't have access to approve and merge this pr.
  • Looked to see that the new or changed code has code coverage, specifically. We want the global code coverage to keep on going up with targeted testing.

@malavikakoppula malavikakoppula changed the title Updated headline, overline and image opacity THEMES-1195 Updated headline, overline and image opacity Jun 29, 2023
@malavikakoppula malavikakoppula added the WIP Work in progress. Feel free to give feedback, but no formal review is requested at this time. label Jun 29, 2023
@malavikakoppula malavikakoppula added ready for review The PR author has completed the PR template and is ready for a review and removed WIP Work in progress. Feel free to give feedback, but no formal review is requested at this time. labels Jul 5, 2023
@malavikakoppula malavikakoppula marked this pull request as ready for review July 5, 2023 14:29
@malavikakoppula malavikakoppula requested a review from a team as a code owner July 5, 2023 14:29
@vgalatro vgalatro added review in progress A review is underway. Even if an approval has been submitted, wait for all reviews to be completed. and removed ready for review The PR author has completed the PR template and is ready for a review labels Jul 10, 2023
@vgalatro vgalatro self-assigned this Jul 10, 2023
Copy link
Contributor

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

Comment on lines 6 to 17
&__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");
}
}
Copy link
Contributor

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.

Copy link
Contributor Author

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

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.

Copy link
Contributor Author

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

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.

Copy link
Contributor Author

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

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

Copy link
Contributor Author

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
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 work as

"components": {
  "link-hover": {
      "opacity": 0.8
    }
}

Copy link
Contributor Author

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

@vgalatro vgalatro added needs changes The reviewer has requested changes from the PR author and removed review in progress A review is underway. Even if an approval has been submitted, wait for all reviews to be completed. labels Jul 10, 2023
@malavikakoppula malavikakoppula added additional review The PR author has requested multiple reviewers. Do not merge until at least 2 approvals are complete and removed needs changes The reviewer has requested changes from the PR author labels Jul 19, 2023
@vgalatro vgalatro added review in progress A review is underway. Even if an approval has been submitted, wait for all reviews to be completed. and removed additional review The PR author has requested multiple reviewers. Do not merge until at least 2 approvals are complete labels Jul 20, 2023
Copy link
Contributor

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

Comment on lines 7 to 12
@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");
Copy link
Contributor

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": {
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 link-hover, not heading. This is making regular text headings grey.

Comment on lines 69 to 71
"link-hover": {
"opacity": 0.8
}
Copy link
Contributor

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.

Copy link
Contributor

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

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.

Copy link
Contributor

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.

Comment on lines 42 to 53
"xl-manual-promo-overline-hover": {
"styles": {
"default": {
"components": {
"overline-hover": {
"color": "var(--text-color-subtle)"
}
}
},
"desktop": {}
}
},
Copy link
Contributor

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

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

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.

Comment on lines 6 to 9
&__overline {
@include scss.block-properties("xl-manual-promo-overline-hover");
@include scss.block-components("xl-manual-promo-overline-hover");
}
Copy link
Contributor

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 vgalatro added needs changes The reviewer has requested changes from the PR author and removed review in progress A review is underway. Even if an approval has been submitted, wait for all reviews to be completed. labels Jul 20, 2023
@malavikakoppula
Copy link
Contributor Author

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.

@vgalatro, I removed all the hover tokens and adjusted styles according to links.

@malavikakoppula malavikakoppula added additional review The PR author has requested multiple reviewers. Do not merge until at least 2 approvals are complete and removed needs changes The reviewer has requested changes from the PR author labels Jul 21, 2023
@vgalatro vgalatro added ready for review The PR author has completed the PR template and is ready for a review review in progress A review is underway. Even if an approval has been submitted, wait for all reviews to be completed. and removed additional review The PR author has requested multiple reviewers. Do not merge until at least 2 approvals are complete ready for review The PR author has completed the PR template and is ready for a review labels Jul 25, 2023
Copy link
Contributor

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

Comment on lines 66 to 74
"xl-manual-promo-img": {
"styles": {
"default": {
"link-hover": {
"opacity": 0.8
}
},
"desktop": {}
}
Copy link
Contributor

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": {}
    }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vgalatro, Fixed it in a622ba2

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vgalatro, Fixed it in 8a050cf

@@ -131,7 +127,6 @@ const ExtraLargeManualPromo = ({ customFields }) => {
component={Link}
condition={linkURL}
href={formatURL(linkURL)}
className={`${BLOCK_CLASS_NAME}__img`}
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vgalatro Fixed it in a622ba2

Comment on lines 14 to 17
&__img {
@include scss.block-properties("xl-manual-promo-img");
@include scss.block-components("xl-manual-promo-img");
}
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vgalatro Fixed it in a622ba2

@vgalatro vgalatro added needs changes The reviewer has requested changes from the PR author and removed review in progress A review is underway. Even if an approval has been submitted, wait for all reviews to be completed. labels Jul 25, 2023
@malavikakoppula malavikakoppula added additional review The PR author has requested multiple reviewers. Do not merge until at least 2 approvals are complete and removed needs changes The reviewer has requested changes from the PR author labels Jul 26, 2023
@vgalatro vgalatro added review in progress A review is underway. Even if an approval has been submitted, wait for all reviews to be completed. and removed additional review The PR author has requested multiple reviewers. Do not merge until at least 2 approvals are complete labels Jul 26, 2023
Copy link
Contributor

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

Comment on lines 5 to 6
@include scss.block-properties("xl-manual-promo-img");
@include scss.block-components("xl-manual-promo-img");
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vgalatro Thanks, fixed it 808d50b

Comment on lines 5 to 6
@include scss.block-properties("xl-manual-promo-img");
@include scss.block-components("xl-manual-promo-img");
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vgalatro fixed it 808d50b

Comment on lines 5 to 6
@include scss.block-properties("xl-manual-promo-img");
@include scss.block-components("xl-manual-promo-img");
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vgalatro fixed it 808d50b

Comment on lines 5 to 6
@include scss.block-properties("xl-manual-promo-img");
@include scss.block-components("xl-manual-promo-img");
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vgalatro fixed it 808d50b

Comment on lines 5 to 6
@include scss.block-properties("xl-manual-promo-img");
@include scss.block-components("xl-manual-promo-img");
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vgalatro fixed it 808d50b

Comment on lines 5 to 6
@include scss.block-properties("xl-manual-promo-img");
@include scss.block-components("xl-manual-promo-img");
Copy link
Contributor

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

Comment on lines 5 to 6
@include scss.block-properties("xl-manual-promo-img");
@include scss.block-components("xl-manual-promo-img");
Copy link
Contributor

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

@malavikakoppula
Copy link
Contributor Author

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.

@vgalatro Fixed all of these 808d50b

Copy link
Contributor

@vgalatro vgalatro left a 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!

@vgalatro vgalatro removed their assignment Jul 26, 2023
@vgalatro vgalatro added ready for design qa Development complete and approved, ready for design to review and removed review in progress A review is underway. Even if an approval has been submitted, wait for all reviews to be completed. labels Jul 26, 2023
@pardistaherzadeh
Copy link

Looks good to me. Ready to be merged. @vgalatro

@malavikakoppula malavikakoppula merged commit c8e2634 into arc-themes-release-version-2.0.3 Jul 27, 2023
6 checks passed
@malavikakoppula malavikakoppula deleted the THEMES-1195 branch July 27, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for design qa Development complete and approved, ready for design to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants