Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-plugin-theme-ui

Package Overview
Dependencies
Maintainers
1
Versions
465
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-theme-ui

Gatsby plugin for adding theme-ui context

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5K
increased by1.38%
Maintainers
1
Weekly downloads
 
Created
Source

gatsby-plugin-theme-ui

Gatsby plugin for adding theme-ui context

npm i theme-ui gatsby-plugin-theme-ui @emotion/core @mdx-js/react
// gatsby-config.js
module.exports = {
  plugins: ['gatsby-plugin-theme-ui'],
}

Customizing the theme

To customize the theme used in your Gatsby site, shadow files in a src/gatsby-plugin-theme-ui/ directory. The src/gatsby-plugin-theme-ui/index.js module is the main export for themes.

// example src/gatsby-plugin-theme-ui/index.js
export default {
  colors: {
    text: '#111',
    background: '#fff',
  },
}

Extending a theme

To extend an existing theme, import the module and merge, assign or override properties in your shadowing src/gatsby-plugin-theme-ui/index.js file.

// example with extending
import baseTheme from 'gatsby-plugin-theme-ui'

export default {
  ...baseTheme,
  // extending the colors only
  colors: {
    ...baseTheme.colors,
    text: '#111',
    background: '#fff',
  },
}

Color Modes

To enable support for multiple color modes, add an initialColorMode field to your theme.js object.

// src/theme.js
export default {
  initialColorMode: 'light',
  colors: {
    text: '#000',
    background: '#fff',
    modes: {
      dark: {
        text: '#fff',
        background: '#000',
      },
    },
  },
}

MIT License

FAQs

Package last updated on 30 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc