UMD Web Utilities Library
    Preparing search index...

    Function jssEntryToCSS

    • Converts a JSS entry object with a className property into a CSS string. Takes a JSS object that includes a className and wraps it in the appropriate CSS selector before converting to a string.

      Parameters

      • styleObj: JssEntry

        A JSS entry object with className and style properties

      Returns string

      A CSS string with the class selector applied

      const jssEntry = {
      className: 'my-component',
      padding: '1rem',
      color: 'red',
      '&:hover': {
      color: 'blue'
      }
      };

      const css = jssEntryToCSS(jssEntry);
      // Returns:
      // .my-component {
      // padding: 1rem;
      // color: red;
      // }
      // .my-component:hover {
      // color: blue;
      // }