From 88b637b4916902934d00721398592704e3ed53e1 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Fri, 8 Jul 2016 11:45:05 -0400 Subject: [PATCH] feat(toolbar): add attributes to hide all borders and box shadows closes #7237 --- src/components/toolbar/toolbar.ios.scss | 5 +++ src/components/toolbar/toolbar.md.scss | 38 ++++++++++------ src/components/toolbar/toolbar.ts | 58 ++++++++++++++++++++----- 3 files changed, 75 insertions(+), 26 deletions(-) diff --git a/src/components/toolbar/toolbar.ios.scss b/src/components/toolbar/toolbar.ios.scss index 3607b582423..fd0a7885256 100644 --- a/src/components/toolbar/toolbar.ios.scss +++ b/src/components/toolbar/toolbar.ios.scss @@ -69,6 +69,11 @@ ion-footer .toolbar:last-child .toolbar-background, border-bottom-width: 0; } +.toolbar[no-border] .toolbar-background { + border-top-width: 0; + border-bottom-width: 0; +} + // iOS Toolbar Content // -------------------------------------------------- diff --git a/src/components/toolbar/toolbar.md.scss b/src/components/toolbar/toolbar.md.scss index 210dbe69fdc..d637622da30 100644 --- a/src/components/toolbar/toolbar.md.scss +++ b/src/components/toolbar/toolbar.md.scss @@ -29,6 +29,25 @@ $toolbar-md-button-border-radius: 2px !default; $navbar-md-height: $toolbar-md-height !default; +.toolbar { + padding: $toolbar-md-padding; + + min-height: $toolbar-md-height; +} + + +// Material Design Toolbar Background +// -------------------------------------------------- + +.toolbar-background { + border-color: $toolbar-md-border-color; + background: $toolbar-md-background; +} + + +// Material Design Header / Footer / Tabs Box Shadow +// -------------------------------------------------- + ion-header::after, [tabsPlacement="top"] > ion-tabbar::after, ion-footer::before, @@ -60,22 +79,13 @@ ion-footer::before, background-position: 0 0; } -.toolbar { - padding: $toolbar-md-padding; - - min-height: $toolbar-md-height; -} - - -// Material Design Toolbar Background -// -------------------------------------------------- - -.toolbar-background { - border-color: $toolbar-md-border-color; - background: $toolbar-md-background; +ion-header[no-shadow]::after, +ion-footer[no-shadow]::before, +[tabsPlacement="top"][no-shadow] > ion-tabbar::after, +[tabsPlacement="bottom"][no-shadow] > ion-tabbar::before { + display: none; } - // Material Design Toolbar Content // -------------------------------------------------- diff --git a/src/components/toolbar/toolbar.ts b/src/components/toolbar/toolbar.ts index 189378573e0..cdf365221a4 100644 --- a/src/components/toolbar/toolbar.ts +++ b/src/components/toolbar/toolbar.ts @@ -114,22 +114,56 @@ export class ToolbarBase extends Ion { * | `right` | Positions element to the right of all other elements. | * * - * ### Multiple Toolbars + * ### Header / Footer Box Shadow + * In `md` mode, the `ion-header` will receive a box-shadow on the bottom, and the + * `ion-footer` will receive a box-shadow on the top. This can be removed by adding + * the `no-shadow` attribute to the element. + * + * ```html + * + * + * Header + * + * + * + * + * + * + * + * + * Footer + * + * + * ``` + * + * ### Toolbar Borders * Toolbars can be stacked up vertically in ``, ``, and - * `` elements. However, toolbars also come with borders on both - * the top and bottom of the toolbar. To give developers full control of the - * design, Ionic also includes the `no-border-bottom` and `no-border-top` attributes. - * For example, sometimes two vertically stacked toolbars may have different - * background colors, in this case it might be best to leave a border between them. - * However, if they have the same background color, the app may look best without - * a border between them. The main point here is, it's entirely up to the app's design - * to decide when and when not to show borders between toolbars, and to do so then - * each toolbar can individually set `no-border-bottom` and `no-border-top` attributes. + * `` elements. In `ios` mode, toolbars have borders on the top and + * bottom. To hide both borders, the `no-border` attribute should be used on the + * `ion-toolbar`. To hide the top or bottom border, the `no-border-top` and + * `no-border-bottom` attribute should be used. + * + * ```html + * + * + * Header + * + * + * Subheader + * + * + * Another Header + * + * + * + * + * + * ``` * * * @usage * ```html - * + * * * * @@ -161,7 +195,7 @@ export class ToolbarBase extends Ion { * * * - * + * * I'm a subfooter * *