css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

            
              section.content
  h1.content__heading Send Me a Message
  p.content__lede Use this handy contact form to get in touch with me.

  form.content__form.contact-form

    .contact-form__input-group
      input#salutation-mr.contact-form__input.contact-form__input--radio(
        name="salutation"
        type="radio"
        value="Mr."
      )
      label.contact-form__label.contact-form__label--radio(
        for="salutation-mr"
      ) Mr.
      input#salutation-mrs.contact-form__input.contact-form__input--radio(
        name="salutation"
        type="radio"
        value="Mrs."
      )
      label.contact-form__label.contact-form__label--radio(
        for="salutation-mrs"
      ) Mrs.
      input#salutation-ms.contact-form__input.contact-form__input--radio(
        name="salutation"
        type="radio"
        value="Ms."
      )
      label.contact-form__label.contact-form__label--radio(
        for="salutation-ms"
      ) Ms.

    .contact-form__input-group
      label.contact-form__label(
        for="name"
      ) Full Name
      input#name.contact-form__input.contact-form__input--text(
        name="name"
        type="text"
      )

    .contact-form__input-group
      label.contact-form__label(
        for="email"
      ) Email Address
      input#email.contact-form__input.contact-form__input--email(
        name="email"
        type="email"
      )

    .contact-form__input-group
      label.contact-form__label(
        for="subject"
      ) How can I help you?
      select#subject.contact-form__input.contact-form__input--select(
        name="subject"
      )
        option I have a problem.
        option I have a general question.

    .contact-form__input-group
      label.contact-form__label(
        for="message"
      ) Enter a Message
      textarea#message.contact-form__input.contact-form__input--textarea(
        name="message"
        rows="6"
        cols="65"
      )

    .contact-form__input-group
      p.contact-form__label--checkbox-group Please send me:
      input#snacks-pizza.contact-form__input.contact-form__input--checkbox(
        name="snacks"
        type="checkbox"
        value="pizza"
      )
      label.contact-form__label.contact-form__label--checkbox(
        for="snacks-pizza"
      ) Pizza
      input#snacks-cake.contact-form__input.contact-form__input--checkbox(
        name="snacks"
        type="checkbox"
        value="cake"
      )
      label.contact-form__label.contact-form__label--checkbox(
        for="snacks-cake"
      ) Cake
      
    //- A hidden input to demonstrate that these are grabbed as well.
    input(
      name="secret"
      type="hidden"
      value="1b3a9374-1a8e-434e-90ab-21aa7b9b80e7"
    )

    button.contact-form__button(
      type="submit"
    ) Send It!

.results
  h2.results__heading Form Data
  pre.results__display-wrapper
    code.results__display

            
          
!
            
              @use postcss-nested;
@use postcss-cssnext;
@use postcss-simple-vars;

$color-lightest: #f9fdfe;
$color-gray-light: #cdcfcf;
$color-gray-medium: #686a69;
$color-gray-dark: #414643;
$color-darkest: #2a2f2c;

/* A simple reset. */
*,::before,::after {
  margin: 0;
  box-sizing: border-box;
}
  
/* Heydon Pickering’s lobotomized owl. Details: https://bit.ly/1H7MXUD */
*+* {
  margin-top: 1rem;
}

/* Set up fonts, colors and all that jazz. */
body {
  background: $color-lightest;
  color: $color-gray-medium;
  font-family: 'Open Sans', sans-serif;
  font-size: 18px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings use a different font because they’re hipsters. */
h1,h2 {
  color: $color-darkest;
  font-family: Lato, sans-serif;
  font-weight: 300;
  line-height: 1.125;
}

/* Set up general layout rules for outer containers. */
.content,.results {
  width: 90vw;
  max-width: 550px;
  margin: 8vh auto;
}

.content {
  &__heading {
    font-size: 125%;
  }
  
  &__lede {
    margin-top: 0.5rem;
    font-size: 87.5%;
  }
}

.results {
  &__heading {
    font-size: 110%;
  }
  
  &__display-wrapper {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: $color-lightest;
    border: 1px solid $color-gray-light;
    overflow-x: scroll;
  }
}

.contact-form {
  position: relative;
  display: block;
  margin: 0;
  padding: 1rem 0 2rem;
  border-top: 1px solid $color-gray-light;
  border-bottom: 1px solid $color-gray-light;
  overflow: hidden;
  
  &__input-group {
    margin-top: 0.25rem;
    padding: 0.5rem 1rem;
  }
  
  &__label {
    display: block;
    color: $color-gray-dark;
    font-family: Lato, sans-serif;
    font-size: 75%;
    line-height: 1.125;
    
    &--checkbox-group {
      display: inline-block;
      margin-right: 1rem;
      font-size: 75%;
    }
    
    &--checkbox,&--radio {
      display: inline-block;
      margin-left: 0.25rem;
    }
  }
  
  &__input {
    display: block;
    margin-top: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid $color-gray-light;
    width: 100%;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    transition: 150ms border-color linear;
    
    &--checkbox,&--radio {
      display: inline-block;
      width: auto;
      
      &~& {
        margin-left: 1rem;
      }
    }
    
    &:focus,&:active {
      border-color: $color-gray-medium;
      outline: 0;
    }
  }
  
  &__button {
    display: block;
    margin: 0.5rem 1rem 0;
    padding: 0 1rem 0.125rem;
    background-color: $color-gray-medium;
    border: 0;
    color: $color-lightest;
    font-family: lato, sans-serif;
    font-size: 100%;
    letter-spacing: 0.05em;
    line-height: 1.5;
    text-transform: uppercase;
    transition: 150ms all linear;
    
    &:hover,&:active,&:focus {
      background: $color-darkest;
      cursor: pointer;
      outline: 0;
    }
  }
}

            
          
!
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.
Loading ..................

Console