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

              
                <!-- yup i don't like haml too but for demo -->

%div.o-wrap
  %h1 OOCSS
  %div.o-pack.o-pack--responsive
    - (1..16).each do |i|
      %div.o-pack__item.c-button.c-button--ghost 
        #{i}

%div.o-wrap
  %h1 FUCSS
  %div{class: "flex flex-col flex-row@sm"}
    - (1..16).each do |i|
      -#first
      - if (i==1)
        %div{class:"u-b-r-t-4w u-b-r-l-w4@sm u-b-r-l-w4 u-z-index-1-hover btn-skeleton u-b-w1 u-b--solid u-color-blue u-bg-color-lightblue-hover u-color-white-hover u-b-color-pink-hover"}
          #{i}
      -#last
      - if (i != 1 and i==16)
        %div{class: "u-mt-n1 u-mt-0@sm u-lf-n1@sm u-b-r-r-w4 u-z-index-1-hover u-ml-n1 btn-skeleton u-b-w1 u-b--solid u-color-blue u-bg-color-lightblue-hover u-color-white-hover u-b-color-pink-hover"}
          #{i} 
      -# yup i don't know else if in haml shrug
      - if (i != 1 and i != 16)
        %div{class:"u-mt-n1 u-mt-0@sm u-lf-n1@sm u-z-index-1-hover u-ml-n1 btn-skeleton u-b-w1 u-b--solid u-color-blue u-bg-color-lightblue-hover u-color-white-hover u-b-color-pink-hover"}
          #{i}
       
              
            
!

CSS

              
                /* OOCSS */
.o-wrap{
  padding: 2rem 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.o-pack,
.o-pack__item{
  position: relative;
  display: flex;
}

.o-pack--responsive,
.o-pack--stacked-inline\@breakpoint{
  // done to avoid inheritance resets for the example
  
  @media (max-width: 719px){
    flex-direction: column;
    .o-pack__item{
      &:first-child { border-radius: 4px 4px 0px 0px; }
      &:last-child  { border-radius: 0px 0px 4px 4px; }
      &:not(:first-child):not(:last-child) { border-radius: 0 }
      &:not(first-child) { margin-top: -1px }
    }
  }
  
  @media (min-width: 720px){
    flex-direction: row;
    .o-pack__item{
      &:first-child { border-radius: 4px 0px 0px 4px; }
      &:last-child  { border-radius: 0px 4px 4px 0px; }
      &:not(:first-child):not(:last-child) { border-radius: 0 }
      &:not(first-child) { margin-left: -1px }
    }
  }
  
  // avoid border beeing under the siblings
  .o-pack__item:hover{
    z-index: 1;
  }
}




/*Button*/
.c-button{
  appearance: none;
  display: inline-block;
  height: 40px;
  line-height: 40px;
  padding: 0 1rem;
}

.c-button--ghost{
  border: 1px solid blue;
  border-radius: 4px;
  color: blue;
  
  &:hover{background: lightblue; color: white; border-color: red;}
}



/* 
FCSS 

This is just an example, a bad one,
Look at tachycons if you want a good example
*/

.u-reset-appearance{ -webkit-appearnce: none}
/* I know this would'n be like this*/
.u-h-40 {height: 40px}
.u-lh-40{line-height: 40px}

// spacers
.u-mt-n1 {margin-top:-1px}
.u-ml-n1 {margin-left:-1px}
.u-mt-n1\@sm {
  @media (min-width: 720px){
    margin-lef: -1px;
  }
}
.u-mt-0\@sm {
  @media (min-width: 720px){
    margin-top: 0px;
  }
}
.u-ph-base{padding:{left: 1rem; right: 1rem}}

// I know mixins are beeter for performance, but i'll get the
.btn-skeleton {
  @extend .u-reset-appearance;
  @extend .u-h-40;
  @extend .u-lh-40;
  @extend .u-ph-base; 
}


/*
*/


.flex{ display: flex}
.flex-col{flex-direction: column}
.flex-row\@sm{ 
  @media (min-width: 720px) {
    flex-direction: row
  }
}

/*
  interaction transiton to other colors 
  is a bitch with utilities right?
  
  add to this active states,
  but of course a sass loop would solve this
*/
.u-bg-color-lightblue-hover{&:hover{background-color: lightblue}}
.u-color-blue{color: blue}
.u-color-blue-hover { &:hover{ color: blue }}
.u-color-pink {color: pink}
.u-color-pink-hover {&:hover{color: pink}}
.u-color-white-hover {&:hover{color: white}}
.u-bg-color-pink-hover {&:hover{background-color: pink}}
.u-b-pink {border-color: pink}
.u-b-w1 {border-width: 1px}
.u-b--solid {border-style: solid}
.u-b-r-0 {border-radius:0 }
.u-b-r-w4 {border-radius: 4px}
.u-b-color-pink-hover{&:hover {border-color: pink}}
.u-b-r-l-w4{border-radius: 4px 0px 0px 4px}
.u-b-r-r-w4{border-radius: 0px 4px 4px 0px}
.u-b-r-t-w4{border-radius: 4px 4px 0px 0px}
.u-b-r-b-w4{border-radius: 0px 0px 4px 4px}
.u-z-index-1-hover {&:hover{z-index: 1}}
              
            
!

JS

              
                
              
            
!
999px

Console