Skip to content

Commit

Permalink
[mantine.dev] Update vanilla extract example (#6561)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziimakc committed Aug 6, 2024
1 parent 3c3b422 commit eeb1ccd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/mantine.dev/src/pages/styles/vanilla-extract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,19 @@ properties are already exposed as CSS variables. Instead, use `themeToVars` func
to create an object with CSS variables from Mantine theme:

```tsx
// theme.css.ts
// theme.ts
import { createTheme } from '@mantine/core';
import { themeToVars } from '@mantine/vanilla-extract';

// Do not forget to pass theme to MantineProvider
export const theme = createTheme({
fontFamily: 'serif',
primaryColor: 'cyan',
});
```

```tsx
// theme.css.ts
import { theme } from './theme';

// CSS variables object, can be access in *.css.ts files
export const vars = themeToVars(theme);
Expand Down

0 comments on commit eeb1ccd

Please sign in to comment.