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 select menu and filters #627

Open
MattTheCuber opened this issue Nov 8, 2024 · 7 comments
Open

Theming select menu and filters #627

MattTheCuber opened this issue Nov 8, 2024 · 7 comments
Assignees
Labels
feature New feature or request

Comments

@MattTheCuber
Copy link

This issue is for https://github.com/revolist/revogrid-column-select and this repo.

Currently, in dark theme, select menus and filtering look quite poor. You can see this by going to the official demo: https://rv-grid.com/demo/

image

Is there a easy way to style these depending on the theme? Currently we are using Vuetify and using the theme variables like this:

revogr-filter-panel {
    background-color: rgb(var(--v-theme-surface-light)) !important;
}
revogr-filter-panel > label {
    color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
}
.select-css {
    background-color: rgb(var(--v-theme-surface));
    background-image: none;
    color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
    border-color: rgba(var(--v-border-color), var(--v-border-opacity));
}
.select-css:focus {
    color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
}
revogr-filter-panel input[type='text'] {
    background-color: rgb(var(--v-theme-surface)) !important;
}
#revo-button-reset {
    color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
}
.and-or-button {
    color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity)) !important;
}

However, we are unable to themed styles the dropdown because it is stuck in the root body and not instead of any Vuetify containers.

@ConnorNoddin
Copy link

Bump. I have also encountered this issue in the past

@m2a2x
Copy link
Collaborator

m2a2x commented Nov 11, 2024

hi @MattTheCuber
there are some options for you:

  1. For dropdown you can add to column level appendTo: 'class name'
  2. filter panel is inside of the dom, can be colorized the way you described

By the way you can use vitepress components inside of the grid too, we've built a lot of applications this way.

@m2a2x m2a2x added the feature New feature or request label Nov 11, 2024
@m2a2x m2a2x self-assigned this Nov 11, 2024
m2a2x added a commit that referenced this issue Nov 11, 2024
#627 - support dark colors on filter panel
@MattTheCuber
Copy link
Author

Hello @m2a2x,

Thank you for the help. I tried adding the appendTo keyword to the column properties with a root div's class (appendTo: 'v-application'). This put the div nested inside of the cell instead of the root div, resulting in fixing the styling but positioning the dropdown in an undesired location.

Also, can you describe how the filter panel was updated to allow theming?

@m2a2x
Copy link
Collaborator

m2a2x commented Nov 12, 2024

Hi @MattTheCuber

  1. I think only in the latest version of dropdown is should work, also it should be a selector: '.v-application'
  2. Panel is inside of the grid I suppose hence you can reach it same as grid. Also in the latest release this would be with black theme support.

@MattTheCuber
Copy link
Author

That worked, thank you!

FYI, here is the CSS I used if anyone else wants to theme these components:

.select-css {
    background-color: rgb(var(--v-theme-surface));
    background-image: none;
    color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
    border-color: rgba(var(--v-border-color), var(--v-border-opacity));
}
.select-css:focus {
    color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity));
}
revogr-filter-panel input[type='text'] {
    color: rgba(var(--v-theme-on-background), var(--v-high-emphasis-opacity)) !important;
    background-color: rgb(var(--v-theme-surface-light)) !important;
}

.revo-dropdown-list .dropdown-inner {
    color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity)) !important;
    background-color: rgb(var(--v-theme-surface)) !important;
}

@m2a2x
Copy link
Collaborator

m2a2x commented Nov 12, 2024

@MattTheCuber In the future there is a plan to provide revogrid with full theme support, just allow some vars and set them through js, but it's a long term plan

@MattTheCuber
Copy link
Author

Great!

I didn't care too much about specific theming colors, I just wanted the drop downs and filter menu to match the RevoGrid theme (dark/light).

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

No branches or pull requests

3 participants