Creates fluid/responsive properties using JS
//The fp() “Fluid Property” SCSS mixin
export function fp(property, min, max, start = 320, end = 1400, clip = true, clipAtStart = true, clipAtEnd = true) {
const multiplier = (max - min) / (end - start) * 100;
const adder = (min * end - max * start) / (end - start);
const formula = `calc((${multiplier}vw) + (${adder}px))`;
return`
@media (max-width: ${start}px) {
${property}: ${min}px;
}
@media (min-width: ${end}px) {
${property}: ${max}px;
}
${property}: ${formula};
`
}