Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overridable styles for AnnouncementsPage Component #154

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sravanireddy115
Copy link

The plugin does offer the ability to pass themeId, which allows us to customize the header of the AnnouncementsPage but unfortunately not the cards.

We would like to have some style customizations done in Card. So we made some of the UI components overridable in AnnouncementsPage by defining CSS properties (itemCardHeader, link), providing a name to the makeStyles function, making the styles overridable in the OverridableComponents.tsx file, and exporting the overrides from the plugin. The same pattern is used by the backstage catalog-react plugin to allow users to override component styles.

We can use it like this in the backstage app.

import { BackstageOverrides as AnnouncementsOverrides } from '@k-pheon/backstage-plugin-announcements';
import { BackstageOverrides } from '@backstage/core-components';

const createCustomThemeOverrides = (): BackstageOverrides & AnnouncementsOverrides => {
  return {
    AnnouncementsStylePicker: {
      itemCardHeader: {
        // custom styles
      },
      cardHeader: {
        // custom styles
      },
      link: {
        // custom styles
      },
    },
  };
};

@etiennetremel
Copy link

We are also looking at customizing part of the CSS (for dark theme), @K-Phoen any chance you can look into this PR?

@juliponti
Copy link

What is the status of this PR? I've got the same issue

@kurtaking
Copy link

@sravanireddy115 👋🏼 we'd be happy to consider this contribution on our version here.

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.

4 participants