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

Cannot recolor background of selectbutton #17225

Open
1 of 4 tasks
peritus3 opened this issue Dec 27, 2024 · 0 comments
Open
1 of 4 tasks

Cannot recolor background of selectbutton #17225

peritus3 opened this issue Dec 27, 2024 · 0 comments
Assignees
Labels
Component: Theme Issue or pull request is related to Theme Status: Pending Review Issue or pull request is being reviewed by Core Team
Milestone

Comments

@peritus3
Copy link

peritus3 commented Dec 27, 2024

Describe the bug

A SelectButton that is a child of a toolbar does not have the theme tokens necessary to recolor its background. When attempting to recolor via the child ToggleButton's of the SelectButton, their colors are overridden somewhere, but unclear where. The end result is that the default surface color is used instead.
image

(Note that a SelectButton doesn't have the available keys to recolor its background - I tried targetting the ToggleButtons, but that doesn't seem to work)
image

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/github-jfttsfu2?file=src%2Fapp%2Fapp.config.ts

Environment

Angular CLI: 19.0.6
Node: 22.9.0
Package Manager: npm 10.8.3
OS: win32 x64

Angular version

Angular CLI: 19.0.6

PrimeNG version

v19

Node version

Node: 22.9.0

Browser(s)

Firefox 133

Steps to reproduce the behavior

Create a custom preset theme, and specify a background color for the ToggleButton component:

components: {
        togglebutton: {
            background: '{red.50}',
            checkedBackground:'{red.50}'
        }
    }

On build, the background is not the correct color. Although the colors are added to object, they are overridden with the surface colors.

Expected behavior

Background of the component should be the color specified, and there should be a way to directly target the background color of a SelectButton, not just by looking at its ToggleButton children.

Edit: Sorry, menubar being part of the theme is unrelated to this issue - that was a part of the theme from my file I forgot to strip out. The SelectButton is inside a Toolbar, not a Menubar, so there should be no effect there.

@peritus3 peritus3 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 27, 2024
@mertsincan mertsincan added this to the 19.x milestone Dec 27, 2024
@github-project-automation github-project-automation bot moved this to Review in PrimeNG Dec 27, 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 27, 2024
@mertsincan mertsincan modified the milestones: 19.x, 19.1.0 Jan 15, 2025
@mertsincan mertsincan added the Component: Theme Issue or pull request is related to Theme label Jan 15, 2025
@mertsincan mertsincan moved this from Review to Theme in PrimeNG Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Theme Issue or pull request is related to Theme Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
Status: Theme
Development

No branches or pull requests

3 participants