backstage icon indicating copy to clipboard operation
backstage copied to clipboard

🚀 Feature: Change which theme is set to default

Open emmaindal opened this issue 1 year ago • 3 comments

🔖 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?

Are you willing to submit PR?

None

emmaindal avatar Sep 03 '24 10:09 emmaindal

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.

Rugvip avatar Sep 09 '24 09:09 Rugvip

Hey! Can I have this issue?

vedant0102 avatar Nov 14 '24 19:11 vedant0102

For sure @vedant0102, I've assigned it to you 👍

awanlin avatar Nov 14 '24 19:11 awanlin

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.

github-actions[bot] avatar Jan 13 '25 19:01 github-actions[bot]

Found in triaging - @vedant0102 are you still working on this?

MihaiTabara avatar Jan 16 '25 11:01 MihaiTabara

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.

github-actions[bot] avatar Mar 17 '25 11:03 github-actions[bot]