mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
fix(tabs): hover states
This commit is contained in:
@ -24,7 +24,7 @@
|
|||||||
#tabs .tab-button {
|
#tabs .tab-button {
|
||||||
color: #C7C7C7;
|
color: #C7C7C7;
|
||||||
}
|
}
|
||||||
#tabs .tab-button[aria-selected="true"] {
|
#tabs .tab-button[aria-selected=true] {
|
||||||
color: #51E3C2;
|
color: #51E3C2;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -12,7 +12,7 @@ $tab-bar-ios-height: 49px !default;
|
|||||||
border-top: 1px solid $toolbar-ios-border-color;
|
border-top: 1px solid $toolbar-ios-border-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabs[tab-bar-placement="top"] .tab-bar {
|
.tabs[tab-bar-placement=top] .tab-bar {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
border-bottom: 1px solid $toolbar-ios-border-color;
|
border-bottom: 1px solid $toolbar-ios-border-color;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ $tab-bar-md-item-height: 4.8rem !default;
|
|||||||
border-bottom: 2px solid transparent;
|
border-bottom: 2px solid transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-button[aria-selected="true"] {
|
.tab-button[aria-selected=true] {
|
||||||
border-bottom-color: $tab-button-text-active;
|
border-bottom-color: $tab-button-text-active;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ ion-tab {
|
|||||||
order: $flex-order-tab-bar-bottom;
|
order: $flex-order-tab-bar-bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
[tab-bar-placement="top"] .tab-bar-container {
|
[tab-bar-placement=top] .tab-bar-container {
|
||||||
order: $flex-order-tab-bar-top;
|
order: $flex-order-tab-bar-top;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,18 +79,18 @@ ion-tab {
|
|||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
background: none;
|
background: none;
|
||||||
|
|
||||||
:hover:not(.disable-hover) {
|
&:hover:not(.disable-hover) {
|
||||||
color: $tab-button-text-inactive;
|
color: $tab-button-text-inactive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[tab-bar-icons="bottom"] .tab-button {
|
[tab-bar-icons=bottom] .tab-button {
|
||||||
.tab-button-icon {
|
.tab-button-icon {
|
||||||
order: 10;
|
order: 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[tab-bar-icons="left"] .tab-button {
|
[tab-bar-icons=left] .tab-button {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
.tab-button-icon {
|
.tab-button-icon {
|
||||||
@ -99,7 +99,7 @@ ion-tab {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[tab-bar-icons="right"] .tab-button {
|
[tab-bar-icons=right] .tab-button {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
.tab-button-icon {
|
.tab-button-icon {
|
||||||
@ -137,6 +137,6 @@ ion-tab {
|
|||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-button[aria-selected="true"] {
|
.tab-button[aria-selected=true] {
|
||||||
color: $toolbar-active-color;
|
color: $toolbar-active-color;
|
||||||
}
|
}
|
||||||
|
@ -3,31 +3,34 @@ import {Component, Directive, View, Injector, NgFor, ElementRef, Optional, Host,
|
|||||||
import {IonicApp} from '../app/app';
|
import {IonicApp} from '../app/app';
|
||||||
import {NavController} from '../nav/nav-controller';
|
import {NavController} from '../nav/nav-controller';
|
||||||
import {ViewController} from '../nav/view-controller';
|
import {ViewController} from '../nav/view-controller';
|
||||||
import {Icon} from '../icon/icon';
|
|
||||||
import {IonicComponent, IonicView} from '../../config/decorators';
|
import {IonicComponent, IonicView} from '../../config/decorators';
|
||||||
|
import {IonicConfig} from '../../config/config';
|
||||||
|
|
||||||
/**
|
|
||||||
* @name ionTabs
|
|
||||||
* @description
|
|
||||||
* Powers a multi-tabbed interface with a Tab Bar and a set of "pages" that can be tabbed through.
|
|
||||||
*
|
|
||||||
* Assign any tabs attribute to the element to define its look and feel.
|
|
||||||
*
|
|
||||||
* For iOS, tabs will appear at the bottom of the screen. For Android, tabs will be at the top of the screen, below the nav-bar. This follows each OS's design specification, but can be configured with the ionicConfig.
|
|
||||||
*
|
|
||||||
* See the ionTab component's documentation for more details on individual tabs.
|
|
||||||
*
|
|
||||||
* @usage
|
|
||||||
* ```html
|
|
||||||
* <ion-tabs>
|
|
||||||
* <ion-tab tab-title="Heart" tab-icon="ion-ios-heart-outline" [root]="root1"></ion-tab>
|
|
||||||
* <ion-tab tab-title="Star" tab-icon="ion-ios-star-outline" [root]="root2"></ion-tab>
|
|
||||||
* <ion-tab tab-title="Stopwatch" tab-icon="ion-ios-stopwatch-outline" [root]="root3"></ion-tab>
|
|
||||||
* </ion-tabs>
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name ionTabs
|
||||||
|
* @description
|
||||||
|
* Powers a multi-tabbed interface with a Tab Bar and a set of "pages"
|
||||||
|
* that can be tabbed through.
|
||||||
|
*
|
||||||
|
* Assign any tabs attribute to the element to define its look and feel.
|
||||||
|
*
|
||||||
|
* For iOS, tabs will appear at the bottom of the screen. For Android, tabs
|
||||||
|
* will be at the top of the screen, below the nav-bar. This follows each platform's
|
||||||
|
* design specification, but can be configured with IonicConfig.
|
||||||
|
*
|
||||||
|
* See the ionTab component's documentation for more details on individual tabs.
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```html
|
||||||
|
* <ion-tabs>
|
||||||
|
* <ion-tab tab-title="Heart" tab-icon="ion-ios-heart-outline" [root]="root1"></ion-tab>
|
||||||
|
* <ion-tab tab-title="Star" tab-icon="ion-ios-star-outline" [root]="root2"></ion-tab>
|
||||||
|
* <ion-tab tab-title="Stopwatch" tab-icon="ion-ios-stopwatch-outline" [root]="root3"></ion-tab>
|
||||||
|
* </ion-tabs>
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
*/
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-tabs',
|
selector: 'ion-tabs',
|
||||||
defaultProperties: {
|
defaultProperties: {
|
||||||
@ -166,8 +169,12 @@ export class Tabs extends NavController {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
class TabButton {
|
class TabButton {
|
||||||
constructor(@Host() tabs: Tabs) {
|
constructor(@Host() tabs: Tabs, config: IonicConfig, elementRef: ElementRef) {
|
||||||
this.tabs = tabs;
|
this.tabs = tabs;
|
||||||
|
|
||||||
|
if (config.setting('hoverCSS') === false) {
|
||||||
|
elementRef.nativeElement.classList.add('disable-hover');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onInit() {
|
onInit() {
|
||||||
|
Reference in New Issue
Block a user