Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: WEB-627 Update link color #6205

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/css/admonition.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
border-left: 10px solid var(--ifm-alert-border-color);
}
.alert a {
text-decoration-color: var(--link-color);
text-decoration-color: var(--ifm-link-color);
}
.alert a:hover {
color: var(--ifm-link-hover-color) !important;
Expand Down
2 changes: 1 addition & 1 deletion src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ pre {
}

a {
color: var(--link-color);
color: var(--ifm-link-color);
}

.theme-doc-markdown > *:not(.top-section) a {
Expand Down
15 changes: 11 additions & 4 deletions src/css/theming.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
--header-bg-color: #ffffff;
--selection-bgd-color: #0c344b;
--white-color: #ffffff;
--link-color: #3182ce;
--ifm-link-color: #3182ce;
--ifm-menu-color-active: #3182ce;
--border-color: #e2e8f0;
--code-bgd-color: #f6f8fa;
--code-inline-bgd-color: #edf2f7;
Expand Down Expand Up @@ -207,7 +208,7 @@ html[data-theme="dark"] {
--header-bg-color: #1a202c;
--selection-bgd-color: #0c344b;
--white-color: #ffffff;
--link-color: #3182ce;
--ifm-link-color: #43BAEC;
--code-bgd-color: #1A202C;
--code-inline-bgd-color: #2d3748;
--list-bullet-color: #a0aec0;
Expand Down Expand Up @@ -309,7 +310,8 @@ html[data-theme="dark"] {
--header-bg-color: #ffffff;
--selection-bgd-color: #0c344b;
--white-color: #ffffff;
--link-color: #3182ce;
--ifm-link-color: #3182ce;
--ifm-menu-color-active: #3182ce;
--border-color: #e2e8f0;
--code-bgd-color: #f6f8fa;
--code-inline-bgd-color: #edf2f7;
Expand Down Expand Up @@ -425,7 +427,8 @@ html[data-theme="dark"] {
--header-bg-color: #1a202c;
--selection-bgd-color: #0c344b;
--white-color: #ffffff;
--link-color: #3182ce;
--ifm-link-color: #43BAEC;
--ifm-menu-color-active: #43BAEC;
--ifm-link-hover-color: #5196d7;
--code-bgd-color: #1A202C;
--code-inline-bgd-color: #2d3748;
Expand Down Expand Up @@ -476,3 +479,7 @@ html[data-theme="dark"] {
--border-color: #2d3748;
--white-color: white;
}

html[data-theme="dark"] .external-link {
fill: pink;
}
2 changes: 1 addition & 1 deletion src/pages/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@

a,
button {
color: var(--link-color);
color: var(--ifm-link-color);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/theme/DocSidebarItem/Link/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

.active {
font-weight: 700;
color: rgb(49, 130, 206) !important;
}

[data-theme="light"] .active:hover {
Expand Down
14 changes: 14 additions & 0 deletions src/theme/MDXComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,19 @@ const NavigationLinksContainer: React.FC<React.PropsWithChildren> = ({ children
return <>{children}</>;
};

const ExternalIcon = () => <svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 12 12"
>
<path
color="inherit"
fill="currentColor"
d="M6 1h5v5L8.86 3.85 4.7 8 4 7.3l4.15-4.16zM2 3h2v1H2v6h6V8h1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"
/>
</svg>

const StyledLink: React.FC<React.PropsWithChildren<ComponentProps<"a">>> = ({
children,
...props
Expand All @@ -150,6 +163,7 @@ const StyledLink: React.FC<React.PropsWithChildren<ComponentProps<"a">>> = ({
return (
<a {...props} target="_blank" rel="openeer noreferrer" className={clsx(props.className, styles.externalLink)}>
{children}
<ExternalIcon />
</a>
);
};
Expand Down
8 changes: 3 additions & 5 deletions src/theme/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@

.externalLink {
position: relative;
background-position: center right;
background-repeat: no-repeat;
background-size: 0.857em;
padding-right: 1em;
background-image: url("/icons/external-link.svg");
display: inline-flex;
align-items: center;
gap: 3px;
}
Loading