There are a few ways to control how your links will look: through a variable, a mixin, or a class added to an element.
The default link colors for a site are generated based off of the @highlight-color
variable, but can be redefined using the following variables:
@primary-link-color: @highlight-color; @primary-link-color-visited: @highlight-color; @primary-link-color-hover: lighten(@highlight-color-desaturated, 13%); @primary-link-color-active: lighten(@highlight-color-desaturated, 13%); @primary-link-color-focus: lighten(@highlight-color-desaturated, 13%);
To change more than the default link colors, use the .mt-primary-link-style
mixin to add additional declarations. The default code in Expert is:
.mt-primary-link-style { color: @primary-link-color; &:visited { color: @primary-link-color-visited; } .no-touch &:hover { color: @primary-link-color-hover; } &:active { color: @primary-link-color-active; } &:focus { color: @primary-link-color-focus; outline: @primary-link-color dotted 1px; } }
Here is the same mixin redefined in the Custom Site CSS with an underline that appears on hover. You do not need to redefine the color declaration if you'd like to keep them. This mixin rule set will only add to the existing one.
.mt-primary-link-style { .no-touch &:hover { text-decoration: underline; } }
The .no-touch
class selector is used to define the :hover
pseudo class for non-touch screen devices only since it is not required otherwise.
Primary links, the most common links in your site that usually exist inside your content areas, use the @highlight-color variable to remain consistent with your the color theme.
This mixin will generate all of the pseudo classes that go along with your links.
.mt-primary-link-style { color: @primary-link-color; &:visited { color: @primary-link-color-visited; } .no-touch &:hover { color: @primary-link-color-hover; } &:active { color: @primary-link-color-active; } &:focus { color: @primary-link-color-focus; outline: @primary-link-color dotted 1px; } }
There is a CSS class selector that can be used to call in the Mixin. You will need to add a class to your HTML for this to work.
// Example of adding the class "mt-primary-link" to a link in your HTML <a class="mt-primary-link" href="http://mindtouch.com">www.mindtouch.com</a>
Secondary links, typically used for elements that do not need to stand out from their content, are used for Article Feedback buttons, drop-downs, select menus, and other secondary controls.
This mixin will generate all of the pseudo classes that go along with your links.
.mt-secondary-link-style { color: @secondary-link-color; &:visited { color: @secondary-link-color-visited; } .no-touch &:hover { color: @secondary-link-color-hover; } &:active { color: @secondary-link-color-active; } &:focus { color: @secondary-link-color-focus; } }
There is a CSS class selector that can be used to call in the Mixin. You will need to add a class to your HTML for this to work.
// Example of adding the class "mt-secondary-link" to a link in your HTML <a class="mt-secondary-link" href="http://mindtouch.com">www.mindtouch.com</a>
Tertiary links, used least often, can be found in the TOC expand/collapse toggle, the page settings toggle, and a few admin-only features. By default, tertiary links have the least contract compared to surrounding text.
This mixin will generate all of the pseudo classes that go along with your links.
.mt-tertiary-link-style { color: @tertiary-link-color; &:visited { color: @tertiary-link-color-visited; } .no-touch &:hover { color: @tertiary-link-color-hover; } &:active { color: @tertiary-link-color-active; } &:focus { color: @tertiary-link-color-focus; } }
There is a CSS class selector that can be used to call in the Mixin. You will need to add a class to your HTML for this to work.
// Example of adding the class "mt-tertiary-link" to a link in your HTML <a class="mt-tertiary-link" href="http://mindtouch.com">www.mindtouch.com</a>
For links just within content areas (not navigation) to appear underlined, add the following code to custom CSS in the Control Panel:
/* underline content links */ .mt-content-container a { text-decoration: underline; } .mt-listing-detailed a, .mt-listings-simple a, .mt-sortable-listing a { text-decoration: none; }