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

Image collapsed while sizing="cover" with --iron-image-height set, why? #102

Open
vedtam opened this issue Jun 2, 2017 · 1 comment
Open

Comments

@vedtam
Copy link

vedtam commented Jun 2, 2017

Iron image gets collapsed while the mixin --iron-image-height is set (say 300px) inside paper-card. The image displays correctly only if I set the height inline, but than why the mixin exists (or do I miss something)?

stock paper-card code:

  .header iron-image {
        display: block;
        width: 100%;
        --iron-image-width: 100%;
        --iron-image-height: 300px;
        pointer-events: none;

        @apply --paper-card-header-image;
      }
...

  <div class="header">
      <iron-image
          hidden$="[[!image]]"
          aria-hidden$="[[_isHidden(image)]]"
          src="[[image]]"
          alt="[[alt]]"
          placeholder="[[placeholderImage]]"
          preload="[[preloadImage]]"
          fade="[[fadeImage]]"
          sizing="cover">
        </iron-image>
      <div hidden$="[[!heading]]" class$="title-text [[_computeHeadingClass(image)]]">[[heading]]</div>
    </div>

works only if I set the height inline:

 <div class="header">
      <iron-image
          hidden$="[[!image]]"
          aria-hidden$="[[_isHidden(image)]]"
          src="[[image]]"
          alt="[[alt]]"
          placeholder="[[placeholderImage]]"
          preload="[[preloadImage]]"
          fade="[[fadeImage]]"
          sizing="cover"
          style="height:300px;">
        </iron-image>
      <div hidden$="[[!heading]]" class$="title-text [[_computeHeadingClass(image)]]">[[heading]]</div>
    </div>

As normal behaviour I expect the image to fill the iron-image element with height and width set explicitly and sizing="cover"

Thanks!

@Wei-LiangChew
Copy link

Wei-LiangChew commented Mar 28, 2018

+1
I have the same issue with sizing="contain"

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

No branches or pull requests

2 participants