How to use the fg-loadcss/src/loadCSS.loadCSS function in fg-loadcss

To help you get started, we’ve selected a few fg-loadcss 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 mui-org / material-ui / docs / src / pages / style / icons / FontAwesome.js View on Github external
componentDidMount() {
    loadCSS(
      'https://use.fontawesome.com/releases/v5.1.0/css/all.css',
      document.querySelector('#font-awesome-css'),
    );
  }
github mui-org / material-ui / docs / src / modules / components / AppSearch.js View on Github external
React.useEffect(() => {
    const styleNode = loadCSS(
      'https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css',
      document.querySelector('#app-search'),
    );

    return () => {
      styleNode.parentElement.removeChild(styleNode);
    };
  }, []);

fg-loadcss

A function for loading CSS asynchronously

MIT
Latest version published 4 years ago

Package Health Score

58 / 100
Full package analysis

Similar packages