Material-components-web: Investigate adding Three-Line List support to List Component

Created on 5 Dec 2016  路  8Comments  路  Source: material-components/material-components-web

Most helpful comment

Any news about support for three-line lists?

All 8 comments

Is this open for anyone to implement?

@rohanthacker definitely!

The three-line list will most likely by SCSS additions, but either way it may be useful to show us a prototype via Codepen of what you're thinking so that way we can smooth any rough edges over before you go about implementing the feature. You can use this template to prototype if you want.

Let us know if you want to tackle it and we'll assign you. If you're looking for more info on how we build components, check out our our Authoring Components guide. And thanks for your interest 馃槃

Hey @traviskaufman Yes I would like to Implement this for MCD. I helped put together, the MDL version of Material Lists.

I'll post back on this thread with a demo of 3 Line version when, I have something ready for you to see.

I was also wondering, about collapsable lists as I wasnt able to submit this to MDL, but I'd be happy to do so for MDC.
Happy to Help! 馃憤

Awesome! Looking forward to seeing your work 馃槃

Re collapsible lists, it's not on our radar right now, and probably involves implementing #46 first. Once that's done though, it's something we may consider, and even if not, you could definitely build it into your UI by adding custom styles to our lists.

Any news about support for three-line lists?

Hi! Any update about the support for three-line lists?

I was able to get a three-line list component:

  @import "@material/list/mdc-list";
  @import "@material/feature-targeting/functions";
  @import "@material/feature-targeting/mixins";

  $query: mdc-feature-all();
  $feat-structure: mdc-feature-create-target($query, structure);

  .mdc-list--three-line .mdc-list-item__text {
    @include mdc-feature-targets($feat-structure) {
      align-self: flex-start;
    }
  }

  .mdc-list--three-line .mdc-list-item {
    @include mdc-feature-targets($feat-structure) {
      height: 92px;
    }
  }

  .mdc-list--three-line.mdc-list--dense .mdc-list-item,
  .mdc-list--avatar-list.mdc-list--dense .mdc-list-item {
    @include mdc-feature-targets($feat-structure) {
      height: 80px;
    }
  }
<ul class="mdc-list demo-list mdc-list--three-line mdc-list--avatar-list">  
  <li class="mdc-list-item" tabindex="0">
    <span class="mdc-list-item__graphic" style="size:2em;">W</span>
    <span class="mdc-list-item__text">
      <span class="mdc-list-item__primary-text">List item title</span>
      <span class="mdc-list-item__secondary-text">Secondary text</span>
      <span class="mdc-list-item__secondary-text">Secondary text</span>
    </span>
    <span class="mdc-list-item__meta">info</span>
  </li>
</ul>

DISCLAIMER: This is the first thing I did that achieved the desired effect. I didn't dig any further, read the material.io tome, or teach myself a new style sheet language. Since, I don't know Sass or SCSS, this is likely not an ideal implementation. :sweat_smile:

Is there any update on getting this three line support added? I have a requirement within my project to use three line lists and the @SMUI components I am using depend on your components. While a workaround can be added directly to @SMUI it would be cleaner if @material shipped the required styles (shown above).

The previous suggested fix looks straight forward enough although I do think it contains a bug with the .mdc-list-item height:-

  .mdc-list--three-line .mdc-list-item {
    @include mdc-feature-targets($feat-structure) {
      height: 92px;
    }
  }

From reading the List Component Spec :-

image

I think the height should be specified as 88px not 92px correct me if I am wrong? @artburkart

Any update on this issue is appreciated. Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patrickrodee picture patrickrodee  路  3Comments

traviskaufman picture traviskaufman  路  4Comments

broros picture broros  路  3Comments

jimyhdolores picture jimyhdolores  路  3Comments

robzenn92 picture robzenn92  路  4Comments