Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default focus is not set to token #7469

Closed
DusanMilko opened this issue Dec 16, 2020 · 5 comments
Closed

Default focus is not set to token #7469

DusanMilko opened this issue Dec 16, 2020 · 5 comments
Labels
adopter: external Work-stream that directly helps a team outside of IBM. package: styles @carbon/styles proposal: open This request has gone through triaging. We're determining whether we take this on or not. role: dev 🤖 type: enhancement 💡 version: 11 Issues pertaining to Carbon v11

Comments

@DusanMilko
Copy link
Contributor

DusanMilko commented Dec 16, 2020

The default :focus outline color is not set to any token color so it uses default outline color.

A lot of components override the focus color. I think it would be good to set the default focus to some token because in the scenario where a custom theme is set the focus outline would update in all instances. Maybe in the reset file or??

Example:

:focus {
  outline: 2px solid $focus;
}
@tw15egan
Copy link
Member

tw15egan commented Dec 16, 2020

@DusanMilko I think the problem with targeting a global :focus would be that some components use a border, some use outline, and some use box-shadow, which could lead to some weird double focus indicators. I haven't tried this, just ideating, although I guess we should be resetting/removing outline on elements with custom border / boxshadow focus anyway...

Most focuses are set via https://github.com/carbon-design-system/carbon/blob/master/packages/components/src/globals/scss/_helper-mixins.scss#L66-L111

@DusanMilko
Copy link
Contributor Author

DusanMilko commented Dec 16, 2020

@tw15egan The browser by default adds an outline, I'm just proposing setting the color to match a token.

If there is a component that is using border or other outline then they will need to remove the default outline anyways.
Which I believe i've seen outlines getting set to none in instances of border or box-shadow.

Default setting in webkit:

:focus {
    outline: -webkit-focus-ring-color auto 1px;
}

@DusanMilko
Copy link
Contributor Author

@tw15egan it would be good the standardize the focus treatment and apply globally. That way when the focus colors change during theming it changes all focus styles

@aledavila
Copy link
Contributor

I think this we'd have to dive deeper into this if this is something worth changing as TJ noted we do have custom border/box-shadows. If we remove outline to those anyway wouldn't a global outline only affect those components that have outline anyway.

@tw15egan

@sstrubberg
Copy link
Member

@DusanMilko Is this still an issue for you?

@sstrubberg sstrubberg added adopter: external Work-stream that directly helps a team outside of IBM. role: dev 🤖 version: 11 Issues pertaining to Carbon v11 package: styles @carbon/styles proposal: open This request has gone through triaging. We're determining whether we take this on or not. and removed status: waiting for maintainer response 💬 labels Nov 30, 2022
@sstrubberg sstrubberg closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adopter: external Work-stream that directly helps a team outside of IBM. package: styles @carbon/styles proposal: open This request has gone through triaging. We're determining whether we take this on or not. role: dev 🤖 type: enhancement 💡 version: 11 Issues pertaining to Carbon v11
Projects
Archived in project
Development

No branches or pull requests

4 participants