0.5.1 • Published 10 months ago

@redhat-developer/red-hat-developer-hub-theme v0.5.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

RHDH / Red Hat Developer Hub Theme 🎨

A set of theming options for MUI Material UI and Backstage that look more similar to PatternFly.

It also includes a Storybook and a Storybook test-runner for automatic visual regression tests.

API

Returns all testable themes (incl. the backstage default color scheme and older RHDH versions):

  • getAllThemes: () => AppTheme[]
  • useAllThemes: () => AppTheme[]

Returns the latest, not released RHDH light and dark theme for your backstage/RHDH instance:

  • getThemes: () => AppTheme[]
  • useThemes: () => AppTheme[]
  • useLoaderTheme: () => MUIv5.Theme

Install dependencies

npm install @redhat-developer/red-hat-developer-hub-theme

or

yarn add @redhat-developer/red-hat-developer-hub-theme

Use it with RHDH app

Starting with 1.2 this library is shipped with your RHDH installation.

On older RHDH instances you can install it:

  1. Install the dependency with

    yarn workspace app add @redhat-developer/red-hat-developer-hub-theme
  2. In packages/app/src/components/DynamicRoot/DynamicRoot.tsx

    import { useThemes } from '@redhat-developer/red-hat-developer-hub-theme';
    
    // ...
    
      const themes = useThemes();
    
    // ... 
    
          app.current = createApp({
            apis: [...staticApis, ...remoteApis],
            // ... remove defaultThemes from here:
            themes,
            components: defaultAppComponents,
          });

Use it with any Backstage app

  1. Install the dependency with

    yarn workspace app add @redhat-developer/red-hat-developer-hub-theme
  2. Update packages/app/src/App.tsx and apply the themes to createApp:

    import { getThemes } from '@redhat-developer/red-hat-developer-hub-theme';
    
    // ...
    
    const app = createApp({
      apis,
      // ...
      themes: getThemes(),

Use it while developing a plugin

  1. Install the dependency with

    yarn workspace <plugin-root or plugin-name> add @redhat-developer/red-hat-developer-hub-theme
  2. Add to your */dev/index.tsx:

    import { getAllThemes } from '@redhat-developer/red-hat-developer-hub-theme';
    
    // ...
    
    createDevApp()
      .registerPlugin(...)
      .addThemes(getAllThemes())
      .addPage({
        // ...
      })
      .render();

Use yarn link

  1. Clone the rhdh theme and run npm link in it:

    cd red-hat-developer-hub-theme
    yarn link
  2. To use this link you can cd any other repository:

    cd ../backstage-plugins
    yarn link @redhat-developer/red-hat-developer-hub-theme

Additional links

0.0.0-main-f035164

10 months ago

0.0.0-pr-55-b23f16f

11 months ago

0.5.0

1 year ago

0.5.1

10 months ago

0.0.0-main-73a39c8

10 months ago

0.1.20

1 year ago

0.1.16

1 year ago

0.1.17

1 year ago

0.1.18

1 year ago

0.1.19

1 year ago

0.4.0

1 year ago

0.0.0-main-

1 year ago

0.1.15

1 year ago

0.3.0

1 year ago

0.0.41

2 years ago

0.1.10

2 years ago

0.0.42

2 years ago

0.1.11

2 years ago

0.0.43

2 years ago

0.1.12

2 years ago

0.0.44

2 years ago

0.1.13

2 years ago

0.0.45

2 years ago

0.1.14

2 years ago

0.0.46

2 years ago

0.0.47

2 years ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.0.62

2 years ago

0.0.63

2 years ago

0.0.60

2 years ago

0.0.61

2 years ago

0.0.59

2 years ago

0.0.51

2 years ago

0.0.52

2 years ago

0.0.53

2 years ago

0.0.54

2 years ago

0.0.55

2 years ago

0.0.56

2 years ago

0.0.57

2 years ago

0.0.58

2 years ago

0.0.50

2 years ago

0.2.0

2 years ago

0.0.48

2 years ago

0.0.0-pr-35

2 years ago

0.0.49

2 years ago

0.0.40

2 years ago

0.0.38

2 years ago

0.0.39

2 years ago

0.0.37

2 years ago

0.0.35

2 years ago

0.0.36

2 years ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.30

2 years ago

0.0.31

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.28

2 years ago

0.0.29

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago