Skip to content

Commit edf3208

Browse files
authored
fix: mailto-text-replace and c-button incompatible (#580)
- Added `:not(…)` to avoid applying to a Core-Styles button. - Use nested CSS syntax to minimize footprint across files. - Linked to example usage that has the problem.
1 parent 0601a82 commit edf3208

File tree

6 files changed

+22
-16
lines changed

6 files changed

+22
-16
lines changed

dist/core-styles.base.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-styles.cms.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/elements/mailto-link.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/trumps/u-mailto-text-replace.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/_imports/elements/mailto-link.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* Allow supporting `u-mailto-text-replace` on all hyperlinks */
22
/* FAQ: Only included by a project as client wants it */
33
/* SEE: https://ecepalliance.org/about/leadership/ */
4+
/* SEE: https://ecepalliance.org/alliance-members/ */
45

56
@import url("../tools/x-mailto-text-replace.css");
67

src/lib/_imports/tools/x-mailto-text-replace.css

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,23 @@ Replace mailto link rendered text with virtual text from data-attributes
66
Styleguide Tools.Mixins.MailtoTextReplace
77
*/
88

9+
@import url("../components/c-button.selectors.css");
10+
911
/* To replace actual link text with generated link text */
1012
%x-mailto-text-replace {
11-
/* FAQ: Using `display: none` would hide pseudo element text */
12-
visibility: hidden; /* to hide actual link text */
13-
font-size: 0; /* to remove space of hidden text */
14-
/* CAVEAT: The `font-size: 0` causes underline to be too high */
15-
/* HACK: So push underline down */
16-
text-underline-offset: 0.3rem;
17-
}
18-
%x-mailto-text-replace::before {
19-
display: inline;
20-
content: attr(data-user) "@" attr(data-domain);
21-
font-size: initial; /* to restore font size */
22-
visibility: visible; /* to restore visibility */
13+
&:not(:--c-button) {
14+
/* FAQ: Using `display: none` would hide pseudo element text */
15+
visibility: hidden; /* to hide actual link text */
16+
font-size: 0; /* to remove space of hidden text */
17+
/* CAVEAT: The `font-size: 0` causes underline to be too high */
18+
/* HACK: So push underline down */
19+
text-underline-offset: 0.3rem;
20+
21+
&::before {
22+
display: inline;
23+
content: attr(data-user) "@" attr(data-domain);
24+
font-size: initial; /* to restore font size */
25+
visibility: visible; /* to restore visibility */
26+
}
27+
}
2328
}

0 commit comments

Comments
 (0)