Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <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