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 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

              
                nav
    ol.main-menu
        li.main-item
            span.home
        li.main-item
            span.about
        li.main-item
            span.widgets
            ol.sub-menu
                each size in ['small', 'standart', 'big']
                    li.sub-item.item-left
                        span(class= size)
        li.main-item
            span.kabobs
            ol.sub-menu
                each category in ['premium', 'combo', 'special']
                    li.sub-item.item-right
                        span(class= category)
        li.main-item
            span.contact
|
|
a.me(href='https://codepen.io/uzcho_/pens/popular/?grid_type=list' target='_blank')
              
            
!

CSS

              
                :root{
    --z24: translateZ(24.5px);
    --z80: translateZ(80px);
    --ts: all .5s ease;
    --x90: rotateX(90deg);
    --xm90: rotateX(-90deg);
    --y90: rotateY(90deg);
    --ym90: rotateY(-90deg);
}

nav{
    @include _relative-box($n, $n, 16px 16px 0 16px, 100%, $n);
    position: $rl
}

ol{
    @include _relative-box($n, 0, 0, 100%, $n);
    list-style-type: $no
}

.main-menu{
    @include _flexbox($rl, $rw, $n, $n, $c)
}

li{
    width: 160px;
    position: $rl;
    cursor: pointer;
    span{
        @include _dimension(100%, 49px);
        @include _layout($bl, $rl, $n);
        transition: var(--ts);
        transform-style: preserve-3d;
        #{$bfaf}{
            @include _relative-box($n, $n, 16px 0, 100%, $n);
            @include _layout($bl, $ab, $n);
            border-radius: 8px;
            @include _text($n, 400 14px 'Consolas', $c);
            text-transform: uppercase
        }
    }
}

.main-item:nth-of-type(2),
.main-item:nth-of-type(4){
    margin: 0 2px
}

.main-item:nth-of-type(3)::before,
.main-item:nth-of-type(4)::before{
    width: 100%;
    top: 25px;
    @include _layout($bl, $ab, $n);
    @include _text(#fff, 400 24px 'Consolas', $c);
    transition: var(--ts);
    z-index: 100;
    content: '\0025BE'
}

.main-item{
    &:hover > span{
        transform: var(--x90)
    }
    > span{
        #{$bf}{
            background: #000;
            color: #fff;
            transform: var(--z24);
            box-shadow: 0 8px 6px -6px #888
        }
        #{$af}{
            background: #ff9900;
            transform: var(--xm90) var(--z24)
        }
    }
}

$menus: home, about, widgets, kabobs, contact;
@each $menu in $menus{
    .#{$menu}{
        #{$bfaf}{
            content: '#{$menu}'
        }
    }
}

.sub-menu{
    top: 51px;
    @include _layout($no, $ab, $n);
    li{
        opacity: 0;
        transform: translateY(-10px);
        &:nth-of-type(2){
            margin: 2px 0
        }
    }
}

@for $i from 1 through 3{
    .sub-item:nth-of-type(#{$i}){
        animation: fade .5s ease ($i * .2s) both
    }
}

@include _keyframes(fade, to){
    opacity: 1;
    transform: translateY(0)
}

.sub-item span{
    #{$bf}{
        background: #008080;
        color: #fff;
        transform: var(--z80)
    }
    #{$af}{
        background: #bc003b;
        color: #fff
    }
}

.item-left{
    &:hover span{
        transform: var(--y90)
    }
    span::after{
        transform: var(--ym90) var(--z80)
    }
}

.item-right{
    &:hover span{
        transform: var(--ym90)
    }
    span::after{
        transform: var(--y90) var(--z80)
    }
}

$sizes: small, standart, big;
@each $size in $sizes{
    .#{$size}{
        #{$bfaf}{
            content: '#{$size + ' ' + 'widgets'}'
        }
    }
}

$categories: premium, combo, special;
@each $category in $categories{
    .#{$category}{
        #{$bfaf}{
            content: '#{$category + ' ' + 'kabobs'}'
        }
    }
}

.main-item:nth-of-type(3):hover,
.main-item:nth-of-type(4):hover{
    #{$bf}{
        color: #000;
        content: '\0025B4'
    }
    .sub-menu{
        display: $bl
    }
}

@media screen and (min-width: 321px) and (max-width: 839px){
	nav{
        width: 320px;
        margin: 0 auto
    }
}

@media (max-width: 839px){
    .main-item:nth-of-type(2),
    .main-item:nth-of-type(4){
        margin: 3px 0
    }
    .sub-menu{
        position: $rl;
        top: 1px;
        padding: 2px 0 1px 0;
        li{
            span{
                #{$bf}{
                    transform: var(--z24)
                }
                #{$af}{
                    transform: rotateY(0deg) var(--x90) var(--z24)
                }
            }
            &:hover span{
                transform: var(--xm90)
            }
        }
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console