From ae6e140fbf7a301506043cb99b0f8bda8ba1a66a Mon Sep 17 00:00:00 2001 From: mhartington Date: Fri, 2 Oct 2015 11:44:10 -0400 Subject: [PATCH] feat(ionTabs): hide tabs by default with MD Closes #229. Closes #236 Squashed commit of the following: commit f566321e54937b8d31a8d1f85948ab5d984b9e37 Author: mhartington Date: Fri Oct 2 11:03:50 2015 -0400 feat(ionTabs): organize code and clean font sizes commit 9ee1e28f0b01e9e195bc24a65066a57d66e5ec50 Author: mhartington Date: Fri Oct 2 10:51:36 2015 -0400 feat(ionTabs): move scss to tabs.scss commit 3eba74c27c8eefe6e61f8f3ac12742edb7181772 Author: mhartington Date: Thu Oct 1 16:23:37 2015 -0400 feat(ionTabs): add test commit 34f61431d41283fc8e5ed2f64e0874659072660b Author: mhartington Date: Thu Oct 1 16:13:05 2015 -0400 feat(ionTabs): reuse tabBarIcons commit 8c6f0edb17bcc6ff0c5f8b7be66f2be8a6775d48 Author: mhartington Date: Thu Oct 1 15:56:29 2015 -0400 feat(ionTabs): hide tab icon for md --- ionic/components/tabs/modes/ios.scss | 5 ++ ionic/components/tabs/modes/md.scss | 1 + ionic/components/tabs/tabs.scss | 55 ++++++++++--------- .../tabs/test/tab-bar-scenarios/main.html | 6 ++ ionic/config/modes.ts | 3 +- 5 files changed, 44 insertions(+), 26 deletions(-) diff --git a/ionic/components/tabs/modes/ios.scss b/ionic/components/tabs/modes/ios.scss index b5f14c4e09..52e47944b4 100644 --- a/ionic/components/tabs/modes/ios.scss +++ b/ionic/components/tabs/modes/ios.scss @@ -59,6 +59,11 @@ ion-tabs[tab-bar-placement=top] tab-bar { } } +[tab-bar-icons=hide] .tab-button-text { + font-size: 1.4rem; + line-height: 1.1; +} + .tab-button.has-title-only { min-height: $tab-bar-ios-height - 8; diff --git a/ionic/components/tabs/modes/md.scss b/ionic/components/tabs/modes/md.scss index 9f9e03a8c4..af0a777f44 100644 --- a/ionic/components/tabs/modes/md.scss +++ b/ionic/components/tabs/modes/md.scss @@ -64,3 +64,4 @@ tab-highlight { transition-duration: 300ms; } } + diff --git a/ionic/components/tabs/tabs.scss b/ionic/components/tabs/tabs.scss index d211e6852e..1460808a0b 100644 --- a/ionic/components/tabs/tabs.scss +++ b/ionic/components/tabs/tabs.scss @@ -93,31 +93,6 @@ tab-bar { } } -[tab-bar-icons=bottom] .tab-button { - .tab-button-icon { - order: 10; - } -} - -[tab-bar-icons=left] .tab-button { - flex-direction: row; - - .tab-button-icon { - text-align: right; - padding-right: 8px; - } -} - -[tab-bar-icons=right] .tab-button { - flex-direction: row; - - .tab-button-icon { - order: 10; - text-align: left; - padding-left: 8px; - } -} - .tab-button-text { margin-top: 3px; margin-bottom: 2px; @@ -153,3 +128,33 @@ tab-bar { tab-highlight { display: none; } + +[tab-bar-icons=bottom] .tab-button { + .tab-button-icon { + order: 10; + } +} + +[tab-bar-icons=left] .tab-button { + flex-direction: row; + + .tab-button-icon { + text-align: right; + padding-right: 8px; + } +} + +[tab-bar-icons=right] .tab-button { + flex-direction: row; + + .tab-button-icon { + order: 10; + text-align: left; + padding-left: 8px; + } +} + +[tab-bar-icons=hide] .tab-button-icon { + display: none; +} + diff --git a/ionic/components/tabs/test/tab-bar-scenarios/main.html b/ionic/components/tabs/test/tab-bar-scenarios/main.html index 6b63302892..22e09da14e 100644 --- a/ionic/components/tabs/test/tab-bar-scenarios/main.html +++ b/ionic/components/tabs/test/tab-bar-scenarios/main.html @@ -46,6 +46,12 @@ + + + + + + diff --git a/ionic/config/modes.ts b/ionic/config/modes.ts index ae4e3ac82e..353c80a8ee 100644 --- a/ionic/config/modes.ts +++ b/ionic/config/modes.ts @@ -43,10 +43,11 @@ IonicConfig.modeConfig('md', { modalLeave: 'modal-md-slide-out', tabBarPlacement: 'top', + tabBarIcons: 'hide', viewTransition: 'md', popupPopIn: 'popup-md-pop-in', - popupPopOut: 'popup-md-pop-out', + popupPopOut: 'popup-md-pop-out', type: 'overlay', mdRipple: true,