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

              
                <div class="page">
	<p>
		Often we need to use a "Read more" link for articles or other blocks. Usually a links design isn't creative. Just changing of color text. Maybe it's time to change it? 
	</p>
	<a href="#0" class="r-link link text-underlined">read more</a>
</div>
              
            
!

CSS

              
                
/*
=====
DEPENDENCIES
=====
*/

.r-link{
	display: var(--rLinkDisplay, inline-flex) !important;
}

.r-link[href]{
	color: var(--rLinkColor) !important;
	text-decoration: var(--rLinkTextDecoration, none) !important;
}

.text-underlined{
    /*
        1. I use pixels units because others units (em, rem, vw, vh, etc) can
        lead to the mistake of displaying a circumcised line
    */

    --uiTextUnderlinedLineHeight: var(--textUnderlinedLineHeight, 2px); /* 1 */
    --uiTextUnderlinedLineGap: var(--textUnderlinedLineGap, .5rem);
    --uiTextUnderlinedPaddingBottom: calc(var(--uiTextUnderlinedLineHeight) + var(--uiTextUnderlinedLineGap));

    padding-bottom: var(--uiTextUnderlinedPaddingBottom) !important;
    position: var(--textUnderlinedPosition, relative) !important;
		z-index: var(--textUnderlinedZindex, 1) !important;
}

.text-underlined::after{
    content: "";
    width: var(--textUnderlinedLineWidht, 100%) !important;
    height: var(--uiTextUnderlinedLineHeight) !important;
		background-image: var(--textUnderlinedBackgroundImage, linear-gradient(to top, var(--textUnderlinedLineColor, currentColor) 30%, rgba(0, 0, 0, 0) 45%)) !important;

    position: absolute;
    left: var(--textUnderlinedLineLeft, 0) !important;
    bottom: var(--textUnderlinedLineBottom, 0) !important;
		z-index: var(--textUnderlinedLineZindex, -1) !important;
}

/*
=====
CORE
=====
*/

.link{
	--textUnderlinedLineHeight: 100%;
	--textUnderlinedLineGap: 0;
	--textUnderlinedLineColor: #fed330;
	
	padding-left: .75rem;
	padding-right: .75rem;
}

.link::after{
	will-change: width;
	transition: width .1s ease-out;
	transform: rotate(-2deg);
	transform-origin: left bottom;
}

.link:hover{
	--textUnderlinedLineWidht: 0;
}

.link:hover::after{
	transition-duration: .15s;
}

/*
* These styles for text decoration. The demo will be work without it
*/

.link{
	font-weight: 700;
	text-transform: uppercase;
}

.link:focus{
	outline: 2px solid #fed330;
	outline-offset: .5rem;
}

/*
=====
DEMO
=====
*/

:root{
	--rLinkColor: #222;
}

body{
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Open Sans, Ubuntu, Fira Sans, Helvetica Neue, sans-serif;
	display: flex;
	height: 100vh;
}

.page{
	box-sizing: border-box;
	width: 100%;
	max-width: 25rem;
	padding: 1rem;
	margin: auto;
	flex: none;
}

p{
	line-height: 1.6785;
	font-family: georgia, serif;
}

              
            
!

JS

              
                
              
            
!
999px

Console