How to use fela-plugin-validator - 3 common examples

To help you get started, we’ve selected a few fela-plugin-validator 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 robinweser / fela / examples / example-with-styleguidist / src / common / createFelaRenderer.js View on Github external
const createRenderer = () => {
  const plugins = [
    unit('px'),
    placeholderPrefixer(),
    friendlyPsuedo(),
    ...webPreset,
    embedded(),
    namedMediaQuery(mediaQueries),
  ]
  const enhancers = [combineArrays()]

  if (process.env.NODE_ENV === 'development') {
    plugins.push(
      validator({
        logInvalid: true,
        deleteInvalid: true,
      })
    )
    plugins.push(whitelistMediaQuery(mediaQueries))
    /* eslint-disable no-undef */
    if (__CLIENT__ && __STATISTICS__) {
      /* eslint-enable */
      // enabled via define plugin in styleguidist.config.js
      plugins.push(statistics())
    }
    enhancers.push(beautifier())
  }

  return createFelaRenderer({
    plugins,
github cloudflare / cf-ui / packages / cf-style-provider / src / createRenderer.js View on Github external
const createRenderer = opts => {
  const usedOpts = Object.assign({}, defaultOpts, opts);
  const plugins = [
    prefixer(),
    fallbackValue(),
    unit(),
    lvha(),
    embedded(),
    namedMediaQuery(mediaQueries)
  ];
  const enhancers = [];

  if (usedOpts.dev === true) {
    plugins.push(validator());
    plugins.push(whitelistMediaQuery(mediaQueries));
    enhancers.push(beautifier());
  }

  return createFelaRenderer({
    plugins,
    enhancers,
    selectorPrefix: usedOpts.selectorPrefix,
    mediaQueryOrder: [
      removePrefix(mediaQueries.hover),
      removePrefix(mediaQueries.mobile),
      removePrefix(mediaQueries.mobileWide),
      removePrefix(mediaQueries.tablet),
      removePrefix(mediaQueries.tabletLegacy),
      removePrefix(mediaQueries.tabletWide),
      removePrefix(mediaQueries.desktop),
github robinweser / fela / packages / fela-preset-dev / src / index.js View on Github external
export function createDevPreset({
  validator: validatorConfig = [],
}: Config = {}) {
  return [logger(), validator(...validatorConfig)]
}

fela-plugin-validator

Fela plugin to validate style objects

MIT
Latest version published 2 years ago

Package Health Score

72 / 100
Full package analysis

Popular fela-plugin-validator functions