Skip to content

Instantly share code, notes, and snippets.

@guanghechen
Last active April 27, 2022 06:45
Show Gist options
  • Save guanghechen/9a1035c99691d72ab0995987ebf6c0f4 to your computer and use it in GitHub Desktop.
Save guanghechen/9a1035c99691d72ab0995987ebf6c0f4 to your computer and use it in GitHub Desktop.
jss
  • Get all styles.

    [...document.querySelectorAll('[data-emotion]')]
      .flatMap(({ sheet }) => [...sheet.cssRules].map(rules => rules.cssText))
      .join('\n')

    See emotion-js/emotion#1248 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment