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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
               <section class="u-bg--green">
	<p class="u-color--dark u-padding u-contained">
		Lorem ipsum dolor sit amet, consectetur adipiscing elit, <a href="#">sed do eiusmod tempor incididunt</a> ut labore et dolore magna aliqua. Aliquam sem fringilla ut morbi tincidunt. <a href="#">Maecenas accumsan</a> lacus vel facilisis. Posuere sollicitudin aliquam ultrices sagittis orci a scelerisque purus semper.
	</p>
</section>

<section class="u-bg--dark">
	<p class="u-color--grey u-padding u-contained">
		Lorem ipsum dolor sit amet, consectetur adipiscing elit, <a href="#">sed do eiusmod tempor incididunt</a> ut labore et dolore magna aliqua. Aliquam sem fringilla ut morbi tincidunt. <a href="#">Maecenas accumsan</a> lacus vel facilisis. Posuere sollicitudin aliquam ultrices sagittis orci a scelerisque purus semper.
	</p>
</section>

<section class="u-bg--light">
	<p class="u-color--dark u-padding u-contained">
		Lorem ipsum dolor sit amet, consectetur adipiscing elit, <a href="#">sed do eiusmod tempor incididunt</a> ut labore et dolore magna aliqua. Aliquam sem fringilla ut morbi tincidunt. <a href="#">Maecenas accumsan</a> lacus vel facilisis. Posuere sollicitudin aliquam ultrices sagittis orci a scelerisque purus semper.
	</p>
</section>

<section style="background-color: #fff; color: #000;">
	<p class="u-padding u-contained">
		What happens if you don't use utility classes to apply the colours? <a href="#">See for yourself!</a> All that you need to do is define a sensible default for your variables.
	</p>
</section>
            
          
!

CSS

            
              html {
	// Set default colors
	--bg: #fff;
	--c: #000;
}

// Define a named list of our colors
$colors: (
	'green': #08ffc8,
	'light': #fff7f7,
	'grey': #dadada,
	'dark': #204969
);

// Loop over each color, where $n is the name (or key), $c is the color value
@each $n, $c in $colors {
	.u-color--#{$n} {
    --c: #{$c};
    color: #{$c};
	}

	.u-bg--#{$n} {
    --bg: #{$c};
    background-color: #{$c};
	}
}

// Define our default link style
a {
	// Styles for older browsers	
	text-decoration: underline;
	color: inherit;
	
	&:hover,
	&:focus,
	&:active {
		text-decoration: none;
		outline: .0625em solid currentColor;
		outline-offset: .0625em;
	}
	
	&:active {
    outline-width: .125em;
	}

	@supports (--a: b) {
		--space: .125em;
		--link-color: currentColor;
		--bg-size: var(--space);
		--shadow-size: 0;
    
    padding: var(--space); // Inline elements won't affect vertical rhythm, so we don't need to specify each direction
		
		color: var(--link-color); // Use the variable for our color
		text-decoration: none; // Remove the default underline
		
    border-radius: var(--space); // Make it a tiny bit fancier ✨
    background-image: linear-gradient(var(--c, currentColor), var(--c, currentColor));
    background-repeat: repeat-x;
    background-position: 0 100%;
    background-size: 100% var(--bg-size);
    box-shadow: 0 0 0 var(--shadow-size, 0) var(--c, currentColor); // Used in the :active state
    box-decoration-break: clone; // Ensure the styles repeat on links spaning multiple lines
    
    transition-property: color, background-size, box-shadow;
    transition-duration: 150ms;
    transition-timing-function: ease-in-out;
    will-change: color, background-size, box-shadow;
	  
		&:link,
    &:visited {
			--link-color: var(--c, currentColor); // Use --c, or fallback to currentColor
		}
    
    &:hover,
    &:focus,
    &:active {
      --bg-size: 100%;
      --link-color: var(--bg);
			outline: none; // Remove the fallback style
    }
    
    &:active {
      --shadow-size: var(--space); // Define the box-shadow size
    }
	}
}

// Other utility classes
.u-contained {
  max-width: 60ch;
  margin: 0 auto;
}

.u-padding { padding: 1rem; }

// Resets…
* { 
  margin: 0;
  line-height: 1.4em;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}
            
          
!

JS

            
              
            
          
!
999px

Console