-
Notifications
You must be signed in to change notification settings - Fork 166
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
Update card pattern to support color themes #5112
Conversation
27b3f2f
to
ed60fa5
Compare
ed60fa5
to
f0d919c
Compare
FYI, this causes changes to some other examples that used card; the card section of the example now uses the theme of the example, rather than always being light theme. I initially thought this was a Percy bug (and opened #5114 ) but this is expected :) |
@lyubomir-popov Please give a design review when you have the time! |
Nothing looks broken to me, so +1. Iwonder whether we need all this though - the closest we come to cards in the rebranded pages are these two examples, and both have no borders or shadows, just the indent. Maybe it's time to deprecate all other versions of the card - unless they are used in products: |
We "need" this just for the sake of consistency. Current cards would break on dark theme (components used in them would use white text). So we need them to at least be not broken, and use theme colours instead of hardcoded ones. So it's just a minimal work to achieve that. But overall at some point we should do a review of Vanilla components and properly identify the ones we want to deprecate. |
It seems that border around card is still hardcoded into a single colour, because it's extended out of |
550c032
to
d4fb160
Compare
@bartaz I've revised this to use |
Thanks, but it would be good to update the Or, to be specific, the |
d4fb160
to
13b4bde
Compare
@bartaz Done! Let's see what Percy thinks about this, hopefully many things get fixed |
If the colour change is subtle it may not even notice ;) |
|
@@ -5,7 +5,7 @@ | |||
|
|||
{% block content %} | |||
<div class="p-card"> | |||
<img class="p-card__thumbnail" src="https://assets.ubuntu.com/v1/dca2e4c4-raspberry-logo.png" alt="" /> | |||
<img class="p-card__thumbnail" src="https://assets.ubuntu.com/v1/8fdc8250-Ubuntu+and+Raspberry+Pi.svg" alt="" /> |
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.
Why the image change?
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.
@bartaz Updated image looks better on dark theme as it has no dark text
Before (dark theme):
After (dark theme):
Although, the plus icon here is still kind of hard to see in dark theme. Is this the kind of thing that we care about changing now that we're updating components to support theming?
scss/_settings_placeholders.scss
Outdated
@@ -5,7 +5,7 @@ | |||
$input-border-thickness: 1.5px; | |||
$bar-thickness: 0.1875rem !default; // 3px at 16px fontsize, expressed in rems so it scales with text if the root font-size changes at a breakpoint | |||
$border-radius: 0; // deprecated, will be removed in future version of Vanilla | |||
$border: $input-border-thickness solid $color-mid-light !default; | |||
$border: 1px solid $colors--theme--border-default !default; |
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 border thickness as it was before, just update the colour, please.
13b4bde
to
0641269
Compare
Done
Updates the card component to use new color theme variables & thus support theming.
Note that the image used in the header example was changed as the old one is not friendly to all themes (dark text becomes impossible to read on dark theme)
Fixes WD-11865
QA
Check if PR is ready for release
If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:
Feature 🎁
,Breaking Change 💣
,Bug 🐛
,Documentation 📝
,Maintenance 🔨
.package.json
should be updated relative to the most recent release, following semver convention:Screenshots
Default light:
Default dark:
Default paper:
Content bleed light:
Content bleed dark:
Content bleed paper:
Header light:
Header dark:
Header paper:
Highlighted light:
Highlighted dark:
Highlighted paper:
Image light:
Image dark:
Image paper:
Overlay light:
Overlay dark:
Overlay paper: