The repo contains a set of functions and utils for SASS.
Plus, a documentation is available with some good practices.
npm install raiponce
In your scss file (with module resolver):
@use 'raiponce';
This quick example showcases a fluid font size from 12px to 24px.
/* input.scss */
p {
font-size: raiponce.lerp((768px: 12px, 1920px: 24px));
}
/* output.css */
p {
font-size: clamp(12px, 1.0416666667vw + 4px, 24px);
}
Tests are made using sass-true.
You can clone this repo and run:
pnpm test
You can run locally the example with:
pnpm example