<!DOCTYPE html>
<html lang="en">
 <head>
  <style>
   *,
*:before,
*:after {
  box-sizing: border-box;
}
body {
  padding: 0;
  margin: 0;
  background: #000;
}
.ctrl {
  display: block;
  position: relative;
  margin: 1rem;
  text-align: center;
}
.ctrl input {
  min-width: 320px;
  width: 50%;
  padding: 0.2rem;
  font-size: 1.3rem;
}
.container {
  margin: 1rem auto 0 auto;
  background: #fff;
}
.main {
  box-shadow: 0 -2px 2px rgba(0, 0, 0, 0.3);
  padding: 1rem;
  position: relative;
}
.Tabs {
  position: relative;
}
.Tabs ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.Tabs [id=DrawerCheck] {
  display: none;
}
.Tabs [id=DrawerCheck]:checked + .TabList .icon-down:before {
  top: 0;
  transform: rotate(-180deg);
}
.Tabs [id=DrawerCheck]:checked + .TabList + .DrawerList {
  opacity: 1;
  z-index: 1;
}
.TabList {
  position: relative;
  max-height: 2.5rem;
  overflow: hidden;
}
.TabList:before,
.TabList:after {
  content: ' ';
  display: table;
}
.TabList:after {
  clear: both;
}
.TabList li {
  float: left;
  padding: 0 0.5rem;
  height: 2.5rem;
  line-height: 2.5rem;
  background: #e8e9eb;
  position: relative;
  border-right: 0.25rem solid #fff;
}
.TabList li:last-child {
  border-right: 0;
}
.TabList li.active {
  background: #fff;
  z-index: 2;
}
.TabList li.drawer {
  background: none;
  line-height: 1;
  border-width: 0;
  position: absolute;
  right: 0;
  margin-left: 0.4rem;
}
.TabList li.drawer .icon-down:before {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: -1.2rem;
  line-height: 1;
  content: '^';
  font-weight: bold;
  z-index: 2;
}
.TabList li.drawer label {
  display: inline-block;
  position: relative;
  top: 0.5rem;
  color: #585858;
  cursor: pointer;
}
.TabList li.drawer label span {
  display: inline-block;
  border: 0.125rem solid #888;
  background: #f2f2f2;
  padding: 0.3125rem 0.4375rem 0.1875rem 0.4375rem;
  border-radius: 0.3125rem;
  position: relative;
  z-index: 1;
}
.TabList li.drawer label:before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  display: block;
  border: 0.125rem solid #888;
  border-radius: 0.3125rem;
  background: #cfcfcf;
  top: -0.375rem;
  left: -0.375rem;
}
.DrawerList {
  position: absolute;
  right: 0;
  opacity: 0;
  z-index: -1;
}
.DrawerList li {
  padding: 0 0.5rem;
  height: 2.5rem;
  line-height: 2.5rem;
  background: #e8e9eb;
  border-bottom: 1px solid #999;
  position: relative;
}
  </style>
 </head>
 <body translate="no">
  <div class="body" ng-app="OverflowingTabs" ng-controller="TabList">
   <form class="ctrl">
    <input max="{{windowWidth}}" min="320" ng-model="sectionWidth" ng-value="sectionWidth" placeholder="Set the width of the container (in PX)" step="10" type="number"/>
   </form>
   <section class="container" ng-style="{width: sectionWidth +'px'}">
    <div class="Tabs">
     <input id="DrawerCheck" type="checkbox"/>
     <ul class="TabList" ng-style="TabSplitterStyle()">
      <li data-ind="{{$index}}" ng-class="{active: tab.active}" ng-repeat="tab in tabs">
       <span>
        {{tab.title}}
       </span>
      </li>
      <li class="drawer">
       <label for="DrawerCheck">
        <b class="icon-down">
        </b>
        <span>
         {{overflowTabs.length}}
        </span>
       </label>
      </li>
     </ul>
     <ul class="DrawerList">
      <li ng-repeat="tab in overflowTabs">
       <span>
        {{tab.title}}
       </span>
      </li>
     </ul>
    </div>
    <article class="main">
     Insert Content Here
    </article>
   </section>
  </div>
 </body>
</html>
