primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Skeleton not displaying.

Open apunekar opened this issue 5 years ago • 6 comments

<div class="p-grid p-formgrid">
  <div class="p-field p-col-12 p-md-6 p-pr-md-6 p-pr-0">
      <h5>Card</h5>
      <div class="custom-skeleton p-p-4">
          <div class="p-d-flex p-mb-3">
              <p-skeleton shape="circle" size="4rem" styleClass="p-mr-2"></p-skeleton>
              <div>
                  <p-skeleton width="10rem" styleClass="p-mb-2"></p-skeleton>
                  <p-skeleton width="5rem" styleClass="p-mb-2"></p-skeleton>
                  <p-skeleton height=".5rem"></p-skeleton>
              </div>
          </div>
          <p-skeleton width="100%" height="150px"></p-skeleton>
          <div class="p-d-flex p-jc-between p-mt-3">
              <p-skeleton width="4rem" height="2rem"></p-skeleton>
              <p-skeleton width="4rem" height="2rem"></p-skeleton>
          </div>
      </div>
  </div>
</div>

I have copied the above code in my html as it from your primgfaces.org site. the skeleton is not displayed. Niether I get any errors.

apunekar avatar Sep 08 '21 15:09 apunekar

  1. add skeleton in your code
  2. add skeletonModule => import { SkeletonModule } from 'primeng/skeleton';
  3. add css (with encapsulation: ViewEncapsulation.None or global css into angular.json) =>
/* SKELETON */

.p-component,
.p-component *,
.p-skeleton,
.skeleton * {
    box-sizing: border-box;
}

.p-skeleton {
    background-color: #e9ecef;
    border-radius: 3px;
}
.p-skeleton:after {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
}

gregorypiva avatar Sep 10 '21 22:09 gregorypiva

/* SKELETON */

.p-component, .p-component *, .p-skeleton, .skeleton * { box-sizing: border-box; }

.p-skeleton { background-color: #e9ecef; border-radius: 3px; } .p-skeleton:after { background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)); }

I tried this and it is working, but I want to know why this it's required and can't find any mention of it in PrimeNG docs.

rernesto avatar Oct 12 '21 14:10 rernesto

Seems to fixed in v12 and v13.

yigitfindikli avatar Dec 08 '21 14:12 yigitfindikli

As of 2024, it doesn't work again. I've had to copy paste the CSS from above. I'm using PrimeReact.

bora-7 avatar Aug 14 '24 10:08 bora-7

As of 2024, it doesn't work again. I've had to copy paste the CSS from above. I'm using PrimeReact.

Hi ! Have you manage to fix it? I having the same issue

Ufransa avatar Jan 20 '25 15:01 Ufransa

As of 2024, it doesn't work again. I've had to copy paste the CSS from above. I'm using PrimeReact.

Hi ! Have you manage to fix it? I having the same issue

I did what @gregorypiva suggested above and that fixed it!

bora-7 avatar Jan 29 '25 09:01 bora-7