How to use fela-font-renderer - 3 common examples

To help you get started, we’ve selected a few fela-font-renderer 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 cloudflare / cf-ui / felaRenderer.js View on Github external
export const createRenderer = opts => {
  const enhancers = [beautifier()];
  if (opts && opts.fontNode) {
    enhancers.push(fontRenderer(opts.fontNode));
  } else {
    enhancers.push(fontRenderer());
  }
  if (opts && opts.useMonolithic) {
    enhancers.push(monolithic());
  }
  return createFelaRenderer({
    plugins: [prefixer(), fallbackValue(), unit(), lvha(), validator()],
    enhancers,
    selectorPrefix: ['cf-']
  });
};
github cloudflare / cf-ui / felaRenderer.js View on Github external
export const createRenderer = opts => {
  const enhancers = [beautifier()];
  if (opts && opts.fontNode) {
    enhancers.push(fontRenderer(opts.fontNode));
  } else {
    enhancers.push(fontRenderer());
  }
  if (opts && opts.useMonolithic) {
    enhancers.push(monolithic());
  }
  return createFelaRenderer({
    plugins: [prefixer(), fallbackValue(), unit(), lvha(), validator()],
    enhancers,
    selectorPrefix: ['cf-']
  });
};
github root-systems / dogstack / examples / dogs / renderer.js View on Github external
export default (fontNode) => {
  const renderer = createRenderer({
    plugins: [prefixer(), fallbackValue(), unit(), lvha(), validator()],
    enhancers: [beautifier(), fontRenderer(fontNode)]
  })

  renderer.renderStatic(
    {
      width: '100%',
      height: '100%',
      margin: 0,
      padding: 0,
      fontFamily: 'Lato'
    },
    'html,body,#app'
  )

  renderer.renderStatic({ display: 'flex' }, 'div')
  renderer.renderFont('Lato', [
    'https://fonts.gstatic.com/s/lato/v11/qIIYRU-oROkIk8vfvxw6QvesZW2xOQ-xsNqO47m55DA.woff'

fela-font-renderer

Fela enhancer to render fonts into a separate stylesheet

MIT
Latest version published 6 years ago

Package Health Score

70 / 100
Full package analysis

Popular fela-font-renderer functions