Skip to content

Commit d55af1e

Browse files
committed
fix(css): add css for view page as markdown
1 parent 3f98a22 commit d55af1e

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

src/theme/EditThisPage/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Translate from "@docusaurus/Translate";
33
import { ThemeClassNames } from "@docusaurus/theme-common";
44
import Link from "@docusaurus/Link";
55
import type { Props } from "@theme/EditThisPage";
6+
import styles from "./styles.module.css";
67

78
function ExternalIcon({ className }: { className?: string }) {
89
return (
@@ -29,14 +30,17 @@ function ExternalIcon({ className }: { className?: string }) {
2930

3031
export default function EditThisPage({ editUrl }: Props): ReactNode {
3132
return (
32-
<Link to={editUrl} className={ThemeClassNames.common.editThisPage}>
33+
<Link
34+
to={editUrl}
35+
className={`${ThemeClassNames.common.editThisPage} ${styles.editThisPageLink}`}
36+
>
3337
<Translate
3438
id="theme.common.editThisPage"
3539
description="The link label to view the raw source for the current page"
3640
>
3741
View page as Markdown
3842
</Translate>
39-
<ExternalIcon />
43+
<ExternalIcon className={styles.externalIcon} />
4044
</Link>
4145
);
4246
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.editThisPageLink,
2+
.editThisPageLink:visited {
3+
color: var(--ifm-font-color-base);
4+
text-decoration: none;
5+
transition: color var(--ifm-transition-fast)
6+
var(--ifm-transition-timing-default);
7+
}
8+
9+
.editThisPageLink:hover,
10+
.editThisPageLink:focus-visible {
11+
color: var(--ifm-color-primary);
12+
text-decoration: none;
13+
}
14+
15+
[data-theme="dark"] .editThisPageLink:hover,
16+
[data-theme="dark"] .editThisPageLink:focus-visible {
17+
color: var(--ifm-color-primary-lighter);
18+
}
19+
20+
.externalIcon {
21+
margin-left: 0.3em;
22+
vertical-align: text-bottom;
23+
stroke: currentColor;
24+
transition: color var(--ifm-transition-fast)
25+
var(--ifm-transition-timing-default);
26+
}

0 commit comments

Comments
 (0)