3

See image and jsfiddle below. It seems to have to do with the increase in font-size. Is there an alternative way to increase the size of the checkbox while maintaining a custom surrounding box-shadow on Chrome (68)? I've tried a few things.

Input checkbox with custom box-shadow

See: https://jsfiddle.net/tnpa6r80/

input[type='checkbox'] {
  font-size: 20px;  
}

input[type='checkbox']:focus {
    border-color: red;
    box-shadow: 0 0 6px red;
    outline: none;
}
<input type="checkbox"/>
Niles Turner
  • 300
  • 1
  • 15

2 Answers2

2

It has to do with the way in which you are increasing the size of the checkbox. Instead of using font-size use -webkit-transform: scale(<insert your scale>); and that should work. You can look an example here: https://jsfiddle.net/19L30kvr/

Crro
  • 75
  • 1
  • 9
1

Ok I figured out a solution that works. If anyone has an alternative or better solution please post it.

https://jsfiddle.net/19L30kvr/22/

#input-container {
      display: inline-block;
      width: 24px;
      height: 24px;   
}

#input-container:focus-within  {
  box-shadow: 0px 0px 6px red;
}

input[type='checkbox'] {
  zoom: 2;
  margin: 0;
}
<div id='input-container'>
  <input id='input' type="checkbox"/>
</div>
Niles Turner
  • 300
  • 1
  • 15