Skip to content

Caching of css background images #3

@madmacc

Description

@madmacc

It would be great if there was a way to cache CSS background images.
I currently have a lot of cards set up with dynamic background images like so:

<div #cardContainer class="permit"
      [ngClass]="{'permit-bkg-image': permitShowVirtualCardBgImage}"
      [ngStyle]="{
        'background': permitShowVirtualCardBgImage ? (tenant.style.permitBgColor ? tenant.style.permitBgColor + ', ' + permitBackgroundImage : permitBackgroundImage) : (tenant.style.permitBgColor ? tenant.style.permitBgColor : 'var(--ion-color-permit-card-bk-gradient)')
      }" 

I guess I could experiment with making the div an img-loader element and using imgAttributes but I was wondering if there was a better way to do this?

Thanks for the work on this it is really useful and works well!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions