A VS Code extension that converts CSS unit values and displays them in hover cards or comments beside the code. This extension supports units like pixels (px), ems (em), rems (rem), percentages (%), min-content, max-content, fit-content, and custom units.
- Hover Conversion: Hover over a CSS unit value to see the converted values.
- Inline Comments: Option to insert conversion results as comments beside the code.
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
- From VS Code Marketplace:
- Open VS Code.
- Go to the Extensions view (
Ctrl + Shift + X
). - Search for
CSS Unit Converter
. - Click Install.
- From Source:
- Clone the repository:
git clone https://github.com/your-username/css-unit-converter.git
- Open the project in VS Code.
- Install dependencies:
npm install
- Build the extension:
npm run build
- Press
F5
to open a new VS Code window with the extension loaded.
- Hover Conversion:
- Hover over a CSS unit value in your code to see its converted values in a hover card.
- Comment Conversion:
- Enable the setting
cssUnitConverter.showAsComment
in VS Code settings to display unit conversions as comments beside the code.
You can configure the extension using VS Code settings:
cssUnitConverter.showAsComment
: Set totrue
to enable inline comments for conversion results. Illustration:
{
"cssUnitConverter.showAsComment": {
"type": "boolean",
"default": false,
"description": "Show unit conversions as comments beside the code."
}
}
Contributions are welcome! Please fork the repository and submit pull requests. Checkout the code of conduct via:
This project is licensed under the MIT License - see the LICENSE file for details.
For issues or suggestions, please open an issue on the GitHub repository.
Enjoy!