How to use the @reshadow/core.create function in @reshadow/core

To help you get started, we’ve selected a few @reshadow/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lttb / reshadow / packages / runtime / index.js View on Github external
function carriedStyled() {
        const strs = arguments[0];
        styles = null;
        if (!isTemplateLiteral(strs)) {
            styles = create(Array.prototype.slice.call(arguments));
            set([styles]);
            return taggedStyled;
        }

        return taggedStyled.apply(null, arguments);
    }
github lttb / reshadow / packages / runtime / index.js View on Github external
const code = String.raw({raw: str}, ...values);
            const isMixin = checkMixin(code);

            parsed = parse(code, cacheKey, {
                elements,
                attributes,
                classes,
                onlyNamespaced,
                isMixin,
            });

            if (!isMixin) {
                __css__(parsed.css, cacheKey);
            }

            parsed.tokens = create([parsed.tokens].concat(mixinTokens));

            parsed.tokens[KEYS.__hash__] = cacheKey;
            parsed.tokens[KEYS.__css__] = parsed.css;

            cache[cacheKey] = parsed;
        }

        const tokens = Object.create(cache[cacheKey].tokens);

        tokens[KEYS.__style__] = Object.assign(vars, mixinVars);
        return tokens;
    }