Skip to content

Passing variants to globalCss #915

Answered by bwyx
joepio asked this question in Help
Discussion options

You must be logged in to vote

there's no such variant in globalCss, this function only accepts the global styles

to achieve your goal
use the old way, document.body.classList.toggle('overflow-hidden'), then in globalCss() add that class:

globalCss({
  '.overflow-hidden': {
    overflow: 'hidden'
  }
  
  // or
  'body.overflow-hidden': {
    overflow: 'hidden'
  }
})

therefore you have more flexibility to put the logic in your child components

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by joepio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants