Skip to content

Commit 216b04b

Browse files
committed
Merge branch 'MintyMods-master'
2 parents 16c414e + 5894c23 commit 216b04b

File tree

5 files changed

+55
-1
lines changed

5 files changed

+55
-1
lines changed

packages/list/List.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
class:mdc-list--dense={dense}
99
class:mdc-list--avatar-list={avatarList}
1010
class:mdc-list--two-line={twoLine}
11+
class:smui-list--three-line={threeLine && !twoLine}
1112
on:MDCList:action={handleAction}
1213
{...props}
1314
><slot></slot></nav>
@@ -21,6 +22,7 @@
2122
class:mdc-list--dense={dense}
2223
class:mdc-list--avatar-list={avatarList}
2324
class:mdc-list--two-line={twoLine}
25+
class:smui-list--three-line={threeLine && !twoLine}
2426
{role}
2527
on:MDCList:action={handleAction}
2628
{...props}
@@ -44,14 +46,15 @@
4446
export let dense = false;
4547
export let avatarList = false;
4648
export let twoLine = false;
49+
export let threeLine = false;
4750
export let vertical = true;
4851
export let wrapFocus = false;
4952
export let singleSelection = false;
5053
export let selectedIndex = null;
5154
export let radiolist = false;
5255
export let checklist = false;
5356
54-
$: props = exclude($$props, ['use', 'class', 'nonInteractive', 'dense', 'avatarList', 'twoLine', 'vertical', 'wrapFocus', 'singleSelection', 'selectedIndex', 'radiolist', 'checklist']);
57+
$: props = exclude($$props, ['use', 'class', 'nonInteractive', 'dense', 'avatarList', 'twoLine', 'threeLine', 'vertical', 'wrapFocus', 'singleSelection', 'selectedIndex', 'radiolist', 'checklist']);
5558
5659
let element;
5760
let list;

packages/list/_mixins.scss

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
Temporary addition until support for three-line added to @material
3+
https://github.com/material-components/material-components-web/issues/31
4+
*/
5+
@import "@material/feature-targeting/functions";
6+
@import "@material/feature-targeting/mixins";
7+
8+
@mixin smui-list-core-styles($query: mdc-feature-all()) {
9+
$feat-structure: mdc-feature-create-target($query, structure);
10+
11+
.smui-list--three-line .mdc-list-item__text {
12+
@include mdc-feature-targets($feat-structure) {
13+
align-self: flex-start;
14+
}
15+
}
16+
17+
.smui-list--three-line .mdc-list-item {
18+
@include mdc-feature-targets($feat-structure) {
19+
height: 88px;
20+
}
21+
}
22+
23+
.smui-list--three-line.mdc-list--dense .mdc-list-item {
24+
@include mdc-feature-targets($feat-structure) {
25+
height: 76px;
26+
}
27+
}
28+
}

packages/list/_style.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
@import "@material/list/mdc-list";
22
@import "@smui/ripple/style";
3+
@import "./mixins";
4+
@include smui-list-core-styles;

packages/list/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
},
2929
"license": "Apache-2.0",
3030
"dependencies": {
31+
"@material/feature-targeting": "^3.1.0",
3132
"@material/list": "^3.1.0",
3233
"@smui/common": "^1.0.0-beta.15",
3334
"@smui/ripple": "^1.0.0-beta.16"

site/src/routes/demo/list.svelte

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,26 @@
7373

7474
<pre class="status">Selected: {selectionTwoLine}, value of selectedIndex: {selectionIndex}</pre>
7575

76+
<div>
77+
A three-line list:
78+
<List class="demo-list" threeLine nonInteractive>
79+
<Item>
80+
<Text>
81+
<PrimaryText>FruitPhone 11</PrimaryText>
82+
<SecondaryText>$1,100</SecondaryText>
83+
<SecondaryText>A beautiful phone with good specs.</SecondaryText>
84+
</Text>
85+
</Item>
86+
<Item>
87+
<Text>
88+
<PrimaryText>Addition Phone</PrimaryText>
89+
<SecondaryText>$700</SecondaryText>
90+
<SecondaryText>Pretty much the same phone, but a different brand name and OS.</SecondaryText>
91+
</Text>
92+
</Item>
93+
</List>
94+
</div>
95+
7696
<div>
7797
A list group:
7898
<Group>

0 commit comments

Comments
 (0)