-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add option for separate link colours #1583
Comments
This topic can (and will) be revisited when implementing dark mode, as some more variables/branches could be necessary. |
Added in 1fc6af1#diff-84f37ad4f75d6bdb8cc32a1b513f5e65R65 as part of the dark mode branch. |
Released as part of 5.2.0! You can now set the link color with |
Would this be set within custom css? |
Yes, it is a CSS variable. |
I'm not quite sure how I would now implement this (I honestly assumed this to become an option in the mkdocs.yml) Like what css would I have to add/alter in order to display the link as a bright blue (cyan?) and make it brighter when hovering over it? |
we might add a tutorial on this in the future, but I currently don’t have the time to write one. There might also be some guidance on the tutorials branch, see open PRs. The issue itself is fixed, as the variable is now defined. |
I tried to add it now, but still are lost What I tried: body {
--md-text-link-color: #3498db;
} The above doesn't work. I did add it as extra_css and there's no other css files that would alter colors on any way. |
You need to understand CSS Specificity |
In your extra.css file, you'll need to add (for the color of the links) And then in mkdocs.yml (for color on hover) extra_css:
Hope it works :) I did it like this |
I checked that...
Description
It would be a nice addition to have two options to set a different colour for links and when hovering over them.
The available colours could just be the one already provided and it could default to either the primary or accent colour depending on what option is missing or invalid.
The reason is simple: Readability.
Depending on what colour theme (background colour) and primary/accent colours you have set are links barely readable.
This is especially the case when using links in inline code, as - depending on your modifications - the text becomes barely distinguishable from the code background.
I f.e. want to use indigo as primary colour, but due to me using css for having a dark theme is the link colour barely readable on inline code, forcing me to either customize the CSS (Which I'm not good at) or switch to a different, much brighter colour which I wouldn't like to do.
Use Cases
The aforementioned cases would apply here and I'm sure people would love to have a colour for links, different to the primary and accent colour set.
Screenshots / Mockups
Colour indigo while using a dark theme:
Colour yellow without any custom CSS:
The text was updated successfully, but these errors were encountered: