Skip to content

Commit

Permalink
Merge branch 'mantinedev:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuscqueiros authored Sep 21, 2023
2 parents a5c6222 + 41d11ee commit 374bf19
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/pages/guides/redwood.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default Layout(MDX_DATA.Redwood);

## Generate new application

Follow [Redwood getting started guide](https://remix.run/) guide to
Follow [Redwood getting started guide](https://redwoodjs.com/docs/quick-start) guide to
create new Redwood application:

```bash
Expand Down
16 changes: 16 additions & 0 deletions docs/pages/theming/colors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,19 @@ function Demo() {
## Default colors

<ThemeColors />

## Add custom colors types

TypeScript will only autocomplete Mantine's default colors when accessing the theme. To add your custom colors to the MantineColor type, you can use TypeScript module declaration.

```ts
import { DefaultMantineColor, MantineColorsTuple } from '@mantine/core';

type ExtendedCustomColors = 'primaryColorName' | 'secondaryColorName' | DefaultMantineColor;

declare module '@mantine/core' {
export interface MantineThemeColorsOverride {
colors: Record<ExtendedCustomColors, MantineColorsTuple>;
}
}
```
2 changes: 1 addition & 1 deletion src/mantine-core/src/core/MantineProvider/theme.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export type DefaultMantineColor =
| 'teal'
| (string & {});

export type MantineThemeColorsOverride = {};
export interface MantineThemeColorsOverride {}

export type MantineThemeColors = MantineThemeColorsOverride extends {
colors: Record<infer CustomColors, MantineColorsTuple>;
Expand Down

0 comments on commit 374bf19

Please sign in to comment.