Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Expose sizing and position properties on iron-image #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion paper-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
</style>

<div class="header">
<iron-image hidden$="[[!image]]" src="[[image]]" preload$="[[preloadImage]]" fade$="[[fadeImage]]"></iron-image>
<iron-image hidden$="[[!image]]" src="[[image]]" preload$="[[preloadImage]]" fade$="[[fadeImage]]" sizing$="[[sizingImage]]" position$="[[positionImage]]"></iron-image>
<div hidden$="[[!heading]]" class$="[[_computeHeadingClass(image)]]">[[heading]]</div>
</div>

Expand Down Expand Up @@ -175,6 +175,26 @@
value: false
},

/**
* Binds to `iron-image` sizing property. Valid values are contain
* (full aspect ratio of the image is contained within the element and letterboxed)
* or cover (image is cropped in order to fully cover the bounds of the element),
* or null (default: image takes natural size).
*/
sizingImage: {
type: String,
value: null
},

/**
* Binds to `iron-image` position property. When a sizing option is used (cover or contain),
* this determines how the image is aligned within the element bounds.
*/
positionImage: {
type: String,
value: 'center'
},

/**
* The z-depth of the card, from 0-5.
*/
Expand Down