How to use the @xstyled/styled-components.useColorMode function in @xstyled/styled-components

To help you get started, we’ve selected a few @xstyled/styled-components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github argos-ci / argos / src / review / containers / AppNavbar.js View on Github external
export function AppNavbar() {
  const user = useUser()
  const [colorMode] = useColorMode()

  return (
    
      
        
          
        
      
      
        {user ? (
          
        ) : (
github gregberge / gregberge.com / src / containers / Projects.js View on Github external
function Projects({ data, projects }) {
  const [colorMode] = useColorMode()
  const regexp = new RegExp(`^projects/logo-(.*)-${colorMode}.png$`)
  const logos = data.allFile.edges.reduce((obj, edge) => {
    const matches = edge.node.relativePath.match(regexp)
    if (!matches) return obj
    obj[matches[1]] = edge.node.childImageSharp.fluid
    return obj
  }, {})
  const projectElements = [
github argos-ci / argos / src / review / containers / AppFooter.js View on Github external
export function AppFooter() {
  const [colorMode] = useColorMode()
  return (
    <footer>
      
        
          <a rel="noopener noreferrer" href="https://www.smooth-code.com">
            
          </a>
        
        
          
            Terms
          </footer>
github gregberge / gregberge.com / src / components / DarkModeSwitcher.js View on Github external
export function DarkModeSwitcher() {
  const [mode, setMode] = useColorMode()
  const [ready, setReady] = React.useState(false)
  React.useEffect(() =&gt; {
    setTimeout(() =&gt; {
      setReady(true)
    }, 10)
  }, [])
  return (
     setMode(mode =&gt; (mode === 'light' ? 'dark' : 'light'))}
    &gt;
      <div>
      <div>
      <div></div></div></div>
github gregberge / gregberge.com / src / pages / workshops.js View on Github external
function Clients({ clientLogos }) {
  const [colorMode] = useColorMode()

  return (
    
      {clients.map(client =&gt; {
        const logo = clientLogos.edges.find(edge =&gt;
          edge.node.relativePath.includes(client.slug),
        )
        return (
          
            
          
        )
github gregberge / svgr / website / src / components / playground / Editor.js View on Github external
export default function Editor(props) {
  const [colorMode] = useColorMode()
  const theme = colorMode === 'dark' ? 'tomorrow_night' : 'github'
  return (
    
  )
}
github gregberge / gregberge.com / src / pages / workshops.fr.js View on Github external
function Clients({ clientLogos }) {
  const [colorMode] = useColorMode()

  return (
    
      {clients.map(client =&gt; {
        const logo = clientLogos.edges.find(edge =&gt;
          edge.node.relativePath.includes(client.slug),
        )
        return (
          
            
          
        )