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

Links a href #140

Open
mhulse opened this issue Mar 31, 2018 · 1 comment
Open

Links a href #140

mhulse opened this issue Mar 31, 2018 · 1 comment

Comments

@mhulse
Copy link
Owner

mhulse commented Mar 31, 2018

a {
    color: #00e;
    text-decoration: none;
}
a:visited {
    color: #551a8b;
}
a:visited:hover,
a:hover,
a:focus,
a:focus:hover,
a:active,
a:active:hover {
    color: #e00;
    text-decoration: underline;
}

Recommended order is:

  1. Link
  2. Visited
  3. Hover
  4. Focus
  5. Active

Star wars fans can remember it as: Lord Vader’s Handle Formerly Annakin

With the above example in mind, I generally write my link styles like so:

a,
a:visited {
    color: red;
    text-decoration: none;
}
a:visited:hover,
a:hover,
a:focus,
a:focus:hover,
a:active,
a:active:hover {
    color: blue;
    text-decoration: underline;
}

Note: a and a:link are synonymous and :link can be omitted (though, their specificity is different: 1 and 2 respectively).

@mhulse mhulse added README and removed README labels Mar 31, 2018
@mhulse mhulse added the Links label May 1, 2018
@mhulse mhulse changed the title Links Links a href Oct 8, 2019
@mhulse
Copy link
Owner Author

mhulse commented Nov 6, 2019

SCSS template for default, hover, focus, pressed and disabled states:

.button {

    // Default:
    &,
    &:visited {
    }
    // Hover:
    &:visited:hover,
    &:hover {
    }
    // Focus:
    &:focus,
    &:focus:hover {
    }
    // Pressed:
    &:active,
    &:active:hover {
    }
    // Disabled:
    &:disabled,
    &.button-is-disabled {
    }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant