npm.io
9.11.1 • Published 1 year ago

@instructure/instructure-theme

Licence
MIT
Version
9.11.1
Deps
4
Size
126 kB
Vulns
0
Weekly
0
Stars
478

category: packages

instructure-theme

npm MIT License Code of Conduct

A UI component theme for Instructure made by Instructure Inc.

This theme has a 3:1 minimum contrast requirement.

Installation
npm install @instructure/instructure-theme
Usage

Before mounting (rendering) your React application:

  • global theming:

    import { theme } from '@instructure/instructure-theme'
    
    theme.use()
  • application level theming:

    import { theme } from '@instructure/instructure-theme'
    
    ReactDOM.render(
      <InstUISettingsProvider theme={theme}>
        <App />
      </InstUISettingsProvider>,
      element
    )

To override the variables:

  • globally:

    import { theme } from '@instructure/instructure-theme'
    
    theme.use({ overrides: { colors: { brand: 'red' } } })
  • application level:

    import { theme } from '@instructure/instructure-theme'
    const themeOverrides = { colors: { brand: 'red' } }
    
    ReactDOM.render(
      <InstUISettingsProvider theme={{ ...theme, ...themeOverrides }}>
        <App />
      </InstUISettingsProvider>,
      element
    )