Skip to content

Conversation

@metonym
Copy link
Collaborator

@metonym metonym commented Nov 23, 2025

Closes #939

Export the themes constant from the Theme component to provide programmatic access to all available Carbon theme keys and their human-readable labels.

Changes

The themes constant is now exported as a module-level constant from Theme.svelte, making it available for import alongside the Theme component. This constant was previously only available internally within the Theme component.

import { themes } from "carbon-components-svelte/src/Theme/Theme.svelte";

// Access all theme keys
const themeKeys = Object.keys(themes);

// Build custom UI with correct labels
Object.entries(themes).forEach(([key, label]) => {
  // Use key and label to build theme options
});

@metonym metonym force-pushed the export-themes-const branch 2 times, most recently from 831bc44 to 2610d2b Compare November 23, 2025 21:38
@metonym metonym marked this pull request as ready for review November 23, 2025 21:39
@metonym metonym force-pushed the export-themes-const branch 3 times, most recently from b0945a4 to 897ab2f Compare November 29, 2025 00:46
@metonym metonym force-pushed the export-themes-const branch from 897ab2f to bb3a2a3 Compare November 29, 2025 00:52
@metonym metonym merged commit 3c2265f into master Nov 29, 2025
7 checks passed
@metonym metonym deleted the export-themes-const branch November 29, 2025 01:05
@metonym
Copy link
Collaborator Author

metonym commented Nov 29, 2025

Released in v0.94.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow exportable themes to add custom themes

1 participant