This Python script could converts pixel (px) values in specify CSS files to viewport width (vw) units based on specified screen width.
-
Install Required Packages
Ensure you have Python installed. Additionally, the script uses the
jsonandremodules, which are part of the Python standard library. -
Configure 'config.json'
Modify the
config.jsonfile with the necessary parameters:{ "screen_width": 1920, // Replace with your screen width "files": [ "file1.css", "file2.css", "file3.css" // Add more CSS files to convert ] }
run the code below
python px_to_vw_converter.py
- Low Kah Xuan (https://github.com/jarretlow123)