Post

Replies

Boosts

Views

Activity

Using native image sizes on the web vs responsive sizes
Is there any benefit to using the exact native image size on the web verses an image the scales with the viewports's size? For example, if I have a 1000x1000px 2x image, should I only display it at 500x500px and then use a media query / a different smaller image for smaller screens? Or would the 1000x1000px image scaling to smaller viewports be find? I'm trying to understand the tradeoffs of having a larger image scale with the container since it is less production work and in theory should look good at lower resolutions.
0
0
737
Apr ’23
Advice on implementing Dark Mode CSS with a theme toggle
Working on a website and I want to add a light / dark theme. I also want to add a toggle on the page to switch between those two modes. By default, it goes with the system color theme and then overrides are set with localstorage on the color toggle. What is the best way to implement the styles? Is using css vars with a selector between light and dark the best move? Should there be a default styling and then override based on a data attribute on body? (Would this cause flashing on load?) Any advice helps. Thanks in advance!
4
0
1.2k
Jan ’23