Use system colors for tooltip and snackbar components#14524
Use system colors for tooltip and snackbar components#14524
Conversation
|
You can trigger an installable build for these changes by visiting CircleCI here. |
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
frosty
left a comment
There was a problem hiding this comment.
Looks good to me! I'm not a designer, so I'll let them weigh in about the visual appearance :)
| actionButton.titleLabel?.adjustsFontForContentSizeCategory = true | ||
| actionButton.setTitleColor(.white, for: .normal) | ||
| if #available(iOS 13.0, *) { | ||
| actionButton.setTitleColor(.label, for: .normal) |
There was a problem hiding this comment.
Could you move this to the NoticeStyle extension as another var? actionButtonTitleColor or something, and handle the if #available there?
|
Hey the colors look good...But I think you might have flipped light and dark mode? i.e. I expect a dark tooltip/snackbar on light mode, and a light one on dark mode. But I'm seeing light on light, and dark on dark. Unless I'm missing a design decision or other reason that we changed it! |
|
Hey @osullivanchris !
the |
|
Ah good catch, @osullivanchris. That was my intention, and we discussed this early on but I must've missed the detail when reviewing the screenshots in isolation last week (my bad @Gio2018 !). The colors should be inverted:
Note: text colors should also be inverted as a result. |
|
Oh I see now @osullivanchris and @iamthomasbishop ! Sorry about the confusion, I misread this in the original issue, it was stated that the colors were to be inverted. The only issue is that, as far as I know, there is no way to automatically "invert" the system colors between dark and light appearance, so the solution would be to use custom colors, that look like the system colors in the opposite appearance. While this is perfectly feasible, we would not be really using system colors (which I thought it was one of the goals of #14136), because, for example, iOS in light appearance has no system-equivalent of |
|
@Gio2018 I think you should be able to make use of some of our existing UIColor convenience methods to add a 'flipped' version of e.g. systemGray5 to UIColor in an extension. For example: This only takes care of iOS 13+ – you'd need to check for that and do something a little different for earlier OS versions. Do you think this could work? One thing to note is that Apple recommends against hard-coding the color values for their system colors, so the above would be preferable. 🙂 |
|
Hey @frosty !
I believe it could. To be noted that even if we are using colors that are derived from system colors, these are, in fact, custom colors.
I agree, this implementation (for iOS 13+) has the advantage of not hardcoding RGB values. For iOS 12, I think the only option is instead to hardcode them? |
…ss-iOS into issue/14136-notice-background-color
| actionButton.titleLabel?.adjustsFontForContentSizeCategory = true | ||
| actionButton.setTitleColor(.white, for: .normal) | ||
| actionButton.setTitleColor(notice.style.actionButtonTitleColor, for: .normal) | ||
|
|
There was a problem hiding this comment.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
@osullivanchris , @iamthomasbishop , @frosty , colors are now updated to use their "inverted" version |
osullivanchris
left a comment
There was a problem hiding this comment.
Hey looks great now @Gio2018 ! Thanks for the new build.
I can totally understand why this is not fully out-of-the-box as we're effectively using dark colors in light mode and light colors in dark mode. But everything looks good visually to me, and as I understand you were able to do it without much customisation. And we're using the same code across all tooltips and snackbars which is a win too.
|
Looks really solid overall, @Gio2018 ! One minor thing: are we using Other than that, everything looks good to go. Thank you! |
|
Hey @iamthomasbishop !
I'd say so, I kept the existing setting on this one
Sure! I assume they should also be inverted like all the other colors in the notices? I am asking because if I don't invert them, they seem a little less readable. Here are example screenshots of both scenarios:
|
@Gio2018 Ahh okay, if we're automatically inverting the colors, the second examples you shared look correct ( |
|
@Gio2018 I just noticed one other thing on this PR – in dark mode (light backgrounds) we lose the dividers between the content and buttons of the larger quick start notice: Is that something we could address separately? |
@frosty sure! I just merged this PR but I can open a new one for this specific issue. It looks like right now we are using |





Fixes #14136
This PR changes the colors used in all Notices (Tooltips and snackbar components), as listed below:
Note: inverted colors are system colors of the opposite appearance. For example, inverted systemGray5 means that in light appearance, we are using the value of
systemGray5from dark appearance, etchere are some screenshots for reference
To test:
PR submission checklist:
RELEASE-NOTES.txtif necessary.