diff options
-rw-r--r-- | src/components/licenses.module.css | 4 | ||||
-rw-r--r-- | src/components/licenses.tsx | 6 | ||||
-rw-r--r-- | src/theme/Footer/Copyright.jsx | 9 | ||||
-rw-r--r-- | src/theme/Footer/Copyright.module.css | 4 |
4 files changed, 18 insertions, 5 deletions
diff --git a/src/components/licenses.module.css b/src/components/licenses.module.css index 512efbb..8fe7e1f 100644 --- a/src/components/licenses.module.css +++ b/src/components/licenses.module.css | |||
@@ -4,6 +4,10 @@ | |||
4 | * SPDX-License-Identifier: MIT | 4 | * SPDX-License-Identifier: MIT |
5 | */ | 5 | */ |
6 | 6 | ||
7 | .link { | ||
8 | white-space: nowrap; | ||
9 | } | ||
10 | |||
7 | .icon { | 11 | .icon { |
8 | vertical-align: text-top; | 12 | vertical-align: text-top; |
9 | width: 1em; | 13 | width: 1em; |
diff --git a/src/components/licenses.tsx b/src/components/licenses.tsx index f038b5f..85b0cb2 100644 --- a/src/components/licenses.tsx +++ b/src/components/licenses.tsx | |||
@@ -15,7 +15,7 @@ export type LicenseLinkProps = LinkProps & { label?: string }; | |||
15 | 15 | ||
16 | export function LicenseLink({ children, label, ...props }: LicenseLinkProps) { | 16 | export function LicenseLink({ children, label, ...props }: LicenseLinkProps) { |
17 | return ( | 17 | return ( |
18 | <Link {...props}> | 18 | <Link className={styles.link} {...props}> |
19 | <Certificate weight="bold" aria-hidden="true" className={styles.icon} /> | 19 | <Certificate weight="bold" aria-hidden="true" className={styles.icon} /> |
20 | <span className="sr-only">{label ?? 'License'}: </span> | 20 | <span className="sr-only">{label ?? 'License'}: </span> |
21 | {children} | 21 | {children} |
@@ -29,7 +29,7 @@ export function MITLicenseLink() { | |||
29 | 29 | ||
30 | export function CCLicenseLink({ children, label, ...props }: LicenseLinkProps) { | 30 | export function CCLicenseLink({ children, label, ...props }: LicenseLinkProps) { |
31 | return ( | 31 | return ( |
32 | <Link {...props}> | 32 | <Link className={styles.link} {...props}> |
33 | <CreativeCommonsIcon className={styles.icon} hidden /> | 33 | <CreativeCommonsIcon className={styles.icon} hidden /> |
34 | <span className="sr-only">{label ?? 'Creative Commons license'}: </span> | 34 | <span className="sr-only">{label ?? 'Creative Commons license'}: </span> |
35 | {children} | 35 | {children} |
@@ -51,7 +51,7 @@ export function ClosedAccessLink({ | |||
51 | ...props | 51 | ...props |
52 | }: LicenseLinkProps) { | 52 | }: LicenseLinkProps) { |
53 | return ( | 53 | return ( |
54 | <Link {...props}> | 54 | <Link className={styles.link} {...props}> |
55 | <Lock weight="bold" aria-hidden="true" className={styles.icon} /> | 55 | <Lock weight="bold" aria-hidden="true" className={styles.icon} /> |
56 | <span className="sr-only">{label ?? 'Closed access'}: </span> | 56 | <span className="sr-only">{label ?? 'Closed access'}: </span> |
57 | {children} | 57 | {children} |
diff --git a/src/theme/Footer/Copyright.jsx b/src/theme/Footer/Copyright.jsx index 58afe0f..648bd42 100644 --- a/src/theme/Footer/Copyright.jsx +++ b/src/theme/Footer/Copyright.jsx | |||
@@ -12,6 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | import Link from '@docusaurus/Link'; | 14 | import Link from '@docusaurus/Link'; |
15 | import clsx from 'clsx'; | ||
15 | import React from 'react'; | 16 | import React from 'react'; |
16 | 17 | ||
17 | import { CCLicenseLink, LicenseLink } from '@site/src/components/licenses'; | 18 | import { CCLicenseLink, LicenseLink } from '@site/src/components/licenses'; |
@@ -25,7 +26,7 @@ export default function FooterCopyright({ copyright }) { | |||
25 | <CCLicenseLink | 26 | <CCLicenseLink |
26 | to="/license#content" | 27 | to="/license#content" |
27 | rel="license" | 28 | rel="license" |
28 | className={styles.link} | 29 | className={clsx(styles.link, styles['link--license'])} |
29 | > | 30 | > |
30 | CC-BY-4.0 | 31 | CC-BY-4.0 |
31 | </CCLicenseLink> | 32 | </CCLicenseLink> |
@@ -34,7 +35,11 @@ export default function FooterCopyright({ copyright }) { | |||
34 | code for this site | 35 | code for this site |
35 | </Link>{' '} | 36 | </Link>{' '} |
36 | is{' '} | 37 | is{' '} |
37 | <LicenseLink to="/license#code" rel="license" className={styles.link}> | 38 | <LicenseLink |
39 | to="/license#code" | ||
40 | rel="license" | ||
41 | className={clsx(styles.link, styles['link--license'])} | ||
42 | > | ||
38 | MIT | 43 | MIT |
39 | </LicenseLink> | 44 | </LicenseLink> |
40 | .<br /> | 45 | .<br /> |
diff --git a/src/theme/Footer/Copyright.module.css b/src/theme/Footer/Copyright.module.css index 8bae599..23f11aa 100644 --- a/src/theme/Footer/Copyright.module.css +++ b/src/theme/Footer/Copyright.module.css | |||
@@ -13,3 +13,7 @@ | |||
13 | /* Make links stand out from the text even in dark mode. */ | 13 | /* Make links stand out from the text even in dark mode. */ |
14 | --ifm-link-color: var(--ifm-color-emphasis-500); | 14 | --ifm-link-color: var(--ifm-color-emphasis-500); |
15 | } | 15 | } |
16 | |||
17 | .link--license { | ||
18 | white-space: nowrap; | ||
19 | } | ||