2016-05-23 2 views
2

Ich versuche, die folgende Benutzeroberfläche für meine eckige Material-App zu entwickeln. Aber ich habe keine Ahnung, wie ich alle nicht ausgewählten MD-Tabs in CSS anpassen kann.Anpassen von Styling von nicht ausgewählten MD-Tab-Label von MD-Tab

This is what I want to have.

Current version

HTML-Code:

 <md-tabs class="md-primary" md-selected="selectedIndex" md-align-tabs="top" md-autoselect md-dynamic-height id="top"> 
      <md-tab ng-repeat="tab in tabs" flex layout="column" layout-fill> 
       <md-tab-label> 
        <div layout="row" layout-fill> 
         <div class="md-tab-item-index"> 
          <span>{{tab.index}}</span> 
         </div> 
         <div class="md-tab-item-label"> 
          {{tab.title}} 
         </div> 
         <div class="md-tab-item-label-separator"></div> 
        </div> 
       </md-tab-label> 
       <md-tab-body> 
        <div ng-include="tab.content"></div> 
       </md-tab-body> 
      </md-tab> 
     </md-tabs> 

CSS

.md-tab-item-label { 
    color: white; 
    font-size: 14px; 
    line-height: 20px; 
    text-transform: capitalize; 
} 

.md-tab-item-label-separator { 
    background-color: rgba(255, 255, 255, 0.5); 
    -webkit-box-flex: 0 1 auto; 
    -webkit-flex: 0 1 auto; 
    flex: 0 1 auto; 
    height: 1px; 
    min-width: 0; 
    position: relative; 
    top: 12px; 
    width: 68px; 
    margin-left: 10px; 
} 

.md-tab-item-index { 
    background-color: #ffffff; 
    -webkit-border-radius: 50%; 
    border-radius: 50%; 
    -webkit-box-flex: 0 0 auto; 
    -webkit-flex: 0 0 auto; 
    flex: 0 0 auto; 
    font-size: 12px; 
    font-weight: 500; 
    height: 24px; 
    line-height: 24px; 
    position: relative; 
    text-align: center; 
    width: 24px; 
    color: #000000; 
    margin-right: 10px; 
} 
+0

können Sie den Code in jsfiddle.net ausführen –

+0

Hier ist eine Version in JSFiddle https://jsfiddle.net/mueller92/c9w521ka/ –

Antwort

0

Ganz einfach:

md-tab ng-scope ng-isolate-scope md-ink-ripple md-active das ist aktives

md-tab ng-scope ng-isolate-scope md-ink-ripple das ist nicht aktiv ein

Ihren Stil alle verwenden, dann besonderen Stil für aktive vorzubereiten.

+0

Ich habe Ihre Lösung versucht, aber es funktioniert nicht. Können Sie Ihre Lösung in Fiddle implementieren? jsfiddle.net/mueller92/c9w521ka –