Anchor Design System

Theme provider3.0

The theme provider component is a non-visual component, designed to help you set the correct theme for your Anchor components.

Installation

npm i @tryg/ui-library

Usage

Provide the Theme Provider with the brand and branch you want to use. The component will load the correct styles for the brand and branch you provide.

Individual only imports the desired component, and only needs to be included once within the application. Which is beneficial to keep the application size small.

Webcomponent
  <script type="module">
    import { defineCustomElement } from '@tryg/ui-library/dist/components/anchor-theme-provider';
    defineCustomElement();
  </script>
  <anchor-theme-provider branch="dk" brand="trygdk">Your content here</anchor-theme-provider>

Global only needs to be defined once in the application, but it will import all components even the ones that are not in use..

Webcomponent
  <script type="module">
    import { defineCustomElements } from '@tryg/ui-library/dist/loader';
    defineCustomElements();
  </script>
  <anchor-theme-provider branch="dk" brand="trygdk">Your content here</anchor-theme-provider>

You are responsible for pairing the correct brand and branch. If you provide an incorrect brand or branch, the component will not load the correct styles.

To use the base theme for each branch, provide the branch name and set the brand to "base".

Fonts

The Theme Provider will only load the CSS for basic values for the brand and branch you provide. You will have to make sure that your page has the correct fonts loaded.

API

anchor-theme-provider

Properties

PropertyAttributeDescriptionTypeDefault
branchbranchstringundefined
brandbrandstringundefined

Built with StencilJS

On this page