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.

            
              <svg style="display: none;">
        <symbol viewBox="0 0 32 32" id="offer" xmlns="http://www.w3.org/2000/svg">
            <path d="M28,11.66a4.61,4.61,0,0,0-4.6-3.8l-.52-2.95A2.32,2.32,0,0,0,20.16,3a2.42,2.42,0,0,0-1.11.52L15.78,6.33a5.77,5.77,0,0,1-2.7,1.27L6.23,8.8a3.93,3.93,0,0,0-3.17,4.54L4,18.59a3.91,3.91,0,0,0,4.53,3.18l1-.18.68,3.82h0a2.88,2.88,0,1,0,5.67-1l-.67-3.81.18,0h0a5.78,5.78,0,0,1,3,.27l4,1.49a2.31,2.31,0,0,0,3-1.36,2.24,2.24,0,0,0,.11-1.2l-.51-2.94a4.63,4.63,0,0,0,3-5.16ZM13.29,26.37a1.49,1.49,0,0,1-1.71-1.2l-.67-3.82,2.88-.51.68,3.82a1.47,1.47,0,0,1-1.18,1.7Zm10.45-5.54a.88.88,0,0,1-.88.16l-4-1.49a7.11,7.11,0,0,0-3.71-.33l-6.84,1.2a2.51,2.51,0,0,1-2.9-2l-.93-5.26a2.52,2.52,0,0,1,2-2.9L13.33,9a7.16,7.16,0,0,0,3.36-1.58L20,4.63h0a.9.9,0,0,1,1.27.12.81.81,0,0,1,.19.41l.63,3.53v.06l1.36,7.66v0a0,0,0,0,0,0,0L24.05,20h0a.88.88,0,0,1-.31.84Zm.94-5.44L23.6,9.27a3.2,3.2,0,0,1,1.08,6.12Z"/>
        </symbol>
        <symbol viewBox="0 0 32 32" id="home" xmlns="http://www.w3.org/2000/svg">
            <path d="M24.85,12.89v11c0,.5,0,1,0,1.52v0l.88-.88h-7l.87.88V19.6A7.42,7.42,0,0,0,19.48,18a3.51,3.51,0,0,0-2.83-2.72,3.66,3.66,0,0,0-2.23.35A3.43,3.43,0,0,0,13,17.08a3.54,3.54,0,0,0-.44,1.71v6.6l.88-.88h-7l.88.88v-11c0-.51,0-1,0-1.53v0a.88.88,0,0,0-1.76,0v11c0,.5,0,1,0,1.52v0a.89.89,0,0,0,.88.88h7.05a.89.89,0,0,0,.88-.88V19.47a7.34,7.34,0,0,1,0-1l0,.23a2.34,2.34,0,0,1,.18-.64l-.09.21a2.38,2.38,0,0,1,.23-.45l.07-.09c.08-.13-.16.18,0,0s.11-.13.17-.18l.17-.16c.15-.12-.1.07-.05,0l.12-.07a3.09,3.09,0,0,1,.44-.24l-.21.09a2.74,2.74,0,0,1,.64-.17l-.23,0a2.89,2.89,0,0,1,.72,0l-.23,0a2.74,2.74,0,0,1,.64.17l-.21-.09a3.21,3.21,0,0,1,.45.24l.09.06c.13.09-.18-.15,0,0l.18.17a1.29,1.29,0,0,1,.16.17c.12.14-.07-.1,0-.05a.76.76,0,0,1,.08.11,2.64,2.64,0,0,1,.23.44L17.63,18a2.52,2.52,0,0,1,.18.65l0-.24a6.76,6.76,0,0,1,0,.9v6.08a.9.9,0,0,0,.88.88h7.05a.89.89,0,0,0,.88-.88v-11c0-.51,0-1,0-1.52v0a.87.87,0,0,0-.88-.88.89.89,0,0,0-.87.88Z"/>
            <path id="Path_34" data-name="Path 34" d="M4.49,15.61l1.2-1.11,2.87-2.66L12,8.63l3-2.77c.49-.45,1-.89,1.46-1.35l0,0H15.24L16.47,5.6l3,2.66L23,11.46l3.08,2.78,1.5,1.35,0,0a.88.88,0,1,0,1.26-1.22l0,0L27.6,13.26l-3-2.66L21.08,7.39,18,4.62c-.5-.45-1-.91-1.5-1.35l0,0a.9.9,0,0,0-1.24,0L14,4.36,11.17,7l-3.45,3.2L4.73,13c-.49.45-1,.89-1.46,1.35l0,0a.88.88,0,0,0,0,1.24.9.9,0,0,0,1.24,0Z"/>
        </symbol>
        <symbol viewBox="0 0 32 32" id="courses" xmlns="http://www.w3.org/2000/svg">
            <path id="np_chat_1659587_000000" data-name="np chat 1659587 000000" d="M5.27,5A1.19,1.19,0,0,0,4.09,6.2v7.53l-2,3.13a.58.58,0,0,0,.17.82.56.56,0,0,0,.33.1H4.09v.48a1.18,1.18,0,0,0,1.18,1.19H7.93v3.36A1.2,1.2,0,0,0,9.12,24H26.67a1.2,1.2,0,0,0,1.19-1.21v-.57h1.49a.6.6,0,0,0,.6-.59.64.64,0,0,0-.1-.33l-2-3.06V10.65a1.19,1.19,0,0,0-1.19-1.19H24V6.2A1.19,1.19,0,0,0,22.83,5Zm0,1.19H22.83V18.26H5.27V17.19a.59.59,0,0,0-.59-.6h-1l1.5-2.38a.62.62,0,0,0,.09-.32V6.2ZM7.89,8.57a.59.59,0,0,0-.48.69.61.61,0,0,0,.54.5H20.13a.6.6,0,0,0,.62-.57.59.59,0,0,0-.57-.62H7.89ZM24,10.65h2.66v7.8a.52.52,0,0,0,.09.32l1.48,2.28h-1a.58.58,0,0,0-.59.59h0v1.19H9.12V19.45H22.83A1.2,1.2,0,0,0,24,18.26Zm-16.13.89A.6.6,0,0,0,8,12.73H20.13a.59.59,0,0,0,.62-.57.59.59,0,0,0-.57-.62H7.89Zm0,3a.61.61,0,0,0-.49.69.61.61,0,0,0,.55.5h7.13a.6.6,0,1,0,.05-1.19H7.89Z" style="isolation: isolate"/>
        </symbol>
        <symbol viewBox="0 0 32 32" id="categories" xmlns="http://www.w3.org/2000/svg">
            <path id="np_lesson_269257_000000" data-name="np lesson 269257 000000" d="M27.55,21.5H26.5V6.83a.78.78,0,0,0-.78-.78H6.39a.78.78,0,0,0-.78.78V21.5h-1V6.83A1.83,1.83,0,0,1,6.39,5H25.72a1.84,1.84,0,0,1,1.83,1.83Zm-2.62-.57h4.18V22H24.93ZM3,20.93H21.54v1H3Zm16-6.61,8.11,11.53-.85.6L18.1,14.92ZM9.53,12.05H22.58v1h-13Zm0-2.61H22.58v1h-13Zm0,5.22H15v1.05H9.53Z" style="isolation: isolate"/>
        </symbol>
        <symbol viewBox="0 0 32 32" id="search" xmlns="http://www.w3.org/2000/svg">
            <path id="np_search_2043599_000000" data-name="np search 2043599 000000" d="M21.74,20.33a10.58,10.58,0,1,0-1.41,1.41L27.58,29,29,27.59Zm-8.16,1.85a8.6,8.6,0,1,1,8.59-8.6A8.6,8.6,0,0,1,13.58,22.18Z"/>
        </symbol>
    </svg>
    <header class="site-header">
        <div class="container site-header__wrapper">
            <picture class="logo">
                <source srcset="https://ishadeed.com/logo-full.svg" media="(min-width: 880px)">
                <img src="https://ishadeed.com/logo-small.svg" />
            </picture>
            <nav class="main-nav">
                <button class="main-nav__toggle" aria-label="Menu">
                    <span class="main-nav__toggle__icon"></span>
                </button>
                <ul>
                    <li class="main-nav__item is-active">
                        <a href="#">
                            <svg width="24" height="24">
                                <use xlink:href="#home"></use>
                            </svg>
                             Home
                        </a>
                    </li>
                    <li class="main-nav__item">
                        <a href="#">
                            <svg width="24" height="24">
                                <use xlink:href="#courses"></use>
                            </svg>
                             Courses
                        </a>
                    </li>
                    <li class="main-nav__item">
                        <a href="#">
                            <svg width="24" height="24">
                                <use xlink:href="#offer"></use>
                            </svg>
                             Offers
                        </a>
                    </li>
                    <li class="main-nav__item">
                        <a href="#">
                            <svg width="24" height="24">
                                <use xlink:href="#categories"></use>
                            </svg>
                            Categories <span class="pill">New</span>
                        </a>
                    </li>
                </ul>
            </nav>
            <div class="site-header__section">
                <button class="search-form__toggle">
                    <span class="visually-hidden">Search</span>
                    <svg class="search-form__icon" width="24" height="24">
                        <use xlink:href="#search"></use>
                    </svg>
                </button>
                <form class="search-form">
                    <label for="search"></label>
                    <input type="search" name="" id="search" placeholder="What do you want to learn?">
                    <button class="search-form__button">
                        <span class="visually-hidden">Search</span>
                        <svg class="search-form__icon" width="24" height="24">
                            <use xlink:href="#search"></use>
                        </svg>
                    </button>
                </form>
                <a href="link-to-profile/" class="user-avatar">
                    <img class="avatar" src="https://ishadeed.com/shadeed.jpg" alt="Ahmad Shadeed">
                </a>
            </div>
        </div>
    </header>
            
          
!
            
              :root {
  --color-brand-primary: #06aed5; }

body {
  margin: 0;
  font-family: 'Roboto', sans-serif; }

* {
  box-sizing: border-box; }

ul {
  list-style: none;
  padding: 0;
  margin: 0; }

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

.visually-hidden {
  position: absolute;
  overflow: hidden;
  clip: rect(0 0 0 0);
  height: 1px;
  width: 1px;
  margin: -1px;
  padding: 0;
  border: 0; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%; }

.pill {
  background: var(--color-brand-primary);
  color: #fff;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
  border-radius: 20px;
  font-weight: 700;
  padding: 3px 7px; }

.site-header {
  position: relative;
  padding: 0 16px;
  box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.05);
  background-color: #fff;
  background-image: linear-gradient(to right, #07859D, #079EBA);
  background-size: 100% 5px;
  background-repeat: no-repeat;
  padding-top: 5px; }

.site-header__wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap; }
  @media (max-width: 570px) {
    .site-header__wrapper {
      padding: 0.5rem 0;
      justify-content: space-between; } }

@media (max-width: 570px) {
  .main-nav {
    order: -1; } }

.main-nav ul {
  display: flex;
  height: 100%; }
  @media (max-width: 570px) {
    .main-nav ul {
      position: absolute;
      left: 0;
      right: 0;
      top: 100%;
      display: block;
      height: initial;
      background: whitesmoke;
      -webkit-transform: translateY(-100%);
              transform: translateY(-100%);
      z-index: -1;
      visibility: hidden;
      transition: 0.3s ease-out; }
      .main-nav ul.is-active {
        visibility: visible;
        -webkit-transform: translateY(0);
                transform: translateY(0); } }

.main-nav__item a {
  display: block;
  padding: 16px 12px;
  text-align: center;
  border-bottom: 2px solid transparent; }
  @media (min-width: 1250px) {
    .main-nav__item a {
      padding: 20px 24px; } }
  @media (max-width: 570px) {
    .main-nav__item a {
      text-align: initial;
      border-bottom: 0;
      border-left: 3px solid transparent; } }
  .main-nav__item a:hover {
    border-bottom-color: var(--color-brand-primary);
    color: var(--color-brand-primary); }
.main-nav__item svg {
  display: none;
  vertical-align: middle;
  width: 26px;
  height: 26px;
  fill: #639fb4; }
  @media (min-width: 1150px) {
    .main-nav__item svg {
      display: inline-block; } }
  @media (max-width: 570px) {
    .main-nav__item svg {
      display: inline-block; } }
.main-nav__item.is-active a {
  color: var(--color-brand-primary);
  border-bottom-color: currentColor;
  font-weight: 700; }
.main-nav__item.is-active svg {
  fill: currentColor; }
  @media (max-width: 1150px) {
    .main-nav__item.is-active svg {
      display: inline-block;
      margin-top: -4px; } }
@media (max-width: 570px) {
  .main-nav__item.is-active a {
    border-left-color: var(--color-brand-primary); } }
@media (max-width: 570px) {
  .main-nav__item:not(:last-child) {
    border-bottom: 1px solid #e1e0e0; } }

.user-avatar img {
  width: 36px;
  height: 36px; }

.logo {
  display: flex;
  align-items: center;
  margin-right: 16px; }
  .logo img {
    position: relative;
    top: -3px; }
  @media (max-width: 570px) {
    .logo {
      margin-right: 0;
      margin-left: 16px; } }

.site-header__section {
  display: flex;
  justify-content: flex-end;
  flex: 1;
  margin-left: auto; }
  .site-header__section > * + * {
    margin-left: 8px; }
  @media (max-width: 570px) {
    .site-header__section {
      margin-left: initial;
      flex: initial; } }

.search-form {
  position: relative;
  transition: -webkit-transform 0.3s ease-out;
  transition: transform 0.3s ease-out;
  transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out; }
  @media (max-width: 700px) {
    .search-form {
      position: absolute;
      left: 0;
      right: 0;
      top: 100%;
      z-index: -1;
      padding: 8px;
      background: #06aed5;
      margin-left: 0;
      visibility: hidden;
      -webkit-transform: translateY(-100%);
              transform: translateY(-100%); }
      .search-form.is-active {
        visibility: visible;
        -webkit-transform: translateY(0);
                transform: translateY(0); } }
  .search-form input {
    display: inline-block;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
    width: 100%;
    background-color: #f7f7F7;
    border: 0;
    border-radius: 50px;
    font-size: 16px;
    padding: 9px 38px 10px 16px;
    transition: 0.3s ease-out; }
    .search-form input:focus {
      background-color: var(--color-brand-primary);
      color: #fff; }
    @media (max-width: 700px) {
      .search-form input {
        background-color: #fff; } }

.search-form:focus-within .search-form__icon {
  fill: #fff; }

.search-form__button {
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: 0;
  background: transparent;
  position: absolute;
  right: 0;
  top: 0;
  width: 38px;
  height: 100%; }
  @media (max-width: 700px) {
    .search-form__button {
      height: initial;
      right: 10px;
      top: 50%;
      -webkit-transform: translateY(-50%);
              transform: translateY(-50%); } }

.search-form__icon {
  width: 22px;
  flex: 0 0 22px;
  height: 22px;
  fill: #858585; }

.search-form__toggle {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  width: 38px;
  height: 38px;
  background-color: #f7f7F7;
  border: 0;
  border-radius: 50%;
  display: none; }
  @media (max-width: 700px) {
    .search-form__toggle {
      display: block; } }
  .search-form__toggle.is-active {
    background: var(--color-brand-primary); }
    .search-form__toggle.is-active svg {
      fill: #fff; }

.main-nav__toggle {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  width: 38px;
  height: 38px;
  background-color: #f7f7F7;
  border: 0;
  border-radius: 50%;
  display: none; }
  @media (max-width: 570px) {
    .main-nav__toggle {
      display: block; } }
  .main-nav__toggle.is-active {
    background-color: var(--color-brand-primary); }
    .main-nav__toggle.is-active .main-nav__toggle__icon {
      background: transparent; }
      .main-nav__toggle.is-active .main-nav__toggle__icon:before, .main-nav__toggle.is-active .main-nav__toggle__icon:after {
        background-color: #fff; }
      .main-nav__toggle.is-active .main-nav__toggle__icon:before {
        -webkit-transform-origin: right top;
                transform-origin: right top;
        -webkit-transform: rotate(-45deg) translate(-2px, -4px);
                transform: rotate(-45deg) translate(-2px, -4px); }
      .main-nav__toggle.is-active .main-nav__toggle__icon:after {
        -webkit-transform-origin: left bottom;
                transform-origin: left bottom;
        -webkit-transform: rotate(45deg) translate(-8px, -11px);
                transform: rotate(45deg) translate(-8px, -11px); }

.main-nav__toggle__icon {
  position: relative;
  display: block;
  height: 2px;
  background: #858585;
  border-radius: 2px; }
  .main-nav__toggle__icon:after, .main-nav__toggle__icon:before {
    content: "";
    position: relative;
    display: block;
    width: 100%;
    height: 2px;
    background: #858585;
    border-radius: 2px;
    transition: 0.2s ease-out; }
  .main-nav__toggle__icon:after {
    top: 4px; }
  .main-nav__toggle__icon:before {
    top: -6px; }

            
          
!
            
              var searchToggle = document.querySelector('.search-form__toggle');
        var searchForm = document.querySelector('.search-form');
        var navToggle = document.querySelector('.main-nav__toggle');
        var navList = document.querySelector('.main-nav ul');

        searchToggle.addEventListener('click', function(){
            this.classList.toggle('is-active');
            searchForm.classList.toggle('is-active');
            navList.classList.remove('is-active');
            navToggle.classList.remove('is-active');
        });

        navToggle.addEventListener('click', function () {
            this.classList.toggle('is-active');
            navList.classList.toggle('is-active');
            searchForm.classList.remove('is-active');
            searchToggle.classList.remove('is-active');
        });
            
          
!
999px
🕑 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.

Console