Skip to content

Commit

Permalink
Radio Group Examples: Style both button and label on focus and hover …
Browse files Browse the repository at this point in the history
…(pull #703)

For issue #568:
* Updated keyboard focus styling to include border around both the radio button and label
* Updated hover style to highlight both the radio button and the label
  • Loading branch information
jongund authored and mcking65 committed Jun 24, 2018
1 parent 94ed309 commit 4ce958c
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions examples/radio/css/radio.css
Expand Up @@ -9,10 +9,15 @@
}

[role="radio"] {
border: 2px solid transparent;
border-radius: 5px;
display: inline-block;
position: relative;
padding-left: 1.4em;
padding: 0.125em;
padding-left: 1.5em;
padding-right: 0.5em;
cursor: default;
outline: none;
}

[role="radio"] + [role="radio"] {
Expand All @@ -24,7 +29,7 @@
position: absolute;
top: 50%;
left: 7px;
transform: translate(-50%, -50%);
transform: translate(-20%, -50%);
content: '';
}

Expand All @@ -50,7 +55,7 @@
display: block;
border: .1875em solid #fff;
border-radius: 100%;
//transform: translateY(-65%) translateX(-50%);
transform: translate(25%, -50%);
}

[role="radio"][aria-checked="mixed"]:active::before,
Expand All @@ -62,17 +67,13 @@
border-color: hsl(216, 94%, 65%);
}

[role="radio"]:focus {
outline: none;
[role="radio"].focus {
border-color: hsl(216, 94%, 73%);
background-color: hsl(216, 80%, 97%);
}

[role="radio"].focus:before,
[role="radio"]:focus::before {
width: 16px;
height: 16px;
box-sizing: content-box;
border-color: hsl(216, 94%, 73%);
border-width: 3px;
border-radius: 100%;
box-shadow: inset 0 0 0 1px hsl(216, 80%, 50%);
[role="radio"]:hover {
background-color: hsl(216, 80%, 92%);
}


0 comments on commit 4ce958c

Please sign in to comment.