Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                # This is <a href="https://github.com/paulradzkov/links.less">links.less</a> module demo by <a href="http://paulradzkov.com">Paul Radzkov</a>

What it does:

* sets color and tiny underline for `:link`, `:visited`, `:hover`, `:focus`, `:visited:hover`, `:visited:focus` and `&:active` states
* adds animation on unhover
* adds frame and background-color for `:focus`

Test it:

1. Hover with cursor on links
2. Navigate though links with `Tab` or `Shift + Tab` keys

------
<blockquote>
    <h1>
        <a class="link" href="https://github.com/paulradzkov" target="_blank">GitHub</a>
        <a class="link" href="https://codepen.io/paulradzkov/" target="_blank">Codepen</a>
        <a class="link" href="https://www.linkedin.com/in/paulradzkov" target="_blank">LinkedIn</a>
        <a class="link" href="https://twitter.com/paul_radzkov" target="_blank">Twitter</a>
        <a class="link" href="https://toster.ru/user/paulradzkov" target="_blank">Toster.ru</a>
        <a class="link" href="https://www.instagram.com/paulradzkov/" target="_blank">Instagram</a>
        <a class="link" href="https://xyz/" target="_blank">secret</a>
    </h1>
    <h2><a href="#">inline-block long link example for testing multiline links behaviour</a></h2>
</blockquote>
------

Made to save time on styling links. See [https://github.com/paulradzkov/links.less]() on how to use and customize it.

Default colors apply to all links and classnames `.link`, `.link-novisited`, `.link-inherit`.

Custom `:focus` styles and animation apply only to links that has no class attribute (`a:not[class]`) and `.link`, `.link-novisited`, `.link-inherit`.

### `.link`

Use `.link` to apply styles to any tag:

```html
<a class="mytag link" href="#">customized link</span>
<span class="link" tabindex="0">pseudolink</span>
<button class="link">button</button>
```

------
<p>
<a class="mytag link" href="#">customized link</a>
<span class="link" tabindex="0">pseudolink</span>
<button class="link">button</button>
</p>
------

### `.link-novisited`

Links with class `.link-novisited` never look like :visited. Good for navigation for example.

```html
<nav>
    <a class="link-novisited" href="https://www.google.com/">google</a>
    <a class="link-novisited" href="https://github.com/">github</a>
    <a class="link-novisited" href="https://codepen.io/">codepen</a>
</nav>
```

------
<nav>
    <a class="link-novisited" href="https://www.google.com/">google</a>
    <a class="link-novisited" href="https://github.com/">github</a>
    <a class="link-novisited" href="https://codepen.io/">codepen</a>
</nav>
------

### `.link-inherit`

Links with class `.link-inherit` use same color as parent element for :link and :visited states. Good if you want to make links in footer less prominent.

```html
<footer style="color:#999">
    © <a class="link-inherit" href="http://paulradzkov.com">Paul Radzkov</a> 2017.
</footer>
```

------
<footer style="color:#999">
    © <a class="link-inherit" href="http://paulradzkov.com">Paul Radzkov</a> 2017.
</footer>
------
              
            
!

CSS

              
                /*! links.less v0.0.5 | MIT License | github.com/paulradzkov/links.less */

.links-settings() {
    @links-class: link; //you can rename that classname
    @links-text-decoration: underline;
    @links-roundness: 0.125em;   // default = 2px
    @links-focuswidth: 0.1875em; // default = 3px
    //colors
    @links-link:          #0877db;
    @links-hover:         #2b9aff;
    @links-visited:       #9108db;
    @links-visitedhover:  #bc4df8;
    @links-active:        #bc4df8;
    @links-fadeout: 75%;
    //animation
    @links-aniduration: .3s; //fading duration from hover
}

// global coloring mixin
.links-color(@links-link) {
    @fadeout: 75%;

    &,
    &:link,
    &:visited,
    &:hover,
    &:focus,
    &:visited:hover,
    &:visited:focus,
    &:active {
        color: @links-link;
        & when (iscolor(@links-link)) {
            text-decoration-color: fadeout(@links-link, @fadeout);
        }
    }
}

.links-color(@links-link, @links-hover) {
    @fadeout: 75%;

    &,
    &:link,
    &:visited {
        color: @links-link;
        & when (iscolor(@links-link)) {
            text-decoration-color: fadeout(@links-link, @fadeout);
        }
    }

    &:hover,
    &:focus,
    &:visited:hover,
    &:visited:focus,
    &:active {
        color: @links-hover;
        & when (iscolor(@links-hover)) {
            text-decoration-color: fadeout(@links-hover, @fadeout);
        }
    }
}

.links-color(@links-link, @links-hover, @links-visited) {
    @fadeout: 75%;

    &,
    &:link {
        color: @links-link;
        & when (iscolor(@links-link)) {
            text-decoration-color: fadeout(@links-link, @fadeout);
        }
    }

    &:visited,
    &:active {
        color: @links-visited;
        & when (iscolor(@links-visited)) {
            text-decoration-color: fadeout(@links-visited, @fadeout);
        }
    }

    &:hover,
    &:focus,
    &:visited:hover,
    &:visited:focus {
        color: @links-hover;
        & when (iscolor(@links-hover)) {
            text-decoration-color: fadeout(@links-hover, @fadeout);
        }
    }
}

.links-color(@links-link, @links-hover, @links-visited, @links-active) {
    @fadeout: 75%;

    &,
    &:link {
        color: @links-link;
        & when (iscolor(@links-link)) {
            text-decoration-color: fadeout(@links-link, @fadeout);
        }
    }

    &:visited {
        color: @links-visited;
        & when (iscolor(@links-visited)) {
            text-decoration-color: fadeout(@links-visited, @fadeout);
        }
    }

    &:hover,
    &:focus,
    &:visited:hover,
    &:visited:focus {
        color: @links-hover;
        & when (iscolor(@links-hover)) {
            text-decoration-color: fadeout(@links-hover, @fadeout);
        }
    }

    &:active {
        color: @links-active;
        & when (iscolor(@links-active)) {
            text-decoration-color: fadeout(@links-active, @fadeout);
        }
    }
}

.links-color(@links-link, @links-hover, @links-visited,  @links-visitedhover, @links-active, @fadeout: 75%) {

    &,
    &:link {
        color: @links-link;
        & when (iscolor(@links-link)) {
            text-decoration-color: fadeout(@links-link, @fadeout);
        }
    }

    &:visited {
        color: @links-visited;
        & when (iscolor(@links-visited)) {
            text-decoration-color: fadeout(@links-visited, @fadeout);
        }
    }

    &:hover,
    &:focus {
        color: @links-hover;
        & when (iscolor(@links-hover)) {
            text-decoration-color: fadeout(@links-hover, @fadeout);
        }
    }

    &:visited:hover,
    &:visited:focus {
        color: @links-visitedhover;
        & when (iscolor(@links-visitedhover)) {
            text-decoration-color: fadeout(@links-visitedhover, @fadeout);
        }
    }

    &:active {
        color: @links-active;
        & when (iscolor(@links-active)) {
            text-decoration-color: fadeout(@links-active, @fadeout);
        }
    }
}

@links-render: {

    a,
    .@{links-class},
    .@{links-class}-novisited,
    .@{links-class}-inherit {
        text-decoration: @links-text-decoration;
        text-decoration-line: @links-text-decoration;
        text-decoration-style: solid;
        text-decoration-skip: ink;

        img:only-child {
            vertical-align: top;
        }
    }

    a:not([class]),
    .@{links-class} {
        .links-color(@links-link, @links-hover, @links-visited,  @links-visitedhover, @links-active, @links-fadeout);
    }

    .@{links-class}-novisited {
        .links-color(@links-link, @links-hover, @links-link,  @links-hover, @links-active, @links-fadeout);
    }

    .@{links-class}-inherit {
        .links-color(inherit, @links-hover, inherit, @links-visitedhover, @links-active, @links-fadeout);
    }

    // apply animation only for .link* and unstyled links
    .@{links-class},
    .@{links-class}-novisited,
    .@{links-class}-inherit,
    a:not([class]) {

        &,
        &:link,
        &:visited {
            border-radius: @links-roundness;
            transition:
                color                 @links-aniduration ease-out,
                background-color      @links-aniduration ease-out,
                border-color          @links-aniduration ease-out,
                box-shadow            @links-aniduration ease-out,
                text-decoration-color @links-aniduration ease-out;
        }

        &:hover {
            transition:
                color                 0s,
                background-color      0s,
                border-color          0s,
                box-shadow            0s,
                text-decoration-color 0s;
        }

        // apply custom focus for keyboard navigation
        &:focus {
            background: fadeout(@links-hover, 80%);
            box-shadow: 0 0 0 @links-focuswidth fadeout(@links-hover, 80%);
            outline: none;
        }
    }

    .@{links-class}:not(a),
    .@{links-class}-novisited:not(a),
    .@{links-class}-inherit:not(a) {
        cursor: pointer;
        background-color: unset;
        border-style: unset;
        padding: unset;
    }

    .links-settings();
};

@links-render();

              
            
!

JS

              
                
              
            
!
999px

Console