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

            
              <main class="flow">
    <h1>Unrelated components with <b>flow</b></h1>
    <section class="sketchy media">
        <img class="media__img" src="https://source.unsplash.com/collection/139386/600x400" alt="A heck of a nice cat" />
        <article class="media__content flow">
            <h2>Cats are cool and here’s why</h2>
            <p>Those long whiskers around your cats’ mouth and face which form a vital part of their sense of touch. These whiskers are attached to nerve cells and are used to judge the size of openings as well as providing your cat information about everything he/she touches, as well as shifts in air pressure.</p>
        </article>
    </section>
    <section class="flow features">
        <h2>Need more reasons why cats are cool?</h2>
        <ul class="features__list">
            <li class="feature sketchy">
                <div class="feature__decor" aria-hidden="true"></div>
                <p class="feature__content">Cats can retract their front claws. This keeps them sharp so they can be used for climbing and of course, as effective weapons!</p>
            </li>
            <li class="feature sketchy">
                <div class="feature__decor" aria-hidden="true"></div>
                <p class="feature__content">Cats can travel at speeds of up to 30km per hour.</p>
            </li>
            <li class="feature sketchy">
                <div class="feature__decor" aria-hidden="true"></div>
                <p class="feature__content">Around 75% of cats respond to catnip. This herb stimulates those cats that are genetically programmed to respond.</p>
            </li>
        </ul>
    </section>
    <footer>
        <p>Facts <i>borrowed</i> from <a href="https://www.purina.com.au/cats/care/facts">Purina</a>.</p>
    </footer>
</main>
            
          
!

CSS

            
              /* Looking for the flow utility? Here's the pen: https://codepen.io/hankchizljaw/pen/MzLrGw */

.sketchy {
    padding: 2rem;
    border: 3px solid #333333;
    border-radius: 2% 6% 5% 4% / 1% 1% 2% 4%;
    background: #ffffff;
    position: relative;    
    line-height: 1.4;
}


.sketchy::before {
    content: '';
    border: 2px solid #353535;
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0) scale(1.015) rotate(0.5deg);
    border-radius: 1% 1% 2% 4% / 2% 6% 5% 4%;
}

/* Media component */
.media {
    --flow-space: 4rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.media__img {
    width: 16rem;
    flex-shrink: 0;
}

.media__content {
    padding: 1rem 0 0 0;
}

/* Features grid */
.features {
    --flow-space: 2.5rem;
}

.features__list {
    --flow-space: 1.5rem;
    display: grid;
    list-style: none;
    margin-left: 0;
    margin-bottom: 0;
    padding: 0;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    grid-gap: 1rem 2.5rem;
}

.feature {
    position: relative;
}

.feature__decor {
    width: 5rem;
    height: 5rem;
    background: #1dd1a1;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    position: relative;
}

.feature__decor::after {
    content: "✓";
    font-size: 2.5rem;
    line-height: 1;
    color: #ffffff;
    display: block;
    width: 100%;
    text-align: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

/* Push the footer _right_ down */
footer {
    --flow-space: 5rem;
}

/* Media query adjustments */
@media all and (min-width: 35rem) {
    .media {
        flex-wrap: nowrap;
    }
    
    .media__content {
        padding: 0 0 0 2rem;
    }
    
    .features__list {
        grid-template-columns: repeat(3, minmax(16.5rem, 1fr));
    }
}
            
          
!

JS

            
              
            
          
!
999px

Console