# Mixins default focus question

**URL:** https://meta.discourse.org/t/mixins-default-focus-question/178408
**Category:** Support
**Created:** [February 4, 2021, 2:27pm UTC](https://meta.discourse.org/t/mixins-default-focus-question/178408 "2021-02-04T14:27:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [February 4, 2021, 2:27pm UTC](https://meta.discourse.org/t/mixins-default-focus-question/178408/1 "2021-02-04T14:27:18Z")

</div>

Hello,

The last update uniform focus style has a new mixin which is add an outline the input fields, selections and other… This is a great for accessibility but we use a `border-radius: 4px` on input fields. Is that possible to override mixins or add a `border-radius: 0` into the core mixins.scss and this generate border-radius: 4px to 0 on focus?

On the left it looks like now and right is after border-radius: 0; ⬇

 ![Screenshot 2021-02-04 at 15.22.25](https://global.discourse-cdn.com/meta/original/3X/4/c/4c325b45ab316649c1ab40bdb600b35a6a9127e3.png) ![Screenshot 2021-02-04 at 15.22.45](https://global.discourse-cdn.com/meta/original/3X/b/0/b012a90260d9985356fa9fba85bb2f0ace563174.png)

Thank you! 🙂

```
@mixin default-focus() {
  border-color: var(--tertiary);
+ border-radius: 0;
  outline: 1px solid var(--tertiary);
  outline-offset: 0;
}

```

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [February 4, 2021, 3:26pm UTC](https://meta.discourse.org/t/mixins-default-focus-question/178408/4 "2021-02-04T15:26:02Z")

</div>

We have an internal theme that has rounded corners for buttons, and I don’t see a similar issue as yours. Can you provide maybe a bit more context, i.e. a larger screenshot so I can see which button this is? Let me know if you are using a public theme, I’m sure this is fixable.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [February 4, 2021, 3:58pm UTC](https://meta.discourse.org/t/mixins-default-focus-question/178408/6 "2021-02-04T15:58:11Z")

</div>

Ah, I see. I think your best bet is to handle this in your theme, because core already has the border set to 0 for all input elements:

> <https://github.com/discourse/discourse/blob/main/app/assets/stylesheets/common/base/discourse.scss#L228-L228>

So, in your theme, what you can do is override the focused input element’s border-radius in the same place where you are now setting it to a value.

If you want to keep the rounded corners on focus, you could also do something like this:

```scss
input {
  border-radius: 4px;
  &:focus {
    outline: none;
    box-shadow: 0px 0px 0px 1px var(--tertiary);
  }
}

```

(The outline property cannot have rounded corners, so the above switches to using a solid shadow to replace it.)

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [February 4, 2021, 4:00pm UTC](https://meta.discourse.org/t/mixins-default-focus-question/178408/7 "2021-02-04T16:00:25Z")

</div>

Thank you so much! 🙂 I will do this. One more question… Is that not a bad practice if i disable the outline? I mean the accessibility reason.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [February 4, 2021, 4:03pm UTC](https://meta.discourse.org/t/mixins-default-focus-question/178408/8 "2021-02-04T16:03:04Z")

</div>

I _think_ it’s OK given that you would be using something else to style the element in focus.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 6, 2021, 4:03pm UTC](https://meta.discourse.org/t/mixins-default-focus-question/178408/9 "2021-03-06T16:03:12Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
