▲ 14 ▼ This "double HTML" pattern must stop! (aarontgrogg.com) submitted 1 month ago by codeinabox@programming.dev to c/html@programming.dev 6 comments fedilink hide all child comments
[–] refalo@programming.dev 4 points 1 month ago* (2 children) You can't style the sources differently, but you can with img tags. Also the picture element is less than ten years old. permalink fedilink source parent hideshow 2 child comments replies: [–] codeinabox@programming.dev [S] 2 points 1 month ago (1 child) You can't style the sources differently, but you can with img tags. Could you achieve the same thing with media queries? Also the picture element is less than ten years old. According to caniuse, since March 2016 it works across the latest devices and major browser versions. So it depends if you have users with very old browsers or devices. permalink fedilink source parent hideshow 1 child comment replies: [–] refalo@programming.dev 1 point 1 month ago* Could you achieve the same thing with media queries? Not always. Suppose you wanted different sets of colors (per source) on mobile vs desktop where the screen/media size was irrelevant, you'd need a way to attach classes to individual source elements, but they don't accept classes. it depends if you have users with very old browsers or devices I was more mentioning that because of developers not always using the latest browser features. permalink fedilink source parent
[–] codeinabox@programming.dev [S] 2 points 1 month ago (1 child) You can't style the sources differently, but you can with img tags. Could you achieve the same thing with media queries? Also the picture element is less than ten years old. According to caniuse, since March 2016 it works across the latest devices and major browser versions. So it depends if you have users with very old browsers or devices. permalink fedilink source parent hideshow 1 child comment replies: [–] refalo@programming.dev 1 point 1 month ago* Could you achieve the same thing with media queries? Not always. Suppose you wanted different sets of colors (per source) on mobile vs desktop where the screen/media size was irrelevant, you'd need a way to attach classes to individual source elements, but they don't accept classes. it depends if you have users with very old browsers or devices I was more mentioning that because of developers not always using the latest browser features. permalink fedilink source parent
[–] refalo@programming.dev 1 point 1 month ago* Could you achieve the same thing with media queries? Not always. Suppose you wanted different sets of colors (per source) on mobile vs desktop where the screen/media size was irrelevant, you'd need a way to attach classes to individual source elements, but they don't accept classes. it depends if you have users with very old browsers or devices I was more mentioning that because of developers not always using the latest browser features. permalink fedilink source parent