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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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="admin">
    <header class="admin__header">
        <a href="#" class="logo">
            <h1>Dashboard</h1>
        </a>
        <div class="toolbar">
            <div class="toolbar__left">
                <button class="btn btn--primary">Add content</button>
            </div>
            <div class="toolbar__right">
              <a href="#" class="btn btn--primary logout">Log Out</a>
            </div>
        </div>
    </header>
    <nav class="admin__nav">
        <ul class="menu">
            <li class="menu__title">Dashboard</li>
            <li class="menu__item">
                <a class="menu__link" href="#">Dashboard</a>
            </li>
            <li class="menu__item">
                <a class="menu__link" href="#">Performance</a>
            </li>
<!--             <li class="menu__divider"></li>             -->
            <li class="menu__title">Content</li>
            <li class="menu__item">
                <a class="menu__link" href="#">Media</a>
            </li>
            <li class="menu__item">
                <a class="menu__link" href="#">Templates</a>
            </li>
<!--             <li class="menu__divider"></li> -->
            <li class="menu__title">Network</li>
            <li class="menu__item">
                <a class="menu__link is-active" href="#">Players</a>
            </li>
            <li class="menu__item">
                <a class="menu__link" href="#">Channels</a>
            </li>
            <li class="menu__item">
                <a class="menu__link" href="#">Domains</a>
            </li>
<!--             <li class="menu__divider"></li> -->
            <li class="menu__title">Account</li>
            <li class="menu__item">
                <a class="menu__link" href="#">Account Details</a>
            </li>
            <li class="menu__item">
                <a class="menu__link" href="#">Account Settings</a>
            </li>
<!--             <li class="menu__divider"></li> -->
            <li class="menu__title">Help</li>
            <li class="menu__item">
                <a class="menu__link" href="#">Documentation</a>
            </li>
            <li class="menu__item">
                <a class="menu__link" href="#">Changelogs</a>
            </li>
        </ul>
    </nav>
    <main class="admin__main">
        <div class="dashboard">
            <div class="dashboard__item">
                <div class="card">
                    <div class="card__header">
                        Players
                    </div>
                    <div class="card__content">
                        <div class="card__item">
                            Lorem ipsum dolor sit amet consectetur adipisicing elit. Beatae ab libero consectetur et numquam a id. Dignissimos nesciunt aperiam ut minima itaque repudiandae architecto praesentium autem. Porro ad labore fugiat?
                        </div>
                    </div>
                </div>
            </div>
            <div class="dashboard__item dashboard__item--col">
                <div class="card">
                    <div class="card__header">
                        Memory
                    </div>
                    <div class="card__content">
                        <div class="card__item">
                            Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium labore id culpa sit nisi nostrum, excepturi cumque eos laborum ducimus alias, provident doloribus et facere explicabo ab repudiandae perferendis earum.
                        </div>
                    </div>
                </div>
            </div>
            <div class="dashboard__item dashboard__item--col">
                <div class="card">
                    <div class="card__header">
                        Disk usage
                    </div>
                    <div class="card__content">
                        <div class="card__item">
                            Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium labore id culpa sit nisi nostrum, excepturi cumque eos laborum ducimus alias, provident doloribus et facere explicabo ab repudiandae perferendis earum.
                        </div>
                    </div>
                </div>
            </div>
            <div class="dashboard__item dashboard__item--full">
                <div class="card">
                    <div class="card__header">
                        Card full width
                    </div>
                    <div class="card__content">
                        <div class="card__item">
                            Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium labore id culpa sit nisi nostrum, excepturi cumque eos laborum ducimus alias, provident doloribus et facere explicabo ab repudiandae perferendis earum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima dolore laudantium est, vel illo labore nostrum cupiditate perspiciatis, doloremque sit enim sequi, quasi cumque dolorum voluptate! Aliquam corrupti laboriosam nostrum. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Assumenda cupiditate porro dolores optio dicta tempora quas, culpa itaque, unde recusandae tempore. Voluptas quia perferendis est veritatis nobis, iusto voluptate dolor?
                        </div>
                    </div>
                </div>
            </div>
            <div class="dashboard__item dashboard__item--col">
                <div class="card">
                    <div class="card__header">
                        Card
                    </div>
                    <div class="card__content">
                        <div class="card__item">
                            Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium labore id culpa sit nisi nostrum, excepturi cumque eos laborum ducimus alias, provident doloribus et facere explicabo ab repudiandae perferendis earum.
                        </div>
                    </div>
                </div>
            </div>
            <div class="dashboard__item dashboard__item--col">
                <div class="card">
                    <div class="card__header">
                        Card
                    </div>
                    <div class="card__content">
                        <div class="card__item">
                            Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium labore id culpa sit nisi nostrum, excepturi cumque eos laborum ducimus alias, provident doloribus et facere explicabo ab repudiandae perferendis earum.
                        </div>
                    </div>
                </div>
            </div>
            <div class="dashboard__item dashboard__item--col">
                <div class="card">
                    <div class="card__header">
                        Card
                    </div>
                    <div class="card__content">
                        <div class="card__item">
                            Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium labore id culpa sit nisi nostrum, excepturi cumque eos laborum ducimus alias, provident doloribus et facere explicabo ab repudiandae perferendis earum.
                        </div>
                    </div>
                </div>
            </div>
            <div class="dashboard__item dashboard__item--col">
                <div class="card">
                    <div class="card__header">
                        Card
                    </div>
                    <div class="card__content">
                        <div class="card__item">
                            Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium labore id culpa sit nisi nostrum, excepturi cumque eos laborum ducimus alias, provident doloribus et facere explicabo ab repudiandae perferendis earum.
                        </div>
                    </div>
                </div>
            </div>
            <div class="dashboard__item dashboard__item--full">
                <div class="card">
                    <div class="card__header">
                        Card full width
                    </div>
                    <div class="card__content">
                        <div class="card__item">
                            Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium labore id culpa sit nisi nostrum, excepturi cumque eos laborum ducimus alias, provident doloribus et facere explicabo ab repudiandae perferendis earum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima dolore laudantium est, vel illo labore nostrum cupiditate perspiciatis, doloremque sit enim sequi, quasi cumque dolorum voluptate! Aliquam corrupti laboriosam nostrum. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Assumenda cupiditate porro dolores optio dicta tempora quas, culpa itaque, unde recusandae tempore. Voluptas quia perferendis est veritatis nobis, iusto voluptate dolor?
                        </div>
                    </div>
                </div>
            </div>
            <div class="dashboard__item dashboard__item--full">
                <div class="card">
                    <div class="card__header">
                        Card full width
                    </div>
                    <div class="card__content">
                        <div class="card__item">
                            Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium labore id culpa sit nisi nostrum, excepturi cumque eos laborum ducimus alias, provident doloribus et facere explicabo ab repudiandae perferendis earum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima dolore laudantium est, vel illo labore nostrum cupiditate perspiciatis, doloremque sit enim sequi, quasi cumque dolorum voluptate! Aliquam corrupti laboriosam nostrum. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Assumenda cupiditate porro dolores optio dicta tempora quas, culpa itaque, unde recusandae tempore. Voluptas quia perferendis est veritatis nobis, iusto voluptate dolor?
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>
    <footer class="admin__footer">
        <span>&copy; 2018 Company Inc.</span>
        <span><a href="#1" class="help">Ask for help</a></span>
    </footer>
</div>
              
            
!

CSS

              
                // Static Variables

$admin-header-height: 80px;
$admin-footer-height: 40px;
$admin-nav-width: 300px;

// Variables

:root {
    --bg-color: #e5e5e5;
    
    --bcn-orange: #f16a2d;
    --bcn-orange-light: #f9ae56;
    --bcn-orange-dark: #d96129;
    
    --black: #333;
    --white: #f5f5f5;
    
    --text-color: #555;
    
    --border-color: rgb(238,238,238);
    --border-style: 1px solid var(--border-color);
}

// Global CSS

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    height: 100%;
    overflow-x: hidden;
}

// Main Layout Grid

.admin {
    --spacing: 1rem;

    // Flexbox Fallback
    display: flex;
    flex-wrap: wrap;

    // Grid
    display: grid;
    height: 100vh;

    grid-template-rows: $admin-header-height 1fr $admin-footer-height;
    grid-template-columns: $admin-nav-width 1fr;
    grid-template-areas:
        "header header"
        "nav    main"
        "footer footer";

    &__header {
        display: flex;
        flex-basis: 100%;
        grid-area: header;
        height: $admin-header-height;
        background-color: #fff;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
        position: relative;
    }

    &__nav {
        flex: 0 0 $admin-nav-width;
        grid-area: nav;
        background-color: #313541;
    }

    &__main {
        flex: 1;
        grid-area: main;
        padding: var(--spacing);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        background-color: var(--bg-color);
    }

    &__footer {
        display: flex;
        grid-area: footer;
        flex-basis: 100%;
        justify-content: space-between;
        align-items: center;
        height: $admin-footer-height;
        padding: 0 var(--spacing);
        color: #4e5561;
        background-color: #1d2127;
    }

    @media screen and (min-width: 48rem) {
        --spacing: 2rem;
    }
}

// Dashboard Overview Grid

.dashboard {
    --column-count: 2;

    // Flexbox Fallback
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(var(--spacing) * -0.5);

    // Grid
    display: grid;
    grid-template-columns: repeat(var(--column-count), 1fr);
    grid-gap: var(--spacing);

    &__item {
        // By default, items span 2 columns
        flex: 1 1 50%;
        grid-column-end: span 2;
        padding: calc(var(--spacing) / 2);

        // these span the full width
        &--full {
            flex-basis: 100%;
            grid-column: 1 / -1;
        }

        // these span only one column
        &--col {
            flex-basis: calc(100% / var(--column-count));
            grid-column-end: span 1;
        }
    }

    // Switch to 4-col grid on larger screens
    @media screen and (min-width: 48rem) {
        --column-count: 4;
    }

    // If we have grid support, reset the margins and paddings;
    // grid-gap handles the spacing for us.
    @supports (display: grid) {
        margin: 0;

        &__item {
            padding: 0;
        }
    }
}

// ===============================
// Demo stuff to make it look nice
// ===============================

a {
    color: #dc5a60;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

.logo {
    display: flex;
    flex: 0 0 $admin-nav-width;
    height: $admin-header-height;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 0;
    color: #fff;
    background-color: var(--bcn-orange);
    font-size: 1rem;

    h1 {
        margin: 0;
    }
}

.toolbar {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing);
}

.menu {
    list-style-type: none;
    padding: 0;

    &__title {
        display: block;
        padding: 2rem 2rem .5rem;
        color: #76808f;
        font-weight: 700;
    }
    
    &__divider::before {
        content: "";
        display: block;
        width: calc(100% - 60px);
        height: 2px;
        margin: 30px 30px 40px;
        background-color: #76808f;
    }

    &__item {
    }

    &__link {
        display: block;
        padding: 10px 30px;
        color: #76808f;
        text-decoration: none;

        &.is-active {
            color: #fff;
            background-color: var(--bcn-orange-dark);
            border-left: 3px solid var(--bcn-orange);
        }
        
        &:hover,
        &:focus {
            color: currentcolor;
            background-color: var(--bcn-orange-light);
        }
    }
}

.card {
    height: 100%;
    font-weight: 300;
    background-color: #fff;
    border: 1px solid #e6eaee;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    &__header {
        padding: 20px 30px;
        border-bottom: 1px solid #e6eaee;
        font-weight: 700;
    }
    
    &__item {
        padding: 20px 30px;
    }
}

.btn {
    display: inline-block;
    border-radius: 5em;
    border: 0;
    padding: 0.5rem 1rem;
    white-space: nowrap;

    &--primary {
        color: #fff;
        background-color: #56bf89;
    }
}
              
            
!

JS

              
                // No JS
              
            
!
999px

Console