-
Notifications
You must be signed in to change notification settings - Fork 30
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
Refactor Right Ad label styles #13111
Conversation
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
Size Change: -16 B (0%) Total Size: 870 kB ℹ️ View Unchanged
|
663dab0
to
209872f
Compare
border-top-color: ${palette.neutral[20]}; | ||
color: ${palette.neutral[86]}; |
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.
maybe we should update these 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.
Yep agreed - I think we can actually handle this more robustly by using schemedPalette and adding some palette declarations to handle the edge case of audio/video articles? I've had a go - let me know what you think
@@ -90,7 +90,7 @@ const outOfPageStyles = css` | |||
|
|||
const darkLabelStyles = css` | |||
.ad-slot[data-label-show='true']:not(.ad-slot--interscroller)::before { | |||
background-color: transparent; | |||
background-color: ${schemedPalette('--article-inner-background')}; |
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.
Should we use this, as this is used elsewhere in the file
background-color: ${schemedPalette('--article-inner-background')}; | |
background-color: ${schemedPalette('--ad-background-article-inner')}; |
OR
background-color: ${schemedPalette('--article-inner-background')}; | |
background-color: ${schemedPalette('--ad-background')}; |
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.
Ah I don't think the --ad-background-article-inner declaration actually handles the case of Audio/Video articles yet! So in light mode on these articles it wouldn't return the right value. I can update the declaration to handle Audio/Video articles and then use that value
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.
Definite improvement here, looks great! ✨
We might want to be more thorough with palette choices in future in case this sort of thing reoccurs with mixed usage of colours direct from source and from the palette declarations file
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.
Refactor looks great! Thanks so much for this ✨
Seen on PROD (merged by @emma-imber 9 minutes and 18 seconds ago) Please check your changes! |
What does this change?
Refactors the Right ad slot label styles to handle different styling on Audio/Video articles, and on Labs Video/Audio articles. Using palette declarations to handle Video/Audio articles also means that we don't need to add a prop in the
MostViewedRightWithAd
component.Why?
At the moment ad labels on dark backgrounds (eg video or audio pages) look broken, and are not readable. A refactor of how these styles works is a more robust fix for the issue than updating the
background-color
value. All other styles have been kept the same.Screenshots
Video article
Labs video article
Standard labs article
Standard article