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

              
                - var ctn = [{title: 'Design basics', description: 'Get an overview of app design and an introduction to Fluent Design.' }, { title: 'Style', description: 'Make your app stand out. Learn how to effectively use color, typography, and acrylic to define your app’s personality.'}, {title: 'Motion', description: 'Use motion to add polish to your app.'}, {title: 'Layout', description: 'Design an app that looks great on a variety of devices and screen sizes.'}, {title: 'Controls and patterns', description: 'From radio buttons to navigation controls, we provide all the building blocks you need to create a UI.'}, {title: 'Shell', description: 'Create tiles and notifications.'}, {title: 'Input and interactions', description: 'Customize your app for specific types of inputs, such as the pen and Surface Dial.'}, {title: 'Devices', description: 'Optimize your app for specific devices.'}, {title: 'Usability', description: 'Make your app more inclusive and accessible to people around the world.'}, {title: 'Design toolkits and samples', description: 'Jumpstart your project with design templates, tools, and samples.'}];

p Hover over the icons to see a cool effect
#grid
  each tenant in ctn
    a
      .img
        span
        span
        span
        span
        img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/172299/" + tenant.title.replace(/ /g, '_').toLowerCase()+".png")
      span.title=tenant.title
      span.description=tenant.description
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700');
html, body {
  margin: 0;
  background-color: #f2f2f2;
  height: 100%;
  font-family: 'Open Sans', system-ui;
}
p {
  text-align: center;
  font-weight: 700;
}
.img {
  span {
    width: 50%;
    height: 50%;
    position: absolute;
    &:first-child, &:nth-child(2) {
      top: 0;
    }
    &:first-child, &:nth-child(3) {
      left: 0;
    }
    &:nth-child(2), &:nth-child(4) {
      right: 0;
    }
    &:nth-child(3), &:nth-child(4) {
      bottom: 0;
    }
  }
}

#grid {
  display: grid;
  grid-template-columns: repeat(3, 33%);
  grid-gap: 10px;
  grid-auto-rows: minmax(100px, auto);
  width: 75vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  > a {
    position: relative;
    transform-style: preserve-3d;
    &:hover {
      cursor: pointer;
      .title:after {
        background-position: 0% 100%;
      }
    }
    .img {
      width: 100%;
      position: relative;
      > span {
        z-index: 2;
        & ~ img {
          z-index: 1;
          transition: 0.2s;
          width: 100%;
        }
        &:first-child:hover ~ img {
          transform: perspective(600px) rotateX(10deg) rotateY(-10deg);
        }
        &:nth-child(2):hover ~ img {
          transform: perspective(600px) rotateX(10deg) rotateY(10deg);
        }
        &:nth-child(3):hover ~ img {
          transform: perspective(600px) rotateX(-10deg) rotateY(-10deg);
        }
        &:nth-child(4):hover ~ img {
          transform: perspective(600px) rotateX(-10deg) rotateY(10deg);
        }
      }
    }
    .title {
      font-weight: 400;
      font-size: 1.1rem;
      position: relative;
      &:after {
        content: '';
        display: block;
        position: absolute;
        width: 100%;
        height: 2px;
        bottom: -2.5px;
        left: 0;
        background-image: linear-gradient(to right, #005AB7 50%, transparent 50%);
        background-size: 200% 100%;
        background-position: 99%;
        transition: 0.2s;
      }
    }
    .description {
      font-size: 0.8rem;
      margin-top: 0.3rem;
      display: block;
    }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console