# Icon color in button-icon

**URL:** <https://forum.ionicframework.com/t/icon-color-in-button-icon/30188>\
**Category:** ionic-v1\
**Created:** [August 9, 2015, 11:07pm UTC](https://forum.ionicframework.com/t/icon-color-in-button-icon/30188 "2015-08-09T23:07:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![JackStone](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@JackStone](https://forum.ionicframework.com/u/JackStone)\
**Post date:** [August 9, 2015, 11:07pm UTC](https://forum.ionicframework.com/t/icon-color-in-button-icon/30188/1 "2015-08-09T23:07:01Z")

</div>

Is it possible to add a custom color (i.e. `button-positive`) to an icon button? I have this line:

`<button class="button button-positive button-icon icon ion-ios-plus"></button>`

However, giving the button any custom color causes it to disappear.

---

<div class="post-metadata">

**Author:** ![Gajotres](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gajotres/32/98564_2.png) [@Gajotres](https://forum.ionicframework.com/u/Gajotres)\
**Post date:** [August 10, 2015, 9:22am UTC](https://forum.ionicframework.com/t/icon-color-in-button-icon/30188/2 "2015-08-10T09:22:37Z")

</div>

This is because you need to change button text color, not button background.

button-positive will change a background color and set a text color to white. Because this type of button uses text color it will blend with a background.

```
<button class="button button-icon icon ion-ios-plus custom-btn-color"></button>

.custom-btn-color {
    color: red;  
}
```

---

<div class="post-metadata">

**Author:** ![JackStone](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@JackStone](https://forum.ionicframework.com/u/JackStone)\
**Post date:** [August 10, 2015, 6:08pm UTC](https://forum.ionicframework.com/t/icon-color-in-button-icon/30188/3 "2015-08-10T18:08:58Z")

</div>

Right, but then when you click and unclick on the button, the color fades back to gray…

---

<div class="post-metadata">

**Author:** ![Gajotres](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gajotres/32/98564_2.png) [@Gajotres](https://forum.ionicframework.com/u/Gajotres)\
**Post date:** [August 10, 2015, 6:34pm UTC](https://forum.ionicframework.com/t/icon-color-in-button-icon/30188/4 "2015-08-10T18:34:02Z")

</div>

```
.custom-btn-color {
    color: red !important;  
}
```

---

<div class="post-metadata">

**Author:** ![JackStone](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@JackStone](https://forum.ionicframework.com/u/JackStone)\
**Post date:** [August 10, 2015, 6:46pm UTC](https://forum.ionicframework.com/t/icon-color-in-button-icon/30188/5 "2015-08-10T18:46:32Z")

</div>

I was just checking to see if there was a way of doing it without custom rules.

---

<div class="post-metadata">

**Author:** ![brandyshea](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brandyshea/32/148286_2.png) [@brandyshea](https://forum.ionicframework.com/u/brandyshea)\
**Post date:** [August 11, 2015, 5:13pm UTC](https://forum.ionicframework.com/t/icon-color-in-button-icon/30188/6 "2015-08-11T17:13:33Z")

</div>

You can use the class `positive` by itself to change the color. For example:

```
<button class="button positive button-icon icon ion-ios-plus"></button>
```

---

<div class="post-metadata">

**Author:** ![sakotturi](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@sakotturi](https://forum.ionicframework.com/u/sakotturi)\
**Post date:** [September 24, 2015, 11:37pm UTC](https://forum.ionicframework.com/t/icon-color-in-button-icon/30188/7 "2015-09-24T23:37:43Z")

</div>

I have a question that extends from this question.

I have a “FAB-esque” button ala Material Design and when I click this “button”, an ionicModal launches.  
Button:

`<my-directive class="button button-icon assertive ion-plus-circled button-floating-action"></my-directive>`

The problem came when I tried to add some shadow to this thing.  
Box-shadow doesnt work because it creates a ghost-box. But text-shadow works. Here’s the custom css:

```
.button-floating-action {
    position: fixed;
    top: calc(90vh - 50px);
    right: 2vw;
    z-index: 999;
    text-shadow: 5px 5px 5px #888888;
}

```

The “+” isn’t white but transparent which means the shadow is seen through and looks funky.  
Anyway to enforce the icon color vs the background color (white and red respectively)  
The funky button-icon:

![image](https://global.discourse-cdn.com/ionicframework/original/3X/c/5/c5aaf7f64271cadfa6aee4e40a598d9fe1eb7944.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![gigocabrera](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gigocabrera/32/123546_2.png) [@gigocabrera](https://forum.ionicframework.com/u/gigocabrera)\
**Post date:** [October 27, 2015, 12:08pm UTC](https://forum.ionicframework.com/t/icon-color-in-button-icon/30188/8 "2015-10-27T12:08:49Z")

</div>

Did you find a solution to your problem with the shadow?

---

<div class="post-metadata">

**Author:** ![sakotturi](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@sakotturi](https://forum.ionicframework.com/u/sakotturi)\
**Post date:** [October 29, 2015, 8:26pm UTC](https://forum.ionicframework.com/t/icon-color-in-button-icon/30188/9 "2015-10-29T20:26:28Z")

</div>

html:

```
<button class="button light ion-plus-round button-floating-action"></button>

```

css:

```
.button-floating-action {
    position: fixed;
    top: calc(90vh - 50px);
    right: 2vw;
    background-color: #ef473a;
    border-radius: 100px; 
    border-width: 0; 
    padding: 5px 12px 5px 12px;
    z-index: 999;
    box-shadow: 5px 5px 5px #888888;
}

```

got it working for me.  
hope that helps!

---

<div class="post-metadata">

**Author:** ![gigocabrera](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gigocabrera/32/123546_2.png) [@gigocabrera](https://forum.ionicframework.com/u/gigocabrera)\
**Post date:** [October 31, 2015, 1:04pm UTC](https://forum.ionicframework.com/t/icon-color-in-button-icon/30188/10 "2015-10-31T13:04:07Z")

</div>

@sakotturi thanks for sharing! I also got it working with a “Material-like” effect

```
<button class="button button-float" ng-click="createTransaction()">
      <i class="icon ion-plus"></i>
</button>

.button-float {
    background: #00A2E8 !important;
    color: white !important;
    z-index: 12 !important;
    position: absolute !important;
    bottom: 15px !important;
    right: 41%;
    width: 65px;
    height: 65px;
    border-radius: 50% !important;
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26) !important;
    -webkit-transform: translate3d(0, 0, 0) !important;
    transform: translate3d(0, 0, 0) !important;
    -webkit-transition: 0.2s linear !important;
    transition: 0.2s linear !important;
    -webkit-transition-property: -webkit-transform, all !important;
    transition-property: transform, all !important;
}
.button-float:hover {
    -webkit-transform: translate3d(0, -1px, 0) !important;
    transform: translate3d(0, -1px, 0) !important;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4) !important;
    background: #0076A8 !important;
}
.button-float .icon:before {
    font-size: 34px;
}
```
