Package Exports
- @instructure/canvas-theme
- @instructure/canvas-theme/es/index.js
- @instructure/canvas-theme/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@instructure/canvas-theme) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
category: packages
canvas-theme
A UI component theme for Canvas LMS made by Instructure Inc.
This theme has a 3:1 minimum contrast requirement.
Installation
yarn add @instructure/canvas-themeUsage
Before mounting (rendering) your React application:
global theming:
import { theme } from '@instructure/canvas-theme' theme.use()
application level theming:
import { theme } from '@instructure/canvas-theme' ReactDOM.render( <InstUISettingsProvider theme={theme}> <App /> </InstUISettingsProvider>, element )
To override the variables:
globally:
import { theme } from '@instructure/canvas-theme' theme.use({ overrides: { colors: { brand: 'red' } } })
application level:
import { theme } from '@instructure/canvas-theme' const themeOverrides = { colors: { brand: 'red' } } ReactDOM.render( <InstUISettingsProvider theme={{ ...theme, ...themeOverrides }}> <App /> </InstUISettingsProvider>, element )