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

Commit ac41a57

Browse files
Shi Shucopybara-github
authored andcommitted
style(tooltip): Add styling to link elements within the content of rich tooltip
PiperOrigin-RevId: 347002313
1 parent 00f3820 commit ac41a57

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

packages/mdc-tooltip/_tooltip-theme.scss

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ $label-color: text-primary-on-dark;
3838
$rich-background-color: rgba(white, theme-color.text-emphasis(medium));
3939
$rich-title-text-color: text-primary-on-light;
4040
$rich-content-text-color: rgba(black, theme-color.text-emphasis(medium));
41+
$rich-content-link-color: primary;
4142

4243
// Use a custom property so IE11 does not use "normal" and instead uses provided
4344
// fall-back value.
@@ -107,18 +108,21 @@ $z-index: 2;
107108
@mixin rich-text-ink-color(
108109
$title-color,
109110
$content-color,
111+
$content-link-color,
110112
$query: feature-targeting.all()
111113
) {
112114
$feat-color: feature-targeting.create-target($query, color);
113115
@include feature-targeting.targets($feat-color) {
114-
.mdc-tooltip__surface {
115-
.mdc-tooltip__title {
116-
@include theme.prop(color, $title-color);
117-
}
116+
.mdc-tooltip__title {
117+
@include theme.prop(color, $title-color);
118+
}
119+
120+
.mdc-tooltip__content {
121+
@include theme.prop(color, $content-color);
122+
}
118123

119-
.mdc-tooltip__content {
120-
@include theme.prop(color, $content-color);
121-
}
124+
.mdc-tooltip__content-link {
125+
@include theme.prop(color, $content-link-color);
122126
}
123127
}
124128
}

packages/mdc-tooltip/_tooltip.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ $exit-duration: 75ms;
9898
@include tooltip-theme.rich-text-ink-color(
9999
tooltip-theme.$rich-title-text-color,
100100
tooltip-theme.$rich-content-text-color,
101+
tooltip-theme.$rich-content-link-color,
101102
$query: $query
102103
);
103104
@include feature-targeting.targets($feat-structure) {
@@ -201,5 +202,11 @@ $exit-duration: 75ms;
201202
margin: 0 $_content-margin-x 16px $_content-margin-x;
202203
}
203204
}
205+
206+
.mdc-tooltip__content-link {
207+
@include feature-targeting.targets($feat-structure) {
208+
text-decoration: none;
209+
}
210+
}
204211
}
205212
}

0 commit comments

Comments
 (0)