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

Theming: Scoped tokens not working #17006

Closed
Saubhagya1707 opened this issue Dec 11, 2024 · 1 comment · Fixed by #17018
Closed

Theming: Scoped tokens not working #17006

Saubhagya1707 opened this issue Dec 11, 2024 · 1 comment · Fixed by #17018
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Saubhagya1707
Copy link

Saubhagya1707 commented Dec 11, 2024

Describe the bug

I am facing issues in using Scoped Tokens as described in

https://primeng.org/theming#scopedtokens

Component:

  selector: 'app-sidebar',
  standalone: true,
  imports: [
    DrawerModule,
    Button,
    NgOptimizedImage,
    Ripple,
    RouterLink
  ],
  templateUrl: './sidebar.component.html',
  styleUrl: './sidebar.component.scss'
})
export class SidebarComponent implements OnInit {
  sidebarVisible : boolean = false;
  private sidebarChangeSubscription!: Subscription;

  constructor(private sidebarState: SidebarStateService) {
  }

  onSidebarHide() {
    this.sidebarVisible = false;
    this.sidebarState.setSidebarVisible(false);
  }

  ngOnInit(): void {
    this.sidebarChangeSubscription = this.sidebarState.sidebarVisible$.subscribe(
      visible => {
        this.sidebarVisible = visible;
      }
    )
  }

  drawer = {
    handle: {
      background: '{indigo.50}'
    },
    colorScheme: {
      light: {
        root: {
          background: '{indigo.50}',
        },
        handle: {
          background: '{indigo.50}',
        }
      },
    }
  }
}```


Html:

`<div class="sidebar-container">
  <p-drawer [(visible)]="sidebarVisible" (onHide)="onSidebarHide()" [modal]="false" [dt]="drawer" >
    <ng-template pTemplate="headless" >
      <div class="flex align-items-center justify-content-between px-4 mt-3 flex-shrink-0">
        <div class="inline-flex align-items-center">
          <svg height="40" width="40" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 300 300" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" project-id="359077ae82994cda8621c2c62e5c3e48" export-id="e44616cfe11043f684b5f6b1c4d93021" cached="true"><ellipse rx="54.514671" ry="58.577877" transform="matrix(1.32298 0 0 1.265902 150 150)" paint-order="stroke markers fill" fill="rgba(255,255,255,0)" fill-rule="evenodd" stroke="#3730A3" stroke-width="25"/><ellipse rx="30" ry="30" transform="matrix(.778782 0 0 0.826184 120.626156 125.21448)" fill="#3730A3" stroke-width="0"/></svg>
          <span class="text-500-20px" id="logo-text" >Web Watch</span>
          <!-- <p-button [text]="true" class="ml-8" icon="pi pi-times" (onClick)="sidebarVisible=!sidebarVisible"></p-button> -->
        </div>
      </div>
      <div class="overflow-y-auto">
        <ul class="list-none p-3 m-0">
          <li>
              <a pRipple class="flex align-items-center cursor-pointer p-3 border-round text-700 highlight hover:surface-100 transition-duration-150 transition-colors p-ripple">
                <i class="pi pi-exclamation-triangle mr-4"></i>
                <span class="font-medium">Alerts</span>
              </a>
          </li>
          <li>
              <a routerLink="monitors"
                 pRipple class="flex align-items-center cursor-pointer p-3 border-round text-700 highlight hover:surface-100 transition-duration-150 transition-colors p-ripple">
                <i class="pi pi-bullseye mr-4"></i>
                <span class="font-medium">Monitors</span>
              </a>
          </li>
          <li>
              <a pRipple class="flex align-items-center cursor-pointer p-3 border-round text-700 highlight hover:surface-100 transition-duration-150 transition-colors p-ripple">
                <i class="pi pi-sitemap mr-4"></i>
                <span class="font-medium">Groups</span>
              </a>
          </li>
        </ul>
      </div>
  </ng-template>
  </p-drawer>
</div>`





I am not able to see the background colour changed in drawer

### Environment

dev

### Reproducer

_No response_

### Angular version

18.2.12

### PrimeNG version

18.0.0

### Build / Runtime

Angular CLI App

### Language

TypeScript

### Node version (for AoT issues node --version)

v18.19.1

### Browser(s)

Safari

### Steps to reproduce the behavior

_No response_

### Expected behavior

_No response_
@Saubhagya1707 Saubhagya1707 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 11, 2024
@mertsincan mertsincan added this to the 18.0.1 milestone Dec 11, 2024
@github-project-automation github-project-automation bot moved this to Review in PrimeNG Dec 11, 2024
@mertsincan mertsincan added Status: Pending Review Issue or pull request is being reviewed by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 11, 2024
@mehmetcetin01140 mehmetcetin01140 self-assigned this Dec 11, 2024
@mehmetcetin01140 mehmetcetin01140 added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Dec 11, 2024
mehmetcetin01140 added a commit that referenced this issue Dec 11, 2024
Fixed #17006 | Theming: Scoped tokens not working
@github-project-automation github-project-automation bot moved this from Review to Done in PrimeNG Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants
@mertsincan @mehmetcetin01140 @Saubhagya1707 and others