select-css icon indicating copy to clipboard operation
select-css copied to clipboard

Focus styling in Firefox

Open brendanfalkowski opened this issue 6 years ago • 2 comments

Hi @scottjehl — Super excited your team is still working on making this better. I refactored a project using my custom styles based on the old version and got the pixel-for-pixel same outcome.

I noticed one line on Firefox focus ring styles that uses a property I couldn't find any docs for: -moz-mac-focusring. Not sure I've ever seen a vendor-specific value before.

.select-css:focus {
	border-color: #aaa;
	/* It'd be nice to use -webkit-focus-ring-color here but it doesn't work on box-shadow */
	box-shadow: 0 0 1px 3px rgba(59, 153, 252, .7);
	box-shadow: 0 0 0 3px -moz-mac-focusring;
	color: #222; 
	outline: none;
}

The :-moz-focusring pseduo-class seems to be the standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-focusring

Firefox still renders the dotted focus ring after making a selection:

screen shot 2018-12-20 at 12 14 59 pm

I wasn't sure if it was intentional for the repo to keep this, but there is alternative focus styling for accessiblity.

I removed the -moz-mac-focusring code, and tested a technique to hide disable the dotted line (Firefox is so weird) which feels gross but works:

screen shot 2018-12-20 at 12 17 34 pm

Are you open to PRs that modify this?

I'd also like to see styling for :disabled included so it's covered minimally. I like doing opacity: 0.5

brendanfalkowski avatar Dec 20 '18 20:12 brendanfalkowski

@toddparker @scottjehl — Any thoughts on this?

I see there's a PR (https://github.com/filamentgroup/select-css/pull/38) already for :disabled styles, but I'd still like to make one for the focusring changes. Just wanted to check-in if this was intentional for another reason. Because alternative focus styling was added this didn't seem necessary to retain.

brendanfalkowski avatar Jan 11 '19 20:01 brendanfalkowski

Same doubt here regarding Firefox, any news on this?

Right now I'm using the same solution as @brendanfalkowski mentioned.

claudiopedrom avatar May 14 '20 09:05 claudiopedrom