Theming
Customize the appearance of Open Ledger components.
Open Ledger components can be styled to match your application’s design system through the theme prop on the OpenLedgerProvider
.
Theme Structure
The theme object allows you to customize colors, typography, spacing, and other visual aspects of the Open Ledger components.
Applying a Theme
Pass your theme object to the OpenLedgerProvider
to apply it to all Open Ledger components:
Theme Properties
Colors
The colors object defines the color palette for your Open Ledger components:
Color Properties
Typography
The typography object controls the text styling throughout the components:
Typography Properties
Spacing
The spacing object defines consistent spacing throughout the UI:
Spacing Properties
Theme Examples
Light Theme
Dark Theme
CSS Custom Properties
Open Ledger components also respect CSS custom properties (CSS variables) that match the theme structure. This allows you to define your theme at the CSS level:
Best Practices
-
Maintain consistency: Try to use the same color palette and typography as the rest of your application for a seamless integration.
-
Test all states: When customizing colors, ensure they work well for all component states (hover, active, disabled, etc.).
-
Accessibility: Make sure your color choices maintain sufficient contrast ratios for readability and accessibility compliance.
-
Responsive considerations: Test your theme across different screen sizes to ensure components look good on all devices.
For more specific component styling, refer to the individual component documentation.