From fa87e35a058d97f84f5f180e6e7e59d05d64ff26 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Fri, 17 May 2019 14:54:21 -0400 Subject: [PATCH] fix(toolbar): update md toolbar button spacing and padding to match spec (#17537) - Removes the padding from the main toolbar and individually style the components inside of it - Adds a `has-icon-only` class to button, this is used to switch between `unbounded` and `bounded` ripples on buttons in a toolbar. If the button is clear and only has an icon, we use the unbounded "circular" ripple effect, otherwise still use the bounded one. This matches the MD spec, without making the other buttons look off. - Using the class above, style the button differently to match the MD spec - Updates the back button and menu button to use the proper size / icon size - Removes the opacity on an activated back button, it should use the ripple for activated - Moves the margin to the slots in a toolbar by grabbing the "first" and "last" slot and applying a class to them - Makes the segment in a toolbar use the min height from the toolbar - Updates the back button so that it matches the MD spec - Updates the header box shadow to use the old v3 datauri fixes #16950 fixes #14444 --- .../back-button/back-button.ios.scss | 7 + .../back-button/back-button.md.scss | 21 +- .../components/back-button/back-button.scss | 4 - .../components/back-button/back-button.tsx | 5 +- core/src/components/button/button.tsx | 29 ++- core/src/components/buttons/buttons.ios.scss | 6 +- core/src/components/buttons/buttons.md.scss | 19 ++ core/src/components/buttons/buttons.scss | 5 - core/src/components/header/header.md.scss | 4 +- .../src/components/header/header.md.vars.scss | 2 +- .../menu-button/menu-button.md.scss | 7 +- .../components/menu-button/menu-button.scss | 1 + .../components/menu-button/menu-button.tsx | 2 + .../components/searchbar/searchbar.md.scss | 2 +- core/src/components/title/title.scss | 4 +- .../components/toolbar/test/components/e2e.ts | 10 + .../toolbar/test/components/index.html | 136 ++++++++++ .../toolbar/test/scenarios/index.html | 56 +--- .../components/toolbar/test/spec/index.html | 240 ++++++++++++++++-- core/src/components/toolbar/toolbar.ios.scss | 9 + core/src/components/toolbar/toolbar.md.scss | 35 ++- core/src/components/toolbar/toolbar.scss | 19 +- core/src/components/toolbar/toolbar.tsx | 20 ++ 23 files changed, 511 insertions(+), 132 deletions(-) create mode 100644 core/src/components/toolbar/test/components/e2e.ts create mode 100644 core/src/components/toolbar/test/components/index.html diff --git a/core/src/components/back-button/back-button.ios.scss b/core/src/components/back-button/back-button.ios.scss index b99a6deee57..28328b03344 100644 --- a/core/src/components/back-button/back-button.ios.scss +++ b/core/src/components/back-button/back-button.ios.scss @@ -35,3 +35,10 @@ overflow: visible; z-index: $back-button-ios-button-z-index; } + +// Back Button States +// -------------------------------------------------- + +:host(.activated) .button-native { + opacity: .4; +} \ No newline at end of file diff --git a/core/src/components/back-button/back-button.md.scss b/core/src/components/back-button/back-button.md.scss index 61e3be6998c..6e1adbde25c 100644 --- a/core/src/components/back-button/back-button.md.scss +++ b/core/src/components/back-button/back-button.md.scss @@ -6,22 +6,24 @@ :host { --color: #{$back-button-md-color}; - --margin-top: 1px; - --margin-end: 6px; + --margin-top: 0; + --margin-end: 0; --margin-bottom: 0; --margin-start: 0; --padding-top: 0; - --padding-end: 5px; + --padding-end: 0; --padding-bottom: 0; - --padding-start: 5px; + --padding-start: 0; --min-height: 32px; --min-width: 44px; - --icon-padding-end: .3em; - --icon-padding-start: .3em; + --icon-padding-top: 0; + --icon-padding-end: 0; + --icon-padding-start: 0; + --icon-padding-bottom: 0; --icon-margin-top: 0; - --icon-margin-end: 6px; + --icon-margin-end: 0; --icon-margin-bottom: 0; - --icon-margin-start: 6px; + --icon-margin-start: 0; --icon-font-size: 24px; --icon-font-weight: normal; @@ -32,6 +34,9 @@ } .button-native { + width: 48px; + height: 48px; + box-shadow: none; } diff --git a/core/src/components/back-button/back-button.scss b/core/src/components/back-button/back-button.scss index 47aba075f30..2c1ca5c9202 100644 --- a/core/src/components/back-button/back-button.scss +++ b/core/src/components/back-button/back-button.scss @@ -77,10 +77,6 @@ // Back Button States // -------------------------------------------------- -:host(.activated) .button-native { - opacity: .4; -} - :host-context(.can-go-back > ion-header), :host(.show-back-button) { display: block; diff --git a/core/src/components/back-button/back-button.tsx b/core/src/components/back-button/back-button.tsx index 811e46055c8..704497c5989 100644 --- a/core/src/components/back-button/back-button.tsx +++ b/core/src/components/back-button/back-button.tsx @@ -77,10 +77,7 @@ export class BackButton implements ComponentInterface { const backButtonText = this.text != null ? this.text : this.config.get('backButtonText', defaultBackButtonText); return ( -