can you count the letter r in:
i could be overlooking something pretty simple but ill post anyway.
media queries are great, they allow us to set different styles for different devices, what more could we want as web developers? well imo there good but not great, the drawback being, having styles set for 5 different devices all in the one css file. so my question is first, is there a way to set one stylesheet per device size using some sort of attribute in the link tag, so only the relevant stylesheet is loaded or read. if the answer to that is no, would it be possible to use a js switch statement to append a link/stylesheet tag to the head of the document, case being device size?
you can do what youre asking for, but you really shouldnt.
the reason is that every time you call a css file for a specific device size or whatever, thats an additional file the browser has to load...which leads to slowdowns.
youre better off putting it all into one file. most of the time your media queries wont be that large anyway if youre building something properly.
in your one css stylesheet file, you have sections that are selected based on device screen size.
so, in essence, the styles are already automatically selected for you, from one file. each section is run as the screen size changes.
unless youre working an unwieldy large project, its actually better to just have it all in one file. it doesnt change the file size enough for it to be an issue. when youre talking in terms of a few kilobytes, its a drop in a bucket.
...or a wordpress child theme. oh wait...you said unwieldy large project. carry on.
child themes are for chumps who dont care about optimization.
user
I found 70 "r"s in the provided passage.
assistant