🚀 Feature: Change which theme is set to default
🔖 Feature description
Possibility to change which theme is being used as default for new users.
🎤 Context
If you have both light and dark themes enabled in your Backstage app today, the default will be set to whatever your OS settings are. However we have a need to change the default, e.g. setting it to dark theme by default for all new users.
✌️ Possible Implementation
Maybe we can add a new optional param when you create a new theme extension, and if thats set - the "Auto" detection of OS settings will be overridden.
E.g.
export const DarkTheme = ThemeBlueprint.make({
name: 'dark',
params: {
theme: {
id: 'dark',
title: 'Dark Theme',
variant: 'dark',
default: true, 🆕
icon: <DarkIcon />,
Provider: ({ children }) => (
<UnifiedThemeProvider theme={builtinThemes.dark} children={children} />
),
},
},
});
👀 Have you spent some time to check if this feature request has been raised before?
- [X] I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Code of Conduct
Are you willing to submit PR?
None
The default theme are the first one listed for each of the light and dark variants. The behavior to default the light/dark choice to OS settings is build into the app theme provider, which you can replace via the components option to createApp. There's no equivalent of this in the new system yet so that still needs to be implemented, most likely as a new extension in the app plugin. I think while at it we could also add a configuration option for the extension to control the behavior too.
Apart from the I do think a default option on the themes themselves could potentially be useful, but I feel it conflicts pretty heavily with configuring the theme provider. I'd prefer to go down that road first since we want to keep that configuration point, and then see if that's enough or not.
Hey! Can I have this issue?
For sure @vedant0102, I've assigned it to you 👍
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Found in triaging - @vedant0102 are you still working on this?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.