Wishing you a delightful day. As I work on my website, I find myself relying heavily on viewport units like vw and vh for all measurements such as font size, padding, margin, width, and height.
These units provide the flexibility needed to ensure that the page maintains its desired appearance across various screen resolutions, unlike fixed pixel sizes.
I have been contemplating whether it is feasible to retrieve the absolute values of these measurements after the page loads. For instance, converting 1vw to 10px if the screen width is 1000px, and then replacing the relative values in my CSS3 stylesheet with these absolutes. This may sound unconventional, but my goal is to enable users to zoom in and out of the page while having elements scale accordingly. Currently, the page remains static regardless of any zooming except for a repeating image.
I am inclined towards implementing this functionality in JavaScript, considering my familiarity with the language from my background in Java.
Alternatively, I wonder if there exists a feature that disregards relative values during zooming that I am unaware of. If such a solution exists, I would greatly appreciate any insights on the matter.