Skip to content

Commit

Permalink
[docs] Add focus ring styles docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Oct 28, 2022
1 parent a65dc5c commit 5291333
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/src/docs/changelog/5-7-0.mdx
Expand Up @@ -7,6 +7,14 @@ release: https://github.com/mantinedev/mantine/releases/tag/5.7.0
date: 'October 20th, 2022'
---

import { ThemeDemos } from '@mantine/demos';

## Focus ring styles on theme

You can now customize focus ring styles for all components in [MantineProvider](https://mantine.dev/theming/mantine-provider/):

<Demo data={ThemeDemos.focusRingStyles} />

## Responsive Header and Footer height

[Header and Footer](https://mantine.dev/core/app-shell/) components now support responsive height:
Expand Down
15 changes: 15 additions & 0 deletions docs/src/docs/theming/theme-object.mdx
Expand Up @@ -23,6 +23,13 @@ interface MantineTheme {
// never – focus ring is always hidden (not recommended)
focusRing: 'auto' | 'always' | 'never';

// Change focus ring styles
focusRingStyles: {
styles(theme: MantineThemeBase): CSSObject;
resetStyles(theme: MantineThemeBase): CSSObject;
inputStyles(theme: MantineThemeBase): CSSObject;
};

// Determines whether motion based animations should be disabled for
// users who prefer to reduce motion in their OS settings
respectReducedMotion: boolean;
Expand Down Expand Up @@ -180,6 +187,14 @@ learn how to setup dark theme in your application.

<Demo data={ThemeDemos.focusRing} />

### focusRingStyles

`theme.focusRingStyles` allows you to customize focus ring styles that are applied to all `<button />`,
`<a />` and `<input />` elements that are the part of the component. Note that `theme` object that is
passed as an argument to `resetStyles`, `styles` and `inputStyles` functions does not have [theme.fn](/theming/functions/).

<Demo data={ThemeDemos.focusRingStyles} />

### defaultRadius

`theme.defaultRadius` controls default border-radius of all Mantine components ([Button](/core/button/), [TextInput](/core/text-input/), [ThemeIcon](/core/theme-icon/), etc.), default value is `sm`.
Expand Down

0 comments on commit 5291333

Please sign in to comment.