Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[@mantine/core] List: Fix styles params not being inherited by List.I…
…tem (#2495)
- Loading branch information
Showing
6 changed files
with
54 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { MantineProvider } from '@mantine/styles'; | ||
import React from 'react'; | ||
import { List } from './List'; | ||
import { ListStylesParams } from './List.styles'; | ||
|
||
export default { title: 'List' }; | ||
|
||
export function WithinProvider() { | ||
return ( | ||
<div style={{ padding: 40 }}> | ||
<MantineProvider | ||
theme={{ | ||
components: { | ||
List: { | ||
styles: (theme, params: ListStylesParams) => { | ||
const { listStyleType } = params; | ||
let maxWidth = 'inherit'; | ||
if (listStyleType === 'disc' || listStyleType === 'circle') { | ||
maxWidth = 'calc(100% - 1.5em)'; | ||
} | ||
|
||
return { | ||
itemWrapper: { | ||
display: 'inline-flex', | ||
flexDirection: 'column', | ||
maxWidth, | ||
}, | ||
}; | ||
}, | ||
}, | ||
}, | ||
}} | ||
> | ||
<List size="sm" listStyleType="disc"> | ||
<List.Item>Clone or download repository from GitHub</List.Item> | ||
<List.Item>Install dependencies with yarn</List.Item> | ||
<List.Item>To start development server run npm start command</List.Item> | ||
</List> | ||
</MantineProvider> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters