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.

              <div style="width:360px; margin:50px auto">
  <a href="" class="c-card
     c-card--event       c-card--brand-music">
  <div class="c-card__image">
    <div class="o-image" style="padding-top: 59.7765%;"><img itemprop="image" src="" alt="A picture of four children all in red t-shirts having fun at the Summer Music Camp event." class="o-image__full  isLoaded">
        class="o-image__preview" style="background-image: url(&quot;data:image/gif;base64,R0lGODlhAwADALMAAKw6NMS6tLReVMRORNzW1KRGPMy6vLxqZMROTP///wAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAkALAAAAAADAAMAAAQHkARzxChgRAA7&quot;);"></div>
  <h3 class="c-card__title h-text--h5">Summer Music Camp</h3>
    <p class="c-card__badge o-badge h-text--badge">HAC Highlight </p>
  <h4 class="c-card__datetime"><time datetime="2019-07-25T10:30:00+01:00" itemprop="startDate">Thu 25</time> – <time datetime="2019-07-31T18:00:00+01:00" itemprop="endDate">Wed 31 Jul</time></h4>
  <p class="c-card__tags h-text--label"><span class="h-accessibility">Categories: </span><span class="c-card__tag c-tag">Music /&nbsp;</span><span class="c-card__tag c-tag">Family</span> </p>
    <span class="c-card__action o-button">
      Info / Book

 * Name         : Card
 * Description  : Cards are the main media object. Lay these out ASAP.
 * State        : green

.c-card {
   //list all possible  elements  of card
  @include grid-template(image, title, badge, tags, summary, datetime, action);
  // layout  
  display: grid;
  grid-gap: $b/2;
  height: 100%; //stretch to row height because our cards don't know they are in a parent grid
  grid-template-rows: min-content min-content 1fr 1fr;
  grid-template-columns: 1fr min-content;
      "image     image"
      "title     title"
      "datetime  datetime"
      "tags      action";
  // styles per element
  &__image { overflow: hidden }
  &__title {
    transition: color 0.4s;

    @include on-event(false, ".c-card") {
      color: color(brand, _500);
      text-decoration: underline;
  &__datetime { @include text--page-date }
  &__tags { margin: auto auto 0 0 }
  &__badge { grid-area: image;}
  &__action {
    margin: auto 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    @include on-event(false, ".c-card") {
      background: color(black, _500);
      color: color(white, _500);
      border-color: color(black, _500);

 * Variants
 * Types of cards: here only event and class

// 1. event
.c-card {
  &--event, &--class {
    padding-bottom: $b/2;
    border-bottom: 5px solid;
  // 2. classes is same as event but the colors are only class colour (green)
  &--class {
    border-color: color(brand-classes, _500);

// colours like panels
@each $color, $color-map in $colors {
  .c-card--#{$color} {
    // color : color(white, _500);
    border-color: map-get($color-map, _500) !important;

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