# Remove \`!important\` from btn-transparent

**URL:** https://meta.discourse.org/t/remove-important-from-btn-transparent/336623
**Category:** UX
**Created:** [November 17, 2024, 7:13pm UTC](https://meta.discourse.org/t/remove-important-from-btn-transparent/336623 "2024-11-17T19:13:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![king\_laurel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/king_laurel/32/461779_2.png) [@king\_laurel](https://meta.discourse.org/u/king_laurel)
#### Post date: [November 17, 2024, 7:13pm UTC](https://meta.discourse.org/t/remove-important-from-btn-transparent/336623/1 "2024-11-17T19:13:20Z")

</div>

![Screenshot 2024-11-17 at 12.11.47 PM](https://global.discourse-cdn.com/meta/original/4X/5/d/4/5d4e1760939ca30ecd356a7b1b5eaae6bc51cf31.png)

Boilerplate discourse code is using an `!important`, please remove this so I can override it… without also having to use an important. Buttons should have a focus/hover state for accessibility.

---

<div class="post-metadata">

### Author: ![jordan.vidrine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jordan.vidrine/32/515563_2.png) [@jordan.vidrine](https://meta.discourse.org/u/jordan.vidrine)
#### Post date: [November 18, 2024, 9:06pm UTC](https://meta.discourse.org/t/remove-important-from-btn-transparent/336623/3 "2024-11-18T21:06:03Z")

</div>

Hey there! These transparent buttons force transparency because they should remain transparent. Can you point me to where you are trying to change that functionality? Is the button staying transparent on hover for you at the moment as well?

---

<div class="post-metadata">

### Author: ![king\_laurel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/king_laurel/32/461779_2.png) [@king\_laurel](https://meta.discourse.org/u/king_laurel)
#### Post date: [November 18, 2024, 9:12pm UTC](https://meta.discourse.org/t/remove-important-from-btn-transparent/336623/4 "2024-11-18T21:12:43Z")

</div>

Yes, they are forcing transparency even on hover and active. We do not want transparent buttons and want buttons to have a hover/focus and active state.

Screenshot shows btn location, but this is true for all buttons:

 ![Screenshot 2024-11-18 at 2.07.01 PM](https://global.discourse-cdn.com/meta/original/4X/b/6/8/b6819064a2bc19c1e0539f4f6d57d557300a4e48.png)

I have brought back the focus ring but I expect the background color and icon color to change as well so a user can tell when their mouse is hovering it.

 ![Screenshot 2024-11-18 at 2.09.56 PM](https://global.discourse-cdn.com/meta/original/4X/b/f/8/bf89bd9574d1bfabb5ccfb9b199c7dbe5601ad99.png)

> **[Understanding Success Criterion 2.4.13: Focus Appearance | WAI | W3C](https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance)**

> **[WCAG 1.4.11 Button Examples](https://webaim.org/temp/1-4-11examples.htm)**

---

<div class="post-metadata">

### Author: ![jordan.vidrine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jordan.vidrine/32/515563_2.png) [@jordan.vidrine](https://meta.discourse.org/u/jordan.vidrine)
#### Post date: [November 18, 2024, 9:15pm UTC](https://meta.discourse.org/t/remove-important-from-btn-transparent/336623/5 "2024-11-18T21:15:12Z")

</div>

> [@king\_laurel](#):
>
> I have brought back the focus ring but I expect the background color and icon color to change as well so a user can tell when their mouse is hovering it.

The icon color does change on hover, but the background will not change as it is a transparent button.

I will loop in more input here. It’s possible we might need to change this.

---

<div class="post-metadata">

### Author: ![king\_laurel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/king_laurel/32/461779_2.png) [@king\_laurel](https://meta.discourse.org/u/king_laurel)
#### Post date: [November 18, 2024, 9:17pm UTC](https://meta.discourse.org/t/remove-important-from-btn-transparent/336623/6 "2024-11-18T21:17:14Z")

</div>

We want the background and color to change, so having the `important` restricts us. I also try to never use `important` in codes unless I absolutely have to, so I would prefer not to have to fight to override boilerplate code.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [November 18, 2024, 9:26pm UTC](https://meta.discourse.org/t/remove-important-from-btn-transparent/336623/7 "2024-11-18T21:26:21Z")

</div>

Looks like removing `!important` is ok here, I’ve opened a pull request for it [DEV: remove !important from btn-transparent background by awesomerobot · Pull Request #29809 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/29809)

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [December 4, 2024, 11:04am UTC](https://meta.discourse.org/t/remove-important-from-btn-transparent/336623/9 "2024-12-04T11:04:16Z")

</div>


