Skip to content

Commit

Permalink
feat(markdown): add CSS props for hyperlinks colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiarokh authored and LucyChyzhova committed Dec 13, 2023
1 parent 3592fd1 commit 4a0581e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/components/markdown/markdown.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* @prop --markdown-hyperlink-color: color of text for hyperlinks. Defaults to `--color-blue-dark`;
* @prop --markdown-hyperlink-color--hovered: color of text for hyperlinks when hovered. Defaults to `--color-blue-default`;
*/

@import './partial-styles/pre-code.scss';
@import './partial-styles/headings.scss';
@import './partial-styles/body-text.scss';
Expand Down
7 changes: 5 additions & 2 deletions src/components/markdown/partial-styles/_body-text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ p {

a {
transition: color 0.2s ease;
color: rgb(var(--color-blue-dark));
color: var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));
text-decoration: none;

&:hover {
color: rgb(var(--color-blue-default));
color: var(
--markdown-hyperlink-color--hovered,
rgb(var(--color-blue-default))
);
}
}

Expand Down

0 comments on commit 4a0581e

Please sign in to comment.