KoliBri - Themes
The Themes module contains numerous themes (style guides) for the component library. They can be loaded in combination with the Components module.
You can read more about modularization in the architecture concept.
More about the project can be found in the documentation.
Installation
You can install the KoliBri themes with npm
, pnpm
or yarn
:
npm i -g @public-ui/themes
pnpm i -g @public-ui/themes
yarn add -g @public-ui/themes
Usage
Register the themes like this:
import { register } from '@public-ui/components';
import { defineCustomElements } from '@public-ui/components/dist/loader';
import { BAMF, BMF, BZStv1, DEFAULT, DESYv1, DESYv2, ECL_EC, ECL_EU, ITZBund, MAPZ, ZOLLv2, ZOLLv3 } from '@public-ui/themes';
register(
DEFAULT,
defineCustomElements,
)
.then(() => {
})
.catch((error) => {
});
Important settings
Usage of pnpm
We use pnpm as package manager and there is a tiny typing issue with the default typescript setup.
What happens?
We got a type annotation error in TypeScript.
The inferred type of 'THEME' cannot be named without a reference to '.pnpm/@a11y-ui+core@***/node_modules/adopted-style-sheets/types/theming'. This is likely not portable. A type annotation is necessary.ts(2742)
What does we know?
This seems to be a general issue:
Solution:
We must activate the specific option preserveSymlinks
in the tsconfig.json
file.
...
"preserveSymlinks": true,
...