diff --git a/src/components/chips/chips-theme.scss b/src/components/chips/chips-theme.scss index d5fb9cb8c3..618295a525 100644 --- a/src/components/chips/chips-theme.scss +++ b/src/components/chips/chips-theme.scss @@ -37,11 +37,13 @@ md-chips.md-THEME_NAME-theme { color: '{{background-800}}'; } } - md-chip-remove { - .md-button { - md-icon { - path { - fill: '{{background-500}}'; + .md-chip-remove-container { + button { + &md-chip-remove, + &.md-chip-remove { + md-icon { + color: '{{foreground-2}}'; + fill: '{{foreground-2}}'; } } } diff --git a/src/components/chips/chips.scss b/src/components/chips/chips.scss index 372ee38520..fd6168e22c 100644 --- a/src/components/chips/chips.scss +++ b/src/components/chips/chips.scss @@ -1,8 +1,8 @@ -$chip-font-size: rem(1.6) !default; +$chip-font-size: rem(1.3) !default; $chip-height: rem(3.2) !default; $chip-padding: 0 rem(1.2) 0 rem(1.2) !default; $chip-input-padding: 0 !default; -$chip-remove-padding-right: rem(2.2) !default; +$chip-remove-padding-right: rem(2.8) !default; $chip-remove-line-height: rem(2.2) !default; $chip-margin: rem(0.8) rem(0.8) 0 0 !default; $chip-wrap-padding: 0 0 rem(0.8) rem(0.3) !default; diff --git a/src/components/chips/demoBasicUsage/index.html b/src/components/chips/demoBasicUsage/index.html index a518239a82..151b953e0d 100644 --- a/src/components/chips/demoBasicUsage/index.html +++ b/src/components/chips/demoBasicUsage/index.html @@ -69,7 +69,7 @@

Display an ordered set of objects as chips (with custom tem ({{$chip.type}}) - diff --git a/src/components/chips/demoBasicUsage/style.scss b/src/components/chips/demoBasicUsage/style.scss index 2d3985ca4d..113c3c4b0c 100644 --- a/src/components/chips/demoBasicUsage/style.scss +++ b/src/components/chips/demoBasicUsage/style.scss @@ -3,50 +3,43 @@ color: rgb(221,44,0); margin-top: 10px; } - .custom-chips { md-chip { position: relative; + padding-right: 24px; + .md-chip-remove-container { position: absolute; right: 4px; top: 4px; margin-right: 0; - height: 24px; - button.vegetablechip { + height: 26px; + display: none; + + button.demo-remove-vegetable-chip { position: relative; height: 24px; width: 24px; line-height: 30px; - text-align: center; - background: rgba(black, 0.3); - border-radius: 50%; + background: transparent; border: none; - box-shadow: none; padding: 0; - margin: 0; - transition: background 0.15s linear; - display: block; + md-icon { - position: absolute; - top: 50%; - left: 50%; - transform: translate3d(-50%, -50%, 0) scale(0.7); - color: white; - fill: white; - } - &:hover, &:focus { - background: rgba(red, 0.8); + transform: translate(0, -3px) scale(0.75); + fill: rgba(0, 0, 0, 0.33); } } } - } + &:hover:not(.md-readonly) .md-chip-remove-container { + display: block; + } + &.md-focused:not(.md-readonly) .md-chip-remove-container { + display: block; - // Show custom padding for the custom delete button, which needs more space. - md-chips-wrap.md-removable { - md-chip md-chip-template { - padding-right: 5px; + button.demo-remove-vegetable-chip md-icon { + fill: rgba(255, 255, 255, 0.87); + } } } - } diff --git a/src/components/chips/js/chipRemoveDirective.js b/src/components/chips/js/chipRemoveDirective.js index f7f0a30b5d..598a50a99e 100644 --- a/src/components/chips/js/chipRemoveDirective.js +++ b/src/components/chips/js/chipRemoveDirective.js @@ -24,8 +24,8 @@ angular * ### With Standard Chips * * - * * * @@ -33,8 +33,8 @@ angular * ### With Object Chips * * - * * * @@ -57,7 +57,7 @@ function MdChipRemove ($timeout) { }; function postLink(scope, element, attr, ctrl) { - element.on('click', function(event) { + element.on('click', function() { scope.$apply(function() { ctrl.removeChip(scope.$$replacedScope.$index); }); diff --git a/src/components/chips/js/chipsDirective.js b/src/components/chips/js/chipsDirective.js index 4281a89995..f07a268dd0 100644 --- a/src/components/chips/js/chipsDirective.js +++ b/src/components/chips/js/chipsDirective.js @@ -400,7 +400,7 @@ mdChipsCtrl.chipRemoveTemplate = chipRemoveTemplate; mdChipsCtrl.chipInputTemplate = chipInputTemplate; - mdChipsCtrl.mdCloseIcon = $$mdSvgRegistry.mdClose; + mdChipsCtrl.mdCloseIcon = $$mdSvgRegistry.mdCancel; element .attr({ tabindex: -1 })