Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Angular v18 #198

Closed
lukasmatta opened this issue May 28, 2024 · 3 comments
Closed

Add support for Angular v18 #198

lukasmatta opened this issue May 28, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@lukasmatta
Copy link
Contributor

No description provided.

@lukasmatta lukasmatta added the enhancement New feature or request label May 28, 2024
@ceebows
Copy link

ceebows commented Jun 21, 2024

@udayvunnam

@apappas1129
Copy link

apappas1129 commented Jun 26, 2024

Installed "xng-breadcrumb": "^11.0.0", into a fresh Angular 18 project.
Everything seems working except that the xng-breadcrumb class names can't be selected on CSS even with ::ng-deep and with or increased specificity (i.e. adding class into <xng-breadcrumb>).

Example template:
(app.component.html)

<div class="max-screen-width mx-auto py-f-m">
  <xng-breadcrumb class="my-xng-breadcrumb" [separator]="iconTemplate">
    <ng-container *xngBreadcrumbItem="let breadcrumb; let first = first">
      <ng-container>
        @if (first) {
          <span class="iconify material-symbols--home"></span>
          <span class="sr-only">{{ breadcrumb }}</span>
        } @else {
          {{ breadcrumb }}
        }
      </ng-container>
    </ng-container>
  </xng-breadcrumb>

  <ng-template #iconTemplate>
    <span class="iconify material-symbols--chevron-right" aria-hidden="true"></span>
  </ng-template>
</div>

(app.component.css)

/* BUG: xng-class selectors below do not work with or without ::ng-deep.
See  https://udayvunnam.github.io/xng-breadcrumb/#/custom-styles
For now, overriding styles directly on index.html */
::ng-deep {
  /** Even increased specificity here is not working */
  .my-xng-breadcrumb {
    .xng-breadcrumb-separator:first-child {
      display: none;
    }

    .xng-breadcrumb-separator {
      margin: 0;
      background-color: red;
    }
  }
}

Nothing is selected successfully.

I don't know if there must be something done here to make it work on Angular 18 or I'm missing something in the docs so I'm reporting it here.

Adding encapsulation: ViewEncapsulation.None does not help as well.

For now, I wrote my styles directly into index.html for it to work.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>MyApp</title>
    <base href="/" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="icon" type="image/x-icon" href="favicon.ico" />
    <!-- HACK: ::ng-deep + xng-breadcrumb class selectors doesn't work on Component level css. -->
    <style>
      .xng-breadcrumb-separator:first-child {
        display: none;
      }

      .xng-breadcrumb-separator {
        margin: 0 !important;
      }
    </style>
  </head>
  <body>
    <app-root></app-root>
  </body>
</html>

@apappas1129 apappas1129 mentioned this issue Jul 29, 2024
@lukasmatta
Copy link
Contributor Author

lukasmatta commented Aug 6, 2024

Installed "xng-breadcrumb": "^11.0.0", into a fresh Angular 18 project. Everything seems working except that the xng-breadcrumb class names can't be selected on CSS even with ::ng-deep and with or increased specificity (i.e. adding class into <xng-breadcrumb>).
...

Hi Alexandros, are you sure this is related to the version update? Can you please provide a minimum reproduction repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants