Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

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.

              <!-- :read-write -->
<section class="example-cntr read-write">
    <h1>CSS <code>:read-write</code> pseudo-class</h1>
    <p>The <code>:read-write</code> pseudo-class targets elements that <span class="underline">can</span> be edited by the user. It can work on elements that have the <code>contenteditable</code> HTML attribute as well.</p>
    <p>This pseudo-class can be combined with the <code>:focus</code> pseudo-class to enhance the UX under particular situations.</p>
    <p>In the following example, this DIV <span class="underline">can</span> be edited in the browser by clicking on it. Since this piece of content is editable by the user the UX can be enhanced by applying a particular styling that will differentiate it
        from the rest of the content and provide a visual cue to the user that the content can be edited:</p>
    <div class="editable" contenteditable>
        <h1>Click on this text to edit it</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad quod ducimus corporis iusto, ratione pariatur!</p>
.read-write {
    .editable {
        padding: 40px;
        font: 22px Garamond;
        color: lighten($g,30);
        outline: 1px transparent dashed;
        transition: .6s;
        &:read-write:focus {
            outline-color: white;
            font-style: italic;
    h1 { text-align: left; }

//Styling stuff not needed for demo
body {
    text-align: left;
    line-height: 1.5;
h1 {
    font-size: 22px;
    text-transform: none;
    border-bottom: #636363 1px dotted;
    code {
        display: inline-block;
        margin-bottom: 10px;
        color: $y;
        background: none;
        box-shadow: none;
code { font-size: 1em; }
.example-cntr {
    max-width: 800px;
    margin: 0 auto 50px;
    padding: 30px;
    box-shadow: 0 1px 2px rgba(black,.3);
    background: rgba(black,.15);
    & > code {
        display: block;
        margin-bottom: 10px;
        font-size: 22px;
        color: $y;
        background: none;
        box-shadow: none;
    & > h1 {
         text-align: center;
.flex-ctnr {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
small {
    display: block;
    margin: 20px 0 10px;
    padding-top: 10px;    
    text-align: center;
span {
    &.yellow {
        display: inline-block;
        font-weight: bold;
        font-size: 18px;
        text-shadow: 0 1px 0 #000;
.underline { text-decoration: underline; }
.red { color: $r; }
.green { color: $g; }
.yellow { color: $y; }
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.