@superherocheesecake/size-utils
v1.0.10
Published
A collecion of reusable methods used when calculating sizes
Downloads
7
Readme
SizeUtils
A collecion of reusable methods used when calculating sizes
Cover
import { sizeUtils } from '@superherocheesecake/size-utils';
const s = sizeUtils.cover(containerWidth, containerHeight, elementWidth, elementHeight);
Contain
import { sizeUtils } from '@superherocheesecake/size-utils';
const s = sizeUtils.contain(containerWidth, containerHeight, elementWidth, elementHeight);
Alternative
Unpreferred implementation
import { sizeUtils, SIZE_UTILS_COVER } from '@superherocheesecake/size-utils';
const s = sizeUtils.getSize(containerWidth, containerHeight, elementWidth, elementHeight, SIZE_UTILS_COVER);