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

Commit

Permalink
feat(Numeric in-text citations): Split out into separate extension fo…
Browse files Browse the repository at this point in the history
…r reuse
  • Loading branch information
nokome committed Feb 15, 2021
1 parent 5a30430 commit d6e496a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
3 changes: 3 additions & 0 deletions src/extensions/cite-numeric/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Cite-numeric extension

CSS styles to support numeric in-text citations (e.g. Vancouver, IEEE citation styles).
29 changes: 29 additions & 0 deletions src/extensions/cite-numeric/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
:--CiteGroup {
&::before {
content: '[';
}

&::after {
content: ']';
}

:--Cite {
&:not(:last-child)::after {
content: ',\00a0';
order: 100;
}
}

:--Cite > a > :first-child {
display: inline;
}

:--Cite > a > :last-child {
display: none;
}

/* Ensure that at least one citation format is visible */
:--Cite > a > :only-child {
display: inline;
}
}
32 changes: 1 addition & 31 deletions src/themes/giga/styles.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '../skeleton/styles.css';
@import '../../extensions/cite-numeric/styles.css';

:--root {
--max-width: 800px;
Expand Down Expand Up @@ -153,37 +154,6 @@
color: var(--color-primary-100);
}

/* Default to numeric citation format for cite group fallback text */
:--CiteGroup {
&::before {
content: '[';
}

&::after {
content: ']';
}

:--Cite {
&:not(:last-child)::after {
content: ',\00a0';
order: 100;
}
}

:--Cite > a > :first-child {
display: inline;
}

:--Cite > a > :last-child {
display: none;
}

/* Ensure that at least one citation format is visible */
:--Cite > a > :only-child {
display: inline;
}
}

:--Figure,
:--Table caption {
background: #ecf5e3;
Expand Down

0 comments on commit d6e496a

Please sign in to comment.