New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fela-font-renderer

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela-font-renderer

Fela enhancer to render fonts into a separate stylesheet

  • 5.0.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19
decreased by-13.64%
Maintainers
1
Weekly downloads
 
Created
Source

fela-font-renderer

Deprecated: With fela 5.0.0 this enhancer is no longer required as fela-dom now renders fonts into its own stylesheet.

npm version npm downloads

Allocates all renderFont calls to a separate renderer which renders into a separate mountNode to prevent refetching the @font-face every time.

Installation

yarn add fela-font-renderer

You may alternatively use npm i --save fela-font-renderer.

Usage

Configuration

Options
OptionValueDefaultDescription
mountNode(HTMLElement)DOM node to render @font-face markup into
Example
Client

Using the enhancer for client-side rendering can be achieved by simply passing another mountNode to the enhancer.

import { createRenderer, render } from 'fela'
import fontRenderer from 'fela-font-renderer'

const mountNode = document.getElementById('font-stylesheet')
const fontEnhancer = fontRenderer(mountNode)

const renderer = createRenderer({
  enhancers: [ fontEnhancer ]
})
Server

To get the static CSS markup for both renderers can be achieved using the renderer.fontRenderer to generate the @font-face markup.

import { createRenderer } from 'fela'
import fontRenderer from 'fela-font-renderer'

const renderer = createRenderer({
  enhancers: [ fontRenderer() ]
})

const CSS = renderer.renderToString()
const fontCSS = renderer.fontRenderer.renderToString()

License

Fela is licensed under the MIT License.
Documentation is licensed under Creative Common License.
Created with ♥ by @rofrischmann and all the great contributors.

Keywords

FAQs

Package last updated on 09 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc