Skip to content

Commit

Permalink
Integrate trails color scheme into base theme
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckem committed Feb 27, 2024
1 parent 40cac40 commit 7db84ff
Show file tree
Hide file tree
Showing 19 changed files with 402 additions and 726 deletions.
6 changes: 6 additions & 0 deletions .changeset/update-theme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@open-pioneer/base-theme": minor
---

Merge developments from @open-pioneer/theme.
This package now provides the `"trails"` color scheme, among other things.
34 changes: 4 additions & 30 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 73 additions & 5 deletions src/packages/base-theme/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,78 @@
# @open-pioneer/base-theme

Provides the default open pioneer trails chakra theme.
This package provides a theme that uses the "trails" color scheme.

```js
import { theme as baseTheme } from "@open-pioneer/base-theme";
## Usage

This theme is automatically used as the default theme for all open pioneer trails applications.

### How to override the `trails` color scheme

Import the `extendTheme` helper function:

```jsx
import { extendTheme } from "@open-pioneer/chakra-integration";
```

Define your custom `trails` (or `trails_alt`) colors:

```jsx
const colors = {
trails: {
50: "#f5edfd",
100: "#eedcff",
200: "#d6c2ea",
300: "#bfa8d5",
400: "#a890c1",
500: "#9177ad",
600: "#7b609a",
700: "#654986",
800: "#4f3373",
900: "#391e61"
}
};
```

Use `extendTheme` function to override the `trails` colors:

```jsx
import { theme } from "@open-pioneer/base-theme";
const customTheme = extendTheme({ colors }, theme);
```

Or use Chakra UI color schemes to override the `trails` (or `trails_alt`) colors:

```jsx
const customTheme = extendTheme(
{
colors: {
trails: theme.colors.gray
}
},
theme
);
```

`options: gray | red | orange | yellow | green | teal | blue | cyan | purple | pink`

Then pass in the custom theme in `createCustomElement`:

```jsx
createCustomElement({
...,
theme: customTheme
});
```

> NOTE: This package is still under active development.
> There will be breaking changes.
### How to use button variants

```jsx
<Button variant="secondary">secondary</Button>
```

`options: solid | outline | ghost | link | primary | secondary | cancel`
`default: solid`

## License

Apache-2.0 (see `LICENSE` file)
Loading

0 comments on commit 7db84ff

Please sign in to comment.