Upgrading

Upgrading from Fabric v0 to v1

Fabric CSS version 1 contains a BREAKING CHANGE which removes support for Troika utility classes. We don't do this lightly as our general goal is to avoid breaking changes as much as possible but it seems wise to clear this out sooner rather than later.

Will this affect me?

This will affect anyone using Troika utility classes in Fabric only apps. These classes are always prefixed with u- so they are easy to recognise

How can I make the upgrade?

1. Handle u- prefixed Troika utility classes

Go through your markup and replace u- prefixed classes with valid Fabric equivalents. This should be a quick job even on a large app. You can find example replacements here: https://github.schibsted.io/finn/fabric#noteable-changes

Compatibility mode

If you don't have time to make this change right away, you will always have the option of including the Troika utilities package manually to keep supporting u- classes until you can find time.

Install the utils package npm install -D @finn-no/troika-css-utilities

In your app's styles.css file, import Troika utils: @import 'import '@finn-no/troika-css-utilities/dist/utilities.css';

Alternatively, if you don't have a postcss build pipeline in place though, you can always import directly from the Eik server

2. Install the Fabric CSS v1 dependency

npm install -D @fabric-ds/css@1

3. Update import map to v1

Update your app's eik.json file to point at the correct import map. Without this step you will not end up with Fabric v1 in production. "import-map": [..., "https://assets.finn.no/map/fabric/v2", ...] n.b. Yes, the "v2" in the example above is correct. The v2 import map points at Fabric v1.