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

SelectBar background colour formatting #1656

Open
paritoshromy opened this issue Aug 19, 2024 · 1 comment
Open

SelectBar background colour formatting #1656

paritoshromy opened this issue Aug 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@paritoshromy
Copy link

It will be good if we can specify the background colour for selected and unselected bar item. Also the button style.

@yordanov yordanov added the enhancement New feature or request label Aug 21, 2024
@yordanov
Copy link
Collaborator

You can adjust background and text colors via CSS variables. Here is an example:

<RadzenSelectBar @bind-Value=@value TValue="bool" class="my-warning-selectbar">
    <Items>
        <RadzenSelectBarItem Text="On" Value="true" />
        <RadzenSelectBarItem Text="Off" Value="false" />
    </Items>
</RadzenSelectBar>

<style>
    .my-warning-selectbar {
        --rz-selectbar-background-color: var(--rz-warning-lighter);
        --rz-selectbar-color: var(--rz-on-warning-lighter);
        --rz-selectbar-selected-background-color: var(--rz-warning);
        --rz-selectbar-selected-color: var(--rz-on-warning);
    }
</style>

@code {
    bool value;
}

@paritoshromy, does this resolve the issue?

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

2 participants