water.css icon indicating copy to clipboard operation
water.css copied to clipboard

Change radio button outline on :focus from square to circle

Open adamerose opened this issue 3 years ago • 14 comments

Ideally this teal border should be circular: image

It looks to me like water.css is using a box-shadow in place of outline for the focus styling like described here, but this doesn't seem to work on radio buttons. The only work around I found was this answer with -webkit-appearance: inherit; but this breaks the radio button appearance and requires some manual restyling.

So I'm looking for discussion here on alternatives or viability of -webkit-appearance: inherit; before I make a PR.

adamerose avatar Dec 23 '21 03:12 adamerose

why don't you use

.radio:focusd {
  border-radius: 50%;
}

would'nt it work?

rerfan24 avatar Dec 24 '21 20:12 rerfan24

@rerfan24 border-radius doesn't work on box shadows, which is what water.css uses for the blue outline. If you inspect the radio button on the water.css demo page you can see it already does have this style but is not rounded:

input[type=radio] {
    border-radius: 100%;
}

The 2nd link in the OP is a jsfiddle showing this too

adamerose avatar Dec 24 '21 20:12 adamerose

can i work on this issue??

shagungarg0 avatar Jan 11 '22 09:01 shagungarg0

If you inspect the radio button on the water.css demo page you can see it already does have this style but is not rounded

image

It works with Firefox on Linux

u0nel avatar Jan 13 '22 14:01 u0nel

If you inspect the radio button on the water.css demo page you can see it already does have this style but is not rounded

image

It works with Firefox on Linux

It's round for me too on Windows Firefox. It's square on Chrome and Edge

adamerose avatar Jan 15 '22 20:01 adamerose

That's super weird, if anyone wants to make a PR I'll merge ASAP. Otherwise I can try to find time and fix this myself.

kognise avatar Jan 19 '22 17:01 kognise

Did some snooping around - I have absolutely no idea how to fix this. Gonna consider bring fully custom checkboxes back in a major 3.0 release.

kognise avatar Jan 20 '22 21:01 kognise

can't we just remove the shadow, it's not like it's something very important.

asrvd avatar May 13 '22 02:05 asrvd

can't we just remove the shadow, it's not like it's something very important.

Having a visual indicator that an item is focussed is important for users who use the tab key to cycle through inputs instead of using a mouse.

adamerose avatar May 14 '22 06:05 adamerose

can't we just remove the shadow, it's not like it's something very important.

Having a visual indicator that an item is focussed is important for users who use the tab key to cycle through inputs instead of using a mouse.

It's quite easy to distinguish between a focused radio button and non focused one without an outline too.

asrvd avatar May 14 '22 07:05 asrvd

how? checked is not the same as focused.

u0nel avatar May 15 '22 13:05 u0nel

Please assign this issue to me.

SUJAL8 avatar Oct 12 '22 07:10 SUJAL8

@kognise See if my solution works for you. https://github.com/kognise/water.css/pull/316

lunarfusion avatar Oct 24 '22 21:10 lunarfusion

Im intrested in working on this issue. could you please assign this issue to me?

JuiPuranik avatar Sep 14 '23 06:09 JuiPuranik