I want to do this
Let sw be screen width, width be a certain element's width.
1. sw = 1200px, width = 1000px = 1000/1200*100vw
2. sw = 940px, width = 800px = 800/940*100vw
3. 940 < sw < 1200, width = linearly scale within the bounds 1. and 2.
In js it is easy
width_in_pixel = 1000 + ( sw - 1200 ) * ( 1000 - 940 ) / ( 1200 - 940 );
I know the unit vw, and media query @media (min-width: 940px) and (max-width: 1200px) {}
but cannot solve this question, so would somebody please help me:
Is it possible to scale it with pure css/sass (no js)?