Aller au contenu principal

Theme Configuration

Description

The Theme Configuration in Liberty Core defines the application's primary color scheme, typography, background styles, and dark mode behavior.

It provides a dynamic way to override and customize themes using the AppProvider.

Theme Structure

Theme Colors

KeyLight Mode ValueDark Mode ValueDescription
primary#1976d2#607d8bPrimary brand color.
secondary#ff9800#ffc107Secondary accent color.
backgroundLight gradientDark gradientDefines the UI background.
color#333333#E1D9D1Default text color.

Theme Fields

Field NameTypeDescription
palette.mode"light" | "dark"Determines the color scheme.
palette.primary.mainstringPrimary color.
palette.secondary.mainstringSecondary color.
background.defaultstringMain background color.
background.loginPagestringBackground gradient for login page.
spacing(factor: number) => stringFunction to set spacing.
shadowsstring[]Shadow presets for components.

Example Usage

import { AppProvider, LYThemeProvider } from "@nomana-it/liberty-core"
import { theme } from "@nomana-it/liberty-core"

export const ThemeExample = () => {
return (
<AppProvider>
<LYThemeProvider customTheme={theme}>
<MyApp />
</LYThemeProvider>
</AppProvider>
);
};

const MyApp = () => {
return (
<div>
<h2>Theming with Liberty Core</h2>
<p>The theme is applied dynamically using the theme provider.</p>
</div>
);
};

🔗 GitHub Repository (Core): Liberty Core
🔗 GitHub Repository (Test Project): Liberty Test
📖 Live Documentation: Liberty Core Docs
💖 Sponsor & Support: Sponsor Liberty Core