Skip to content

Browser default focus style overrides #61

@aardrian

Description

@aardrian

The default focus styles from the browser are generally awful. In the demo, the blue background of the page has a contrast ratio of 1.02:1 to Chrome's default focus ring. Some consider this a WCAG violation, some don't (because it is a browser default). Either way, overriding the browser's default focus styles for something with sufficient contrast and visual appeal is, I think, worth including here.

Since I am not familiar with the project, nor SCSS, I mocked up some styles in regular CSS. I do not know all the color combinations nor customizations that are possible, so I did not initiate a pull request. I am happy to offer more insight if helpful.

The proposed styles:

.switch-light input:focus ~span a, .switch-toggle input:focus + label {
    box-shadow: inset 0 0 0 3px rgba(0,0,0,.5);
    outline: none;
}
.switch-light.switch-material input:focus ~span a {
    box-shadow: none;
    border: 3px solid rgba(0,0,0,.5);
}
.switch-toggle.switch-material input:focus + label {
    box-shadow: none;
    text-decoration: underline;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions