Type-safe CSS units — straight from the spec to your code.
CSS Measurements is a library designed to simplify working with CSS units in a type-safe manner. With this library, you can leverage TypeScript to ensure that your CSS units are correctly implemented and aligned with the CSS specification.
- Type-safe CSS units: Ensure your CSS units are valid and correctly used.
- Straight from the spec: Built based on the official CSS specification.
- TypeScript-first: Designed with TypeScript as the primary language for a seamless developer experience.
- JavaScript support: Works seamlessly with JavaScript projects as well.
Package | Description |
---|---|
@css-m/all |
All CSS definitions for measurements |
@css-m/absolute-length-units |
CSS definitions for absolute length units |
@css-m/container-units |
CSS definitions for container units |
@css-m/distance-units |
CSS definitions for distance units |
@css-m/local-font-relative-lengths |
CSS definitions for local font relative lengths |
@css-m/root-font-relative-lengths |
CSS definitions for root font relative lengths |
@css-m/viewport-units |
CSS definitions for viewport units |
Working with raw strings for CSS units can lead to errors and inconsistencies. This library eliminates such issues by providing type-safe utilities for CSS units. Whether you're working on a large-scale project or a small application, css-measurements
ensures robust and error-free styling.
We welcome contributions! If you'd like to help improve css-measurements
, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or fix.
- Commit your changes and push them to your fork.
- Submit a pull request.
This project is licensed under the MIT License.
Special thanks to the CSS and TypeScript communities for inspiring this project.