Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Component Request] Grid lists #1095

Closed
nisrulz opened this issue Jul 17, 2015 · 5 comments
Closed

[Component Request] Grid lists #1095

nisrulz opened this issue Jul 17, 2015 · 5 comments

Comments

@nisrulz
Copy link

nisrulz commented Jul 17, 2015

A grid list consists of a repeated pattern of cells arrayed vertically and horizontally within the grid list.
https://www.google.com/design/spec/components/grid-lists.html
A grid list is best suited to presenting homogenous data, typically images, and is optimized for visual comprehension and differentiating between similar data types.

image

@nickretallack
Copy link

I'd love to have both styles of labels on these grid items -- the style where the labels overlap the grid item's content, and the style where they are displayed below.

@Garbee
Copy link
Collaborator

Garbee commented Jul 18, 2015

Completely possible, it is just cards. In fact this is probably doable with the current grid system and some slight tweaks to cards via a modifier. Just need to dig into the spec and cross-reference things for initial triage.

@cliffordp
Copy link
Contributor

Suggestion

This might be (close to) what you're wanting:

Just add the mdl-cell and mdl-cell--3-col (or another of your choosing) classes to your cards and wrap in a <div class="mdl-grid mdl-grid--no-spacing">

And add this extra styling (or add custom class and target that):
.mdl-cell { display: flex; }
.mdl-card { width: auto; flex: 1; }

Example 1

Full code example (with inline styling so you don't need the above 2 styling customizations):

<div class="mdl-grid mdl-grid--no-spacing">
    <div class="mdl-cell mdl-cell--3-col" style="display: flex;">
        <div class="mdl-card mdl-shadow--2dp" style="width: auto; flex: 1;">
            <div class="mdl-card__title">
                <h2>1st Card Title</h2>
            </div>
            <div class="mdl-card__actions mdl-card--border">
                <button class="mdl-button mdl-js-button mdl-js-ripple-effect">Button Text Here</button>
            </div>
        </div>
    </div>
    <div class="mdl-cell mdl-cell--3-col" style="display: flex;">
        <div class="mdl-card mdl-shadow--2dp" style="width: auto; flex: 1;">
            <div class="mdl-card__title">
                <h2>2nd Card Title</h2>
            </div>
            <div class="mdl-card__actions mdl-card--border">
                <button class="mdl-button mdl-js-button mdl-js-ripple-effect">Button Text Here</button>
            </div>
        </div>
    </div>
    <div class="mdl-cell mdl-cell--3-col" style="display: flex;">
        <div class="mdl-card mdl-shadow--2dp" style="width: auto; flex: 1;">
            <div class="mdl-card__title">
                <h2>3rd Card Title</h2>
            </div>
            <div class="mdl-card__actions mdl-card--border">
                <button class="mdl-button mdl-js-button mdl-js-ripple-effect">Button Text Here</button>
            </div>
        </div>
    </div>
    <div class="mdl-cell mdl-cell--3-col" style="display: flex;">
        <div class="mdl-card mdl-shadow--2dp" style="width: auto; flex: 1;">
            <div class="mdl-card__title">
                <h2>4th Card Title</h2>
            </div>
            <div class="mdl-card__actions mdl-card--border">
                <button class="mdl-button mdl-js-button mdl-js-ripple-effect">Button Text Here</button>
            </div>
        </div>
    </div>
</div>

Full demo example of code above (grid of 3-3-3-3): http://codepen.io/cliffordp/pen/WvgmMP?editors=110

Screenshot:

screenshot 2015-07-23 00 17 47

Example 2

Demo of grid 3-3-3-3 and grid 3-3-3-3: http://codepen.io/cliffordp/pen/aORoMe?editors=110

Example 3

Demo of grid 6-6 and grid 3-9: http://codepen.io/cliffordp/pen/GJXexx?editors=110

Screenshot:

screenshot 2015-07-23 00 16 55

Closing

I hope this helps you accomplish what you're wanting and/or have the MDL team make it simpler to implement.

@jargnar
Copy link

jargnar commented Oct 23, 2015

+1

@traviskaufman
Copy link
Contributor

We will be implementing this in v2: see #4498

We are still in the very early stages of v2 and are currently working towards an alpha. Our master branch is where all v2 work is happening if you are interested in keeping up with its progress. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants