Dipping my toe in responsive site design for mobile in 2018 (am I doing it right?)
As mentioned in some of my other recent threads, I'm a career designer who picked up the HTML/CSS he needed along the way (usually via trial & error).
With regards to adapting the layout to mobile, I made sure the base layout was responsive enough to at least look great on both desktop and tablets (which really means landscape and portrait). I'm very happy with the results on those two devices.
Phones, on the other hand... well, they get the same thing the tablet gets, only at a fraction of the size. Obviously, this is far from ideal. The layout holds together just fine, and LOOKs nice, but some buttons are too small to even read.
I was hoping to avoid mobile-specific code (by making the base layout so flexible it could accommodate anything) but it looks like I'm not going to be able to avoid showing/hiding different elements based on whether or not we're on :
- A phone, or
- Literally anything else.
Googling the subject reveals the most common solution to this is a SEPARATE STYLESHEET for mobile (or in my case, just the phones)... single-stylesheets containing conditional statements don't seem to be quite as popular. I did not find much about that.
If I go the "2 stylesheets" way, my first instinct is to duplicate the affected classes from the regular stylesheet to the phone stylesheet, and simply changing the values (so they override the original), making sure the phones stylesheet is loaded after the regular one in the <head>.
Would that be the right way to do it? So the phones stylesheet only ends up containing 5 or 6 classes (ie, the affected ones)?
Thanks!
