kolkov / ngx-gallery

A simple responsive native gallery component for Angular 8+.
https://ngx-gallery.kolkov.ru/
MIT License
115 stars 55 forks source link

box-sizing in ngx-gallery.component.scss #14

Open hijamoya opened 4 years ago

hijamoya commented 4 years ago

In the original library:

    /deep/ {

        * {
            box-sizing: border-box;
        }
  ...

In this library:

* {
  box-sizing: border-box;
}

This make global box-sizing change after open the gallery which causes some css issues.

kolkov commented 4 years ago

Yes, at the new version of Angular /deep/ is not working. ( but I tried this at Next versions, may be it working in release, I don't know.

hijamoya commented 4 years ago

I can confirm that ::ng-deep is still working.

totize commented 4 years ago

Indeed, ::ng-deep is still working.

Could you maybe update your code? That would fix many webpages' style issues I bet :)

PedroJesusRomeroOrtega commented 4 years ago

While updating to angular 9, in the official update guide says this:

In the meantime, I've fixed by adding

ngx-gallery ::ng-deep .ngx-gallery-thumbnails .ngx-gallery-thumbnail {
  border: none !important;
}

in the component.scss file. I think it isn't the best approach because I don't like !important, but I haven't found another solution.

kolkov commented 4 years ago

@PedroJesusRomeroOrtega thanks, are there any other ways in Angular repo issues? I know only this discussion: https://github.com/angular/angular/issues/25160

PedroJesusRomeroOrtega commented 4 years ago

Sorry, I don't know other ways

german-e-mas commented 3 years ago

Nice catch. Thanks @hijamoya , I was wondering why my styles suddenly broke when updating to this library.

As for the styles, I've been using @PedroJesusRomeroOrtega 's solution. ::ng-deep works (i haven't find a better solution that doesn't use !important though). It would be nice to have a better way to control the border style of thumbnails.

corecodingltd commented 3 years ago

This is still an issue for me, it really messes up the CSS of the rest of the site. Can you not structure your CSS better and not use global declarations?