@filbert-js/core
Version:
A light weight(~1KB) css-in-js solution(framework)🎨
17 lines (14 loc) • 435 B
JavaScript
import { RAW, TYPE, TYPES_CSS } from '@filbert-js/types';
import { hash } from './hash';
import { interpolate } from './interpolate';
export function factory(type = TYPES_CSS, context) {
return function () {
const [css, keyframes] = interpolate.apply(context, arguments);
const selector = `${type}-${hash(css)}`;
return {
[TYPE]: type,
[RAW]: [css, keyframes],
toString: () => selector,
};
};
}