File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed
polaris-react/src/components/List Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 1515}
1616
1717.Item {
18- margin-bottom : var (--p-space-2 );
19-
2018 & :last-child {
2119 margin-bottom : 0 ;
2220 }
2523 margin-top : var (--p-space-2 );
2624 }
2725}
26+
27+ .spacingLoose {
28+ .Item {
29+ margin-bottom : var (--p-space-2 );
30+ }
31+ }
Original file line number Diff line number Diff line change @@ -25,3 +25,13 @@ export function Numbered() {
2525 </ List >
2626 ) ;
2727}
28+
29+ export function ExtraTight ( ) {
30+ return (
31+ < List spacing = "extraTight" >
32+ < List . Item > First item</ List . Item >
33+ < List . Item > Second item</ List . Item >
34+ < List . Item > Third Item</ List . Item >
35+ </ List >
36+ ) ;
37+ }
Original file line number Diff line number Diff line change @@ -7,7 +7,14 @@ import styles from './List.scss';
77
88type Type = 'bullet' | 'number' ;
99
10+ type Spacing = 'extraTight' | 'loose' ;
11+
1012export interface ListProps {
13+ /**
14+ * Determines the space between list items
15+ * @default 'loose'
16+ */
17+ spacing ?: Spacing ;
1118 /**
1219 * Type of list to display
1320 * @default 'bullet'
@@ -19,9 +26,10 @@ export interface ListProps {
1926
2027export const List : React . FunctionComponent < ListProps > & {
2128 Item : typeof Item ;
22- } = function List ( { children, type = 'bullet' } : ListProps ) {
29+ } = function List ( { children, spacing = 'loose' , type = 'bullet' } : ListProps ) {
2330 const className = classNames (
2431 styles . List ,
32+ spacing && styles [ variationName ( 'spacing' , spacing ) ] ,
2533 type && styles [ variationName ( 'type' , type ) ] ,
2634 ) ;
2735
You can’t perform that action at this time.
0 commit comments