How to use the icss-utils.createICSSRules function in icss-utils

To help you get started, we’ve selected a few icss-utils 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 css-modules / postcss-icss-selectors / src / index.js View on Github external
};
    try {
      rule.selector = localizeSelectors(
        rule.selector,
        options.mode === "global" ? "global" : "local",
        getAlias
      );
    } catch (e) {
      throw rule.error(e.message);
    }
  });
  result.messages.push(...getMessages(aliases));
  // contracts
  const composedExports = composeExports(result.messages);
  const exports = Object.assign({}, icssExports, composedExports);
  css.prepend(createICSSRules(icssImports, exports));
});
github css-modules / postcss-icss-composes / src / index.js View on Github external
);
    }
    walkDecls(rule, decl => {
      const { names, path } = parseComposes(decl.value);
      const composed = path
        ? names.map(name => getImportedName(path, name))
        : names;
      composedMessages.push(...combineIntoMessages(classes, composed));
      decl.remove();
    });
  });

  const composedExports = composeAliases(localsToScoped, composedMessages);
  const exports = Object.assign({}, icssExports, composedExports);
  const imports = combineImports(icssImports, composedImports);
  css.prepend(createICSSRules(imports, exports));
  result.messages.push(...composedMessages);
});
github css-modules / postcss-icss-values / src / index.js View on Github external
});
      }
    }
    atrule.remove();
  });

  const scopedAliases = getScopedAliases(result.messages, valuesExports);

  replaceSymbols(css, Object.assign({}, valuesExports, scopedAliases));

  Object.keys(icssExports).forEach(key => {
    icssExports[key] = replaceValueSymbols(icssExports[key], scopedAliases);
  });

  css.prepend(
    createICSSRules(icssImports, Object.assign({}, icssExports, valuesExports))
  );

  result.messages.push(...getMessages(valuesExports));
});

icss-utils

ICSS utils for postcss ast

ISC
Latest version published 4 years ago

Package Health Score

71 / 100
Full package analysis