Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 4ea1b7c

Browse files
Shi Shucopybara-github
authored andcommitted
style(tooltip): Add emphasis styling for the text in rich tooltips.
PiperOrigin-RevId: 345450112
1 parent 6557a69 commit 4ea1b7c

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

packages/mdc-tooltip/_tooltip-theme.scss

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ $label-color: text-primary-on-dark;
3636

3737
// Rich Tooltip variables
3838
$rich-background-color: rgba(white, theme-color.text-emphasis(medium));
39-
$rich-text-color: text-primary-on-light;
39+
$rich-title-text-color: text-primary-on-light;
40+
$rich-content-text-color: rgba(black, theme-color.text-emphasis(medium));
4041

4142
// Use a custom property so IE11 does not use "normal" and instead uses provided
4243
// fall-back value.
@@ -103,11 +104,21 @@ $z-index: 2;
103104

104105
// Sets the color of the rich tooltip text.
105106
// @param {Color | String} $color
106-
@mixin rich-text-ink-color($color, $query: feature-targeting.all()) {
107+
@mixin rich-text-ink-color(
108+
$title-color,
109+
$content-color,
110+
$query: feature-targeting.all()
111+
) {
107112
$feat-color: feature-targeting.create-target($query, color);
108113
@include feature-targeting.targets($feat-color) {
109114
.mdc-tooltip__surface {
110-
@include theme.prop(color, $color);
115+
.mdc-tooltip__title {
116+
@include theme.prop(color, $title-color);
117+
}
118+
119+
.mdc-tooltip__content {
120+
@include theme.prop(color, $content-color);
121+
}
111122
}
112123
}
113124
}

packages/mdc-tooltip/_tooltip.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ $exit-duration: 75ms;
9595
$query: $query
9696
);
9797
@include tooltip-theme.rich-text-ink-color(
98-
tooltip-theme.$rich-text-color,
98+
tooltip-theme.$rich-title-text-color,
99+
tooltip-theme.$rich-content-text-color,
99100
$query: $query
100101
);
101102
@include feature-targeting.targets($feat-structure) {

0 commit comments

Comments
 (0)