theme-white-label

The OUDS Theme White Label module provides a customizable theme implementation designed for white-labeling applications. It extends the Wireframe theme with the ability to customize some tokens values like colors or fonts while maintaining a neutral, clean foundation.

Purpose

While the core module provides the mechanisms to access the theme, and theme-contract defines what a theme is, theme-white-label defines a customizable theme for white-label applications.

  • White Label Use: This theme is specifically designed for applications that need to apply custom branding while keeping a clean, neutral base. Unlike the Wireframe theme which uses the Shantell Sans font, White Label uses the default font family by default.

  • Customization: It allows customization of font family through WhiteLabelFontFamily, colors through WhiteLabelColorScheme, border properties through WhiteLabelBorders, and Material 3 colors through WhiteLabelMaterialColorScheme.

  • Implementation: It extends WireframeTheme and allows overriding specific visual aspects without creating an entirely new theme from scratch.

Usage

To use the White Label theme in your application for custom branding, follow these steps:

1. Add the dependency

Ensure the theme-white-label module is included in your module's build.gradle.kts file in addition to the core module:

Kotlin DSL
dependencies {
// ...
implementation("com.orange.ouds.android:ouds-core:2.2.0")
implementation("com.orange.ouds.android:ouds-theme-white-label:2.2.0")
// ...
}

Groovy DSL
dependencies {
// ...
implementation 'com.orange.ouds.android:ouds-core:2.2.0'
implementation 'com.orange.ouds.android:ouds-theme-white-label:2.2.0'
// ...
}

2. Initialize and customize the Theme

In your application, you must provide the WhiteLabelTheme instance to the OudsTheme composable. This effectively "injects" the customized visual style into the OUDS system.

Use OudsTheme as a replacement for the traditional MaterialTheme.

Default Usage (Wireframe appearance with default font family)

OudsTheme(theme = WhiteLabelTheme()) {
// Use OUDS Android or Material components here
}

Customization Example

val brandColorScheme = WhiteLabelColorScheme(
action = WhiteLabelColorScheme.Action(
enabled = OudsLightDarkColor(Color(0xFF1B5E20), Color(0xFF81C784))
),
content = WhiteLabelColorScheme.Content(
brandPrimary = OudsLightDarkColor(Color(0xFF1B5E20), Color(0xFF81C784))
),
surface = WhiteLabelColorScheme.Surface(
brand = WhiteLabelColorScheme.Surface.Brand(
primary = OudsLightDarkColor(Color(0xFF1B5E20), Color(0xFF81C784))
)
)
)

val brandMaterialColors = WhiteLabelMaterialColorScheme(
primary = OudsLightDarkColor(Color(0xFF1B5E20), Color(0xFF81C784)),
onPrimary = OudsLightDarkColor(Color.White, Color.Black)
)

val brandBorders = WhiteLabelBorders(
radius = WhiteLabelBorders.Radius(default = 12.0.dp)
)

val brandFont = WhiteLabelFontFamily { locale ->
FontFamily(
Font(R.font.brand_regular, FontWeight.Normal),
Font(R.font.brand_bold, FontWeight.Bold)
)
}

OudsTheme(
theme = WhiteLabelTheme(
identifier = "MyBrand",
colorScheme = brandColorScheme,
materialColorScheme = brandMaterialColors,
borders = brandBorders,
whiteLabelFontFamily = brandFont
)
) {
// Your fully branded app
}

Relationship with other modules

ModuleRoleAnalogy
global-raw-tokensThe Ingredients"Flour", "Water", "Salt"
theme-contractThe Recipe Template"A Cake Recipe"
theme-wireframeThe Base Recipe"Basic Bread Recipe"
theme-white-labelThe Customizable Recipe"Basic Bread with Optional Toppings"
coreThe Baker"Making the customized bread available to eat"

Tokens versions

This module extends the Wireframe theme and implements the design specifications versioned below:

Android system1.2.0
Wireframe brand2.7.0
Wireframe core1.5.0

🤖 Note: The majority of the files in this module (specifically within the tokens packages) are automatically generated by Tokenator based on the design definitions.

Any manual changes to these files will be lost during the next synchronization.

Packages

Link copied to clipboard

This package contains the user-facing customization classes: