Skip to content

How to use jss insertion point with gatsby? #10468

@hackhat

Description

@hackhat

I'm trying to follow this tutorial https://github.com/cssinjs/jss/blob/master/docs/setup.md#specify-dom-insertion-point because when I override some material ui properties doesn't work and this tutorial fixes it.

The problem is that I need to do

const insertionElement = document.getElementById('jss-css-insertion-point')
jss.setup({
  // https://github.com/cssinjs/jss/blob/master/docs/setup.md#specify-dom-insertion-point
  insertionPoint: insertionElement || undefined,
})

and obviously fails when gatsby builds.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions