Re-usability is extremely powerful. Make your libraries even more re-usable by allowing them to be themed from apps.

Git repo

Instead of having users sift through lots of documentation to find your css variables and set them themselves, we’re going to use a service.

Step 1:

Get a list over what styles you want your end users to have control over, in our case we want our users to set their own:

  • Background color
  • Text color

Now replace the styling of these properties in your library component with css variables, like’a so:

.custom-box {
background-color: var(--css-component-background-color);
color: var(--css-component-text-color);
}

Step 2:

Now create a…

Thomas Nicolai Martinussen

Angular developer / Digital marketer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store