Analogue Design System

Using nested variables to create a white-labelled design system with a default, minimal Light & Dark theme.

UI Designer

Design Systems, Components, Tokens

(1a) Mobile example screen of light mode design system
(1b) Selection of light mode components
(1c) Dark mode components

This case study demonstrates the solution I built at Pollinate for a fully white labelled interface, I recreated this system on a new application that I created for the purpose of this case study so I can share it publicly.

Restyling our application to match a clients’ branding and UI cost on average 5 sprints for an experienced developer to implement, this does not take into account ongoing style changes, rebranding, multiple theme per client support and new features requiring overrides.

The solution for this is a nested variable system used by companies such as Material and Adobe usually referred to as design tokens This is not to be confused with a single layer of variable such as defining an accent colour.

The problem

Style changes are costly, whether the application needs to support multiple clients’ requirements - or as simple as a designer breaking away from standard usage on a new feature (it happens!) - developers and designers want to focus on problem-solving, not on consistent colour usage and css overrides.

I created a note taking application that takes has two default theme for light mode and dark mode. This can be rebranded on two levels - a basic re-skin where the main colours are changed, down to component level changes - all within the css file. There are two key differences between this and a standard design system. The use of a component variables and alias variables.

(2a) Default dark theme application
(2a) Default dark theme application

(2b) Default light theme application

Most design systems do use variables. However they usually only allows for simple switching of themes across the basic properties - as you can see above - most of the styles are just an inversion or simple switch of colours. These css variables are usually written as --global-colour-accent as an example. Their role is for capturing values for consistency.

The clock however, has style overrides to the default to demonstrate howusing variables with a middle layer is far more customisable.

(3a) A clock component styled with one layer of css variables
(3b) Switching themes only allows for a simple inversion
(3b) Switching themes only allows for a simple inversion

(3c) The requirement is for the light theme to have additional style details, red clock hands and accent coloured hour lines.

//clock-card.modules.css

//why is this customisation not possible, let’s take a look at the code.

.clock-hands { 
     background-color: var(--global_color_primary-content) 
}

.minute-lines { 
     color: var(--global_color_primary-content) 
}

.hour-lines { 
     color: var(--global_color_primary-content) 
}

.card-text { 
     color: var(--global_color_primary-content) 
}

//light-theme.modules.css

: root { --global_color_primary-content: --token_color_dark-grey }

//by changing the global style for primary-content to red for our customisation - you’ll affect every css property pointing to that variable. The only way to do this with this current setup would be to override the style in clock-card.modules.css, and we can’t do that because it will break the theme setup.
(4a) A clock component styled with one layer of css variables
(4b) A clock component styled with one layer of css variables

Now we have a fully customisable, white labelled design system for our front-end. All the styles are nested within each other in the css theme files and every component can be branded to the clients’ requirements. You can also read my article about how to sync these changes with Figma, where these style variables can be pushed to your code repository directly by a designer.

(5a) The same application, one system of nested variables, all styles maintained in the theme.css files
(1a) Desktop example of dark mode
(1a) Desktop example of dark mode

(1b) Desktop example of dark mode

(2a) Desktop example of light mode
(2a) Desktop example of light mode

(2b) Desktop example screen of light mode

Colours

A common problem I’ve encountered is assigning unique colours directly to every state on an interaction, this is where alias variables come in.

Alias variables behave like coordinators, they orchestrate the usage of colours by mixing them with another colour, this means you can programmatically generate a range of tones and shades - designers and developers will only have to apply this calculation once, and it will handle every interaction state across the application.

(1a) Mobile example screen of light mode design system
//light-theme.modules.css

//We can programmatically generate our shades using color-mix, here is an example for our button hover colour
 
:root { 
--alias_color_accent-85: color-mix(in rgb, var(--global_color_accent) 85% , var(--global_color_accent-mix) 15%);

--alias_color_accent-hover: var(--alias_color_accent-85);

--component_color_button-filled-hover: var(--alias_color_accent-hover);
}
(6a) The full spectrum colour palette and chosen shades for the default light theme
(6b) By changing just the global colours - all the shades needed changing with the application

Typography

One of my favourite discoveries when creating a design system the first time, was implementation of typography components that take props such as size, line-height and style.

//light-theme.modules.css
    type
    Props = {
        size: ‘s’ | ‘m’ | ‘l’;
        lineHeight: ‘s’ | ‘m’ | ‘l’;         
    }
    ;

    const Paragraph = ({
                           size = ‘m’,
    lineHeight =’l’,
    children,
    }:
    PropsWithChildren < Props >
    ) =>
    {
    ...

        <Paragraph size=’
        s’ lineHeight =’l’>
        Fusion
        Neue </Typography>

//I also want to mention the beauty of shorthand font styling 
            .paragraph - small
        {
            font: 16
            px
            120 %
            var (
            --global_typography_paragraph - font - family
        )
        }
(7a) Analogue Design System uses a Minor Third Typescale
(7a) Analogue Design System uses a Minor Third Typescale

(7b) Usage of typography as a component

Elevation, Border radius and Iconography

To complete this design system I’ve used Radix icons. There are four elevation styles and four default border-radius styles.

There are a few libraries I turn to for iconography- including Lucide iconography. The border radius is based on usage like buttons and inputs - finally elevation can be changed per theme as it’s captured in one line of code as a box-shadow.

(8a) Default elevation system
(8b) Border radii
(8c) Radix Iconography set

Finally below is a showcase of all the themes created with this Design System. The library created for Pollinate was far more extensive and intricate, including multiple themes per bank and the use of the Tokens Figma plugin, which enabled me to rebrand any prototype with the click of one button. It’s time consuming to set up at the start - but is worth it in the long run.

A headless design system saved Pollinate 2 weeks of initial theme setup for every bank, 5 sprints to implement a theme down to a few days, it enabled the sales team to show our real application to a potential client in their own branding before any services are confirmed. It saved a designer a week each time a prototype needed to be rebranded.

(9) Analogue in light & dark