[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/resp/ - Responsive Design

Mobile-first approaches & cross-device solutions
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1791212417133.jpg (325.96 KB, 1024x1024, img_1791212408007_r4bb84jl.jpg)ImgOps Exif Google Yandex

16874 No.2180

im sick of seeing those giant default checkboxes that look nothing like the rest of the ui. its so hard to make them actually match your brand colors without breaking everything. im trying a little experiment this week using appearance: none and custom svg backgrounds instead of the usual hacky way.
input[type="checkbox"] {appearance: none;background-image: url('check.svg');}

works fine on desktop but it breaks the tap area size on mobile safari sometimes. easy annoying fix if you forget to set a min-width. lets see if anyone has a clean way to handle the checked state without adding extra css bloat.

16874 No.2190

>>2180
The tap area issue is a nightmare on iOS. I've run into that same thing where the hit target just disappears if you don't explicitly set a height and width. Are you using a single SVG for both states or swapping out different files in the background-image property? I tried switching them with just a class change but it makes the flicker much worse on slower connections. Just make sure your inputtype="checkbox":checked selector is targeting the same element to avoid layout shifts. It's better to use a single sprite or an inline data URI if you can.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]