cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <h1 class="title">
  Topcoat Tab Bar
</h1>
<p>
  Default style for Topcoat Tab Bar. 
  <br>
  Requirements are simple, portable, and extensibe markup and css.
  <br>
  No javascript
</p>

<div class="topcoat-tab-bar">
   <label class="topcoat-tab-bar__item">
     <input type="radio" name="topcoat" class="hide-input">
     <button class="topcoat-tab-bar__button">One</button>
   </label>
   <label class="topcoat-tab-bar__item">
     <input type="radio" name="topcoat">
     <button class="topcoat-tab-bar__button">Two</button>
   </label>
   <label class="topcoat-tab-bar__item">
     <input type="radio" name="topcoat">
     <button class="topcoat-tab-bar__button">Three</button>
   </label>
</div>

<div class="spacer">
  <hr>
</div>

<h2>Applying Sizing</h2>

<p>
  Topcoat separates layout and positioning from styling to make the components more reusable. 
  <br>
  The below example has the layout class `full` added to elements to show how sizing can be applied.
</p>
  
<div class="topcoat-tab-bar full">
   <label class="topcoat-tab-bar__item">
     <input type="radio" name="topcoat">
     <button class="topcoat-tab-bar__button full">One</button>
   </label>
   <label class="topcoat-tab-bar__item">
     <input type="radio" name="topcoat">
     <button class="topcoat-tab-bar__button full">Two</button>
   </label>
   <label class="topcoat-tab-bar__item">
     <input type="radio" name="topcoat">
     <button class="topcoat-tab-bar__button full">Three</button>
   </label>
</div>

<div class="spacer">
  <hr>
</div>
  
<small>
  <a href="https://www.twitter.com/dam">@dam</a> ♥s you
</small>
  
<script src="//use.edgefonts.net/source-sans-pro:n3,n4,n6;source-code-pro:n3.js"></script>
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
            
          
!
            
              body {
  padding: 0 50px;
  background-color: #f4f4f4;
  font-family: source-sans-pro, sans-serif;
}

:focus {
  outline-color: transparent;
  outline-style: none;
}

.full {
  width: 100%
}

input {
  position: absolute;
	overflow: hidden;
	clip: rect(0 0 0 0);
	margin: 0;
	padding: 0;
  border: 0;
  opacity: 0.001;
}

label {
  position: relative;
}

.title {
  letter-spacing: -.065em;
}

.spacer {
  padding: 25px 0;
}

.topcoat-tab-bar {
  display: table;
  table-layout: fixed;
  white-space: no-wrap;
  font-size: 0;
}

.topcoat-tab-bar__item {
  display: table-cell;
  width: auto;
  /* reset what was removed by tab bar */
  font-size: 16px;
}

.topcoat-tab-bar__button {
  position: relative;
  display: inline-block;
  overflow: hidden;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  padding: 0 1.25rem;
  border: none;
  border-top: 1px solid #a5a8a8;
  background-color: #e5e9e8;
  -webkit-background-clip: padding;
  -moz-background-clip: padding;
  background-clip: padding-box;
  -webkit-box-shadow: inset 0 1px #fff;
  box-shadow: inset 0 1px #fff;
  color: #454545;
  vertical-align: top;
  text-overflow: ellipsis;
  text-shadow: 0 1px #fff;
  white-space: nowrap;
  letter-spacing: 1px;
  font: inherit;
  line-height: 3rem;
  cursor: default;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -o-text-overflow: ellipsis;
}

:checked + .topcoat-tab-bar__button,
.topcoat-tab-bar__button:active,
.topcoat-tab-bar__button.is-active {
  color: #0083e8;
  background-color: #e0f0fa;
  -webkit-box-shadow: inset 1px 1px rgba(0,0,0,0.12);
  box-shadow: inset 0 0 2px  #c0ced8;
}

.topcoat-tab-bar__item:disabled,
.topcoat-tab-bar__item.is-disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.topcoat-tab-bar__button:focus {
  -webkit-box-shadow: 0 0 0 2px #6fb5f1;
  box-shadow: 0 0 0 2px #6fb5f1;
  z-index: 1;
}


            
          
!
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