0.4.0 • Published 10 months ago

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

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-pr-51-d1fef4d

10 months ago

0.0.0-pr-50-d63e007

10 months ago

0.0.0-pr-49-58146c0

10 months ago

0.0.0-pr-39-d9d34b9

11 months ago

0.0.0-pr-46-5ba12bb

11 months ago

0.0.0-pr-44-e73698f

11 months ago

0.0.0-pr-48-9c006e5

10 months ago

0.0.0-main-f346fae

11 months ago

0.1.20

11 months ago

0.0.0-main-3eea3ac

11 months ago

0.0.0-pr-47-ac96565

10 months ago

0.0.0-pr-44-f647b9c

11 months ago

0.1.16

11 months ago

0.1.17

11 months ago

0.1.18

11 months ago

0.1.19

11 months ago

0.4.0

10 months ago

0.0.0-main-22cbfab

11 months ago

0.0.0-main-68a1c8e

11 months ago

0.0.0-main-1cd29db

11 months ago

0.0.0-pr-44-5f586a7

11 months ago

0.0.0-pr-46-8370bce

11 months ago

0.0.0-pr-39-4d5e605

11 months ago

0.0.0-pr-45-2afdd26

11 months ago

0.0.0-main-10cdcbe

10 months ago

0.0.0-main-

11 months ago

0.0.0-pr-45-e73698f

11 months ago

0.0.0-pr-43-e73698f

11 months ago

0.0.0-pr-42-e73698f

11 months ago

0.0.0-pr-40-e73698f

11 months ago

0.0.0-pr-41-e73698f

11 months ago

0.0.0-pr-38-e73698f

11 months ago

0.0.0-pr-39-e73698f

11 months ago

0.1.15

11 months ago

0.3.0

11 months ago

0.0.0-pr-37-0f168d6

11 months ago

0.0.0-pr-36-0f168d6

12 months ago

0.0.41

1 year ago

0.1.10

1 year ago

0.0.42

1 year ago

0.1.11

1 year ago

0.0.43

1 year ago

0.1.12

1 year ago

0.0.44

1 year ago

0.1.13

1 year ago

0.0.45

1 year ago

0.1.14

1 year ago

0.0.46

1 year ago

0.0.47

1 year ago

0.1.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.0.62

1 year ago

0.0.63

1 year ago

0.0.60

1 year ago

0.0.61

1 year ago

0.0.59

1 year ago

0.0.51

1 year ago

0.0.52

1 year ago

0.0.53

1 year ago

0.0.54

1 year ago

0.0.55

1 year ago

0.0.56

1 year ago

0.0.57

1 year ago

0.0.58

1 year ago

0.0.50

1 year ago

0.2.0

1 year ago

0.0.48

1 year ago

0.0.0-pr-35

1 year ago

0.0.49

1 year ago

0.0.40

1 year ago

0.0.38

1 year ago

0.0.39

1 year ago

0.0.37

1 year ago

0.0.35

1 year ago

0.0.36

1 year ago

0.0.34

1 year ago

0.0.33

1 year ago

0.0.32

1 year ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago