Skip to content

Commit

Permalink
Merge pull request #2408 from benchilds/patch-1
Browse files Browse the repository at this point in the history
Update variants.mdx
  • Loading branch information
hasparus committed Mar 29, 2023
2 parents b386e7f + 4ebd953 commit 4fa9fdb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/docs/src/pages/components/variants.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ For example, a secondary button style can be added to `theme.buttons.secondary`
<Button variant="secondary">Secondary</Button>
```

Components that don't have a dedicated variant group can reference a custom group or any existing variant using `group.variant`.

```jsx
// example using a variant for a component without a dedicated variant group
<Box variant="boxes.shout">This Box will standout!</Button>
```

## Example Theme

```js
Expand Down Expand Up @@ -103,5 +110,12 @@ For example, a secondary button style can be added to `theme.buttons.secondary`
boxShadow: '0 0 4px 1px rgba(0, 0, 0, 0.5)',
},
},
boxes: {
// Components without a dedicated variant group can reference a custom group or any existing variant using group.variant
shout: {
fontWeight: 'bold',
textTransform: 'uppercase',
},
},
}
```

0 comments on commit 4fa9fdb

Please sign in to comment.