cloudinary_angular icon indicating copy to clipboard operation
cloudinary_angular copied to clipboard

Background image position options instead of center

Open chris480 opened this issue 5 years ago • 2 comments

Explain your use case

There are many cases where 'center center' is not ideal for background positions as defined in the background image directive. https://github.com/cloudinary/cloudinary_angular/blob/master/projects/angular-cld/src/lib/cloudinary-background-image.directive.ts

Describe the problem you’re trying to solve

A way to provide an override without some css !important hack to control image position.

Do you have a proposed solution?

Input param for background position, defaults to center

@Input('clbackgroundposition') background_position = 'center center'; 
...
this.renderer.setStyle(nativeElement, 'background-position', `${background_position}`);

chris480 avatar Dec 08 '20 20:12 chris480

Hi @chris480, I have submitted a request internally to our product team to see if this can be added. We will update you with any new information on this.

michalkcloudinay avatar Dec 09 '20 13:12 michalkcloudinay

Hi @chris480, I just want to update you that we released a new SDK version, which includes an option to pass a position parameter to the background image directive. The default will be center.

michalkcloudinay avatar Oct 14 '21 13:10 michalkcloudinay