|
| 1 | +--- |
| 2 | +title: Upgrade Guide for Version 10.0 |
| 3 | +category: Guides |
| 4 | +order: 98 |
| 5 | +--- |
| 6 | + |
| 7 | +# Upgrade Guide for Version 10 |
| 8 | + |
| 9 | +## Introduction |
| 10 | + |
| 11 | +InstUI v10 is a major release with a new theming color system. It has been simplified and rewritten to make our design language easier to understand and more uniform. |
| 12 | + |
| 13 | +With the new system some old designs could be more challenging or very hard to implement. This is intentional, we wanted |
| 14 | +to avoid situations when someone really changes the look and feel of their application. |
| 15 | +In these cases, make sure you talk with your designer and update the UI according to the new designs. |
| 16 | + |
| 17 | +The revised designs should result in better accessibility ([WCAG 2.1](https://www.w3.org/TR/WCAG21/) compliance!), less theming code and more uniform look and feel. |
| 18 | + |
| 19 | +## Step-by-step guide |
| 20 | + |
| 21 | +We recommend upgrading your application for each major version gradually, e.g. if you plan to update from 8.x to 10.x, |
| 22 | +then migrate first to the latest 9.x and then to version 10. |
| 23 | + |
| 24 | +The places where your code can break during the upgrade are related to theme overrides, color props and color utilities. |
| 25 | +Please check the [theming components](theming-components) guide to understand the new color system. |
| 26 | + |
| 27 | +If you override the theme colors, you must use the new colors provided either in the `canvas-high-contrast` or in the `canvas` theme object. |
| 28 | +The previous color system has been removed, the old color names are no longer available. |
| 29 | + |
| 30 | +### `Instructure` theme is removed |
| 31 | + |
| 32 | +Instructure theme (`@instructure/instructure-theme`) is no longer maintained and not compatible with InstUI v10. |
| 33 | +If you were using it, you need to switch to the `canvas` or the `canvas-high-contrast` theme. |
| 34 | + |
| 35 | +### Component level color overrides |
| 36 | + |
| 37 | +If you had component level overrides of colors you need to migrate using the following table: |
| 38 | + |
| 39 | +| Old | New (v10) | |
| 40 | +| ------------------ | ----------------------------- | |
| 41 | +| `colors.brand` | `colors.contrasts.blue4570` | |
| 42 | +| `colors.link` | `colors.contrasts.blue4570` | |
| 43 | +| `colors.electric` | `colors.contrasts.blue4570` | |
| 44 | +| `colors.shamrock` | `colors.contrasts.green4570` | |
| 45 | +| `colors.barney` | `colors.contrasts.blue4570` | |
| 46 | +| `colors.crimson` | `colors.contrasts.red4570` | |
| 47 | +| `colors.fire` | `colors.contrasts.orange4570` | |
| 48 | +| `colors.licorice` | `colors.contrasts.grey125125` | |
| 49 | +| `colors.oxford` | `colors.contrasts.grey100100` | |
| 50 | +| `colors.ash` | `colors.contrasts.grey4570` | |
| 51 | +| `colors.slate` | `colors.contrasts.grey4570` | |
| 52 | +| `colors.tiara` | `colors.contrasts.grey1214` | |
| 53 | +| `colors.porcelain` | `colors.contrasts.grey1111` | |
| 54 | +| `colors.white` | `colors.contrasts.white1010` | |
| 55 | + |
| 56 | +You can use the latest [codemod](ui-codemods) to automate this process. |
| 57 | + |
| 58 | +InstUI v9: |
| 59 | + |
| 60 | +```jsx |
| 61 | +--- |
| 62 | +type: code |
| 63 | +--- |
| 64 | +<Heading level="h3" color="primary" |
| 65 | + themeOverride={{primaryColor: canvas.colors.brand}}> |
| 66 | + I have nice color! |
| 67 | +</Heading> |
| 68 | +``` |
| 69 | + |
| 70 | +InstUI v10: |
| 71 | + |
| 72 | +```jsx |
| 73 | +--- |
| 74 | +type: code |
| 75 | +--- |
| 76 | +<Heading level="h3" margin="small small" color="primary" |
| 77 | + themeOverride={{primaryColor: canvas.colors.contrasts.blue4570}}> |
| 78 | + some nice blue text. |
| 79 | +</Heading> |
| 80 | +``` |
| 81 | + |
| 82 | +Notice, that the new values use `colors.contrasts`. Please do not use `colors.primitives` for anything. |
| 83 | + |
| 84 | +### Theme level color overrides |
| 85 | + |
| 86 | +InstUI v9 theme level properties `text`, `background`, `border` (for example `backgroundLightest` or `textDarkest`) have been removed. |
| 87 | +To upgrade these props you need to find and override component level theme variables for each component that used the replaced property. |
| 88 | +**This is heavily discouraged, upcoming designs should not necessitate theme overrides.** |
| 89 | + |
| 90 | +For example, if you had `backgroundLightest` overridden on the theme level, you need to find every component whose theme |
| 91 | +utilizes `backgroundLightest` and override them individually in each component. Some of these components are `Alert`, `Avatar`, `Billboard`, `View` and many more. |
| 92 | + |
| 93 | +InstUI v9: |
| 94 | + |
| 95 | +```jsx |
| 96 | +--- |
| 97 | +type: code |
| 98 | +--- |
| 99 | + |
| 100 | +<InstUISettingsProvider |
| 101 | + theme={{ |
| 102 | + themeOverrides: { |
| 103 | + canvas: { |
| 104 | + colors: { backgroundLightest: 'orange' } |
| 105 | + } |
| 106 | + } |
| 107 | + }} |
| 108 | +> |
| 109 | +``` |
| 110 | + |
| 111 | +InstUI v10: |
| 112 | + |
| 113 | +```jsx |
| 114 | +--- |
| 115 | +type: code |
| 116 | +--- |
| 117 | + |
| 118 | +<Alert themeOverride={{background: 'orange'}}></Alert> |
| 119 | +<Avatar themeOverride={{background: 'orange'}}></Avatar> |
| 120 | +<Billboard themeOverride={{background: 'orange'}}></Billboard> |
| 121 | +<Tabs themeOverride={{defaultBackground: 'orange', scrollFadeColor:'orange'}}></Tabs> |
| 122 | +//...and all other components that use color.backgroundLightest |
| 123 | +``` |
0 commit comments