Get started with jss CDN

MIT licensed

JSS is a popular library for implementing stateful server-side rendering in React applications.

Tags:
  • jss
  • style
  • sheet
  • stylesheet
  • css
  • components
  • composable

Stable version

Copied!

How to start using jss CDN


// Import JSS library
const JSS = require('jss');

// Initialize JSS with the CDN link
JSS.init({
  serverUrl: 'https://cdn.cdnhub.io/jss',
  system: 'MyProject',
  site: 'MySite'
});

// Define a sheet with some rules
const sheet = JSS.createStyleSheet();

sheet.rules = {
  'my-class': {
    color: 'red',
    '&:hover': {
      color: 'blue'
    }
  }
};

// Export the sheet
module.exports = {
  [sheet.getName()]: sheet.getContent()
};
Copied!
Copied!
Copied!

All versions