Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

md-card should have an md-card-image directive #2266

Closed
programming-kid opened this issue Apr 11, 2015 · 13 comments
Closed

md-card should have an md-card-image directive #2266

programming-kid opened this issue Apr 11, 2015 · 13 comments
Assignees
Milestone

Comments

@programming-kid
Copy link

According to Google design spec a cad has following components
An image, a title text inside image, card content and card-footer
i md-card should have following structure
example

<md-card>
    <md-card-image src="img.png">
        <md-card-title>
            this is card title
        </md-card-title>
    </md-card-image>
    <md-card-content>
        this is card content
    </md-card-content>
    </md-card-footer>
        cta-button | cta-button
    </md-card-footer>
</md-card>

this would make life of a mobile app designer very easy

thanks

@vacarsu
Copy link

vacarsu commented Apr 11, 2015

This is a good idea, I actually designed my own card header for images for this purpose,
screen shot 2015-04-11 at 12 36 51 pm

@epelc
Copy link
Contributor

epelc commented Apr 13, 2015

@programming-kid You just put your image above md-card-content

Example

<md-card>
    <img src="somepic.png" />
    <md-card-content>
        ...
    </md-card-content>
</md-card>

@vacarsu
Copy link

vacarsu commented Apr 14, 2015

I think he is asking for something that is more declarative and styled by default to material specifications for momentum.

@programming-kid
Copy link
Author

@epelc yes i know we can do that , but as @vacarsu am looking for a more standard way to build cards. 👍

@epelc
Copy link
Contributor

epelc commented Apr 14, 2015

I think it'd be good if there was an md-card-header much like md-card-footer. It'd be declarative and you wouldn't need to remember that cards don't have a header element. Then you could just put the img inside of the header and either have a special class to style it this way or more likely just default it to this.

@WhiteAbeLincoln
Copy link

I agree that there should be a md-card-header. That would help it match the specification a little more, allowing for an Avatar, Title and Subtitle area as shown in the example, and making the card a little more versatile out of the box
mdcard
Right now, you have to provide your own custom styling to achieve this, and that just gets messy.

Ideally, there would be an element for every one of these content blocks (Title Area [md-card-header], Media area [md-card-image or md-card-media], Supporting text [md-card-content], Actions [md-card-footer, should be md-card-actions]), and we could configure their view order by the order we define them in the html (or using layout-align). Allowing for a layout like this
image but still using the same components.

To further follow the specification, there could be an option (md-aspect-ratio) on the Media element to make the Media section 1:1 vs 16:9 to match the different layouts in the specification.
image

Here are all of the content blocks, that can be used in different orders to make a variety of card layouts
image
image

@ThomasBurleson
Copy link
Contributor

Love these idea. Let's make something happen in 0.10.

@ThomasBurleson ThomasBurleson self-assigned this Apr 20, 2015
@ThomasBurleson ThomasBurleson added this to the 0.10.0 milestone Apr 20, 2015
@programming-kid
Copy link
Author

👍 @WhiteAbeLincoln excellent points

@ThomasBurleson ThomasBurleson modified the milestones: 0.10.0, 0.11.0 Jun 16, 2015
@ghost
Copy link

ghost commented Jun 25, 2015

I would also like to see md-card-header which can have a ng-click and supports md-secondary.
Inbox style, collapsed card showing header that's clickable.

@ThomasBurleson ThomasBurleson modified the milestones: 0.11.0, REVISIT Jul 31, 2015
@ThomasBurleson ThomasBurleson modified the milestones: REVISIT, Backlog Aug 10, 2015
@viztastic
Copy link

Would be great to have an md-card-image support SVGs and not just standard tags.... would be great to have SVGs spanning the full width of the md-card-image container/tag.

@programming-kid
Copy link
Author

excellent point @viztastic

@topherfangio topherfangio modified the milestones: 0.12, 0.13 Oct 15, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc2, 1.0-rc3 Oct 30, 2015
@topherfangio topherfangio modified the milestones: 1.0-rc6, 1.0-rc3 Nov 3, 2015
@topherfangio topherfangio modified the milestones: 1.0-rc7, 1.0-rc6 Nov 23, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc7, 1.0-rc8, 1.0-rc6 Nov 25, 2015
@jelbourn
Copy link
Member

@EladBezalel what's the relation of this issue to your recent card changes?

@EladBezalel
Copy link
Member

@jelbourn most of it is implemented

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

No branches or pull requests

9 participants