Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
fix(Elife): Don't use string variables in URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ketch committed Aug 14, 2020
1 parent 29c6555 commit a787107
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
7 changes: 0 additions & 7 deletions src/themes/elife/staticCustomProperties.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@
--BASELINE-MEASURE: 1.5;
--BASELINE-MEASURE-REM: calc(var(--BASELINE-MEASURE) * 1rem);

/* URLs */
--URL-DOWNLOAD-ICON--NARROWER-VIEWPORTS: url('@elifesciences/pattern-library/source/assets/img/icons/download.svg');
--URL-DOWNLOAD-ICON--WIDER-VIEWPORTS: url('@elifesciences/pattern-library/source/assets/img/icons/download-full.svg');
--URL-EMAIL-ICON: url('@elifesciences/pattern-library/source/assets/img/icons/[email protected]');
--URL-CC-ICON: url('@elifesciences/pattern-library/source/assets/img/icons/cc.svg');
--URL-OA-ICON: url('@elifesciences/pattern-library/source/assets/img/icons/oa.svg');

/* Stencila WebComponent overrides */
--font-family-display: 'Noto Sans', 'Arial', 'Helvetica', sans-serif;
--font-family-body: 'Noto Sans', 'Arial', 'Helvetica', sans-serif;
Expand Down
31 changes: 14 additions & 17 deletions src/themes/elife/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
--download-icon-block-size: var(
--BLOCK-SIZE-DOWNLOAD-ICON-PX--NARROWER-VIEWPORTS
);
--download-icon-image-path: var(--URL-DOWNLOAD-ICON--NARROWER-VIEWPORTS);
}

@media only screen and (--medium-viewport) {
Expand All @@ -68,7 +67,6 @@
--download-icon-block-size: var(
--BLOCK-SIZE-DOWNLOAD-ICON-PX--WIDER-VIEWPORTS
);
--download-icon-image-path: var(--URL-DOWNLOAD-ICON--WIDER-VIEWPORTS);
}
}

Expand All @@ -87,20 +85,14 @@
height: 22px;
}

.content-header__icon--cc {
background-image: var(--URL-CC-ICON);

&:hover {
background-image: var(--URL-CC-ICON);
}
.content-header__icon--cc,
.content-header__icon--cc:hover {
background-image: url('@elifesciences/pattern-library/source/assets/img/icons/cc.svg');
}

.content-header__icon--oa {
background-image: var(--URL-OA-ICON);

&:hover {
background-image: var(--URL-OA-ICON);
}
.content-header__icon--oa,
.content-header__icon--oa:hover {
background-image: url('@elifesciences/pattern-library/source/assets/img/icons/oa.svg');
}

& :--authors {
Expand All @@ -122,7 +114,7 @@
}

:--emails::after {
content: var(--URL-EMAIL-ICON);
content: url('@elifesciences/pattern-library/source/assets/img/icons/[email protected]');
}
}

Expand All @@ -142,7 +134,7 @@
}

:--emails::after {
content: var(--URL-EMAIL-ICON);
content: url('@elifesciences/pattern-library/source/assets/img/icons/[email protected]');
}
}

Expand Down Expand Up @@ -267,7 +259,12 @@
& > .download-link {
flex: 0 0 var(--download-icon-block-size);
height: var(--download-icon-block-size);
background: var(--download-icon-image-path) transparent no-repeat;
background: url('@elifesciences/pattern-library/source/assets/img/icons/download.svg')
transparent no-repeat;

@media only screen and (--medium-viewport) {
background-image: url('@elifesciences/pattern-library/source/assets/img/icons/download-full.svg');
}

& > .download-link-text {
@mixin visuallyhidden;
Expand Down

0 comments on commit a787107

Please sign in to comment.