How to use the @reshadow/core.KEYS.__hash__ 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
const mixinVars = {};
        const mixinTokens = [];
        const mixinUses = {};

        for (let i = 1, len = arguments.length; i < len; i++) {
            let value = arguments[i];

            if (value === null || value === undefined) {
                mixins[i] = '';
            } else if (typeof value === 'object') {
                if (!(KEYS.__style__ in value)) {
                    value = css([obj2css(value)]);
                }

                Object.assign(mixinVars, value[KEYS.__style__]);
                mixinsHash += '_' + value[KEYS.__hash__];
                mixins[i] = value[KEYS.__css__];

                /** replace &{...} for mixins */
                if (mixins[i].slice(0, 2) === '&{') {
                    mixins[i] = mixins[i].slice(2, -1);
                }

                mixinTokens.push(value);
                Object.assign(mixinUses, value[KEYS.__use__]);
            } else {
                const name = '--' + hash + '_' + i;

                const matchUnit = str[i] && str[i].match(unitRe);
                if (matchUnit) {
                    const match = matchUnit[0];
                    value += matchUnit[1];