[MWPW-194266] - Sticky CTA#6002
Conversation
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
|
| @@ -0,0 +1,3 @@ | |||
| <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"> | |||
| <path d="M11.208 5.417L7.508 1.717C7.186 1.395 6.664 1.395 6.342 1.717 6.02 2.039 6.02 2.561 6.342 2.883L8.633 5.175H1.375C.919 5.175.55 5.544.55 6 .55 6.456.919 6.825 1.375 6.825H8.633L6.342 9.117C6.02 9.44 6.02 9.961 6.342 10.283 6.503 10.444 6.714 10.525 6.925 10.525 7.136 10.525 7.347 10.444 7.508 10.283L11.208 6.583C11.53 6.261 11.53 5.739 11.208 5.417Z" fill="black"/> | |||
There was a problem hiding this comment.
Since the icon is identical except the color, we could just adjust the colors via CSS, right? It doesn't look like we need two different icons.
There was a problem hiding this comment.
@overmyheadandbody Now, I am using the SVG directly as HTML content, which makes it easy to customize the color. However, since this icon is part of the promo CTA (with the arrow) and may be reused in other places.
Do you think maintaining these icons in icons.js is the good approach, or if it would be better to keep them in a utils.js?
| .icon-button { | ||
| align-items: center; | ||
| background-color: var(--s2a-color-transparent-white-16); | ||
| block-size: var(--s2a-spacing-xl); |
There was a problem hiding this comment.
Better have this explicit, as spacings could change in future token package updates. Same for inline-size: var(--s2a-spacing-xl); below.
| .icon-button { | ||
| align-items: center; | ||
| background-color: var(--s2a-color-transparent-white-16); | ||
| block-size: var(--s2a-spacing-32); |
There was a problem hiding this comment.
This was brought up before, but I see it hasn't changed. Width/height should not be based on spacing tokens, these can be explicit unit values. Same for L955
| text-decoration: none; | ||
| white-space: nowrap; | ||
| img { | ||
| block-size: var(--s2a-spacing-32) ; |
There was a problem hiding this comment.
| block-size: var(--s2a-spacing-32) ; | |
| block-size: var(--s2a-spacing-32); |
And the same comment around using spacing tokens for width/height, it should be avoided. Since I see this repeating, you can just scope a variable with the desired size to the block itself, like
.icon-button {
--icon-size: 32px;
...
}
| const ctaHref = linkEl?.getAttribute('href') || '#'; | ||
|
|
||
| const arrow = createTag('span', { class: 'icon-button', 'aria-hidden': 'true' }); | ||
| arrow.innerHTML = icons.arrowRightWhite; |
There was a problem hiding this comment.
This could cause a false positive from Kodiak, you could likely add this through createTag
robert-bogos
left a comment
There was a problem hiding this comment.
Thank you for taking care of the feedback ❤️
Sticky CTA Block.
Block Authoring:

Resolves: MWPW-194266
Test URL:
https://main--upp--adobecom.aem.page/homepage/drafts/devashish/floating-cta?milolibs=sticky-cta