Skip to content

Commit

Permalink
fix(HTML): Ensure email icons act as links
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ketch committed Feb 18, 2022
1 parent 39e7f34 commit ccbc61a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
4 changes: 3 additions & 1 deletion rust/codec-html/src/encode/works.rs
Expand Up @@ -225,7 +225,9 @@ fn author_person_to_html(person: &Person, orgs: Option<&Vec<&Organization>>) ->
&concat(emails, |email| {
[
"<a itemprop=\"email\"", &attr("href", &["mailto:", email].concat()), ">",
email,
"<span>",
email,
"</span>",
"</a>",
].concat()
}),
Expand Down
14 changes: 8 additions & 6 deletions themes/src/extensions/person/styles.css
Expand Up @@ -61,13 +61,15 @@
}

:--email {
display: none;
}
span {
display: none;
}

&::after {
content: '\00a0📧';
vertical-align: super;
color: var(--color-primary-100);
&::after {
content: '\00a0📧';
vertical-align: super;
color: var(--color-primary-100);
}
}
}

Expand Down
35 changes: 26 additions & 9 deletions themes/src/themes/elife/styles.css
Expand Up @@ -89,24 +89,34 @@

& :--authors {
@extend .content-header__author_list;
margin-bottom: 0;

:--Person {
@extend .content-header__author_list_item;
display: inline;

font-size: var(--TEXT-SIZE-MEDIUM-REM);

:--familyName::after {
&::after {
content: ', ';
}

&:last-child {
:--familyName::after {
&::after {
content: '';
}
}

:--emails::after {
content: url('~/node_modules/@elifesciences/pattern-library/source/assets/img/icons/corresponding-author@1x.png');
:--emails {
padding-left: 4px;
}

:--email {
span {
display: none;
}

&::after {
content: url('~/node_modules/@elifesciences/pattern-library/source/assets/img/icons/corresponding-author@1x.png');
}
}
}

Expand All @@ -125,8 +135,14 @@
}
}

:--emails::after {
content: url('~/node_modules/@elifesciences/pattern-library/source/assets/img/icons/corresponding-author@1x.png');
:--email {
span {
display: none;
}

&::after {
content: url('~/node_modules/@elifesciences/pattern-library/source/assets/img/icons/corresponding-author@1x.png');
}
}
}

Expand All @@ -143,11 +159,12 @@
margin-bottom: var(--BASELINE-MEASURE-REM);

:--Organization {
@extend .content-header__institution_list_item;
display: inline;
font-size: var(--TEXT-SIZE-MEDIUM-REM);

:--name,
:--address {
@extend .content-header__institution_list_item;
}

& :--parentOrganization::before {
Expand Down

0 comments on commit ccbc61a

Please sign in to comment.