@instructure/canvas-theme
TypeScript icon, indicating that this package has built-in type declarations

10.16.1 • Public • Published

category: packages

canvas-theme

npm MIT License Code of Conduct

A UI component theme for Canvas LMS made by Instructure Inc.

This theme has a 3:1 minimum contrast requirement.

Installation

npm install @instructure/canvas-theme

Usage

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: { spacing: { xxxSmall: '0.3rem' } } })
  • application level:

    import { theme } from '@instructure/canvas-theme'
    const themeOverrides = { spacing: { xxxSmall: '0.3rem' } }
    
    ReactDOM.render(
      <InstUISettingsProvider theme={{ ...theme, ...themeOverrides }}>
        <App />
      </InstUISettingsProvider>,
      element
    )

Readme

Keywords

none

Package Sidebar

Install

npm i @instructure/canvas-theme

Weekly Downloads

13,676

Version

10.16.1

License

MIT

Unpacked Size

134 kB

Total Files

14

Last publish

Collaborators

  • jakeoeding
  • instuici
  • eschiebel
  • maths22
  • jcrystal
  • itadmins
  • instructure-toolsmiths-service-user
  • aogata-inst
  • kyler-instructure
  • ericsaupe
  • xcudder
  • jdewar
  • jguardadom
  • jcflow
  • jozsefg-instructure
  • jacksonhowe
  • sarahgerard
  • ajmal-esa
  • robinkuss64
  • david.wenzlick.inst
  • razorsh4rk
  • ardena
  • bpjatacsuk
  • angela.gomba
  • joyenjoyer
  • cguanzon-inst
  • herrtopi
  • matyas.szabo
  • cjs118
  • camray
  • dmz985
  • aaronshaf
  • szilard.doro-inst
  • martongreczi-inst
  • instout
  • svcquizzesnpm
  • balazs.buri.instructure
  • mstarkman
  • daniel-torok
  • fmarcso
  • peipeizhou