-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Updated log viewer date range selector for Dark Mode. #18372
base: contrib
Are you sure you want to change the base?
Updated log viewer date range selector for Dark Mode. #18372
Conversation
Added theme property to the log viewer date range selector component. This allows for dynamic theme changes in the application. Also, added a new import for UMB_THEME_CONTEXT and used it within the constructor to observe any changes in the theme context. Additionally, updated CSS styles to invert color of calendar picker indicator when dark theme is active.
Hi there @readingdancer, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
Added theme property to the log viewer date range selector component. This allows for dynamic theme changes in the application. Also, added a new import for UMB_THEME_CONTEXT and used it within the constructor to observe any changes in the theme context. Additionally, updated CSS styles to invert color of calendar picker indicator when dark theme is active.
…ode' into fix-date-picker-in-dark-mode
Hi @readingdancer, Thanks for your PR to fix #18371, where you noticed the log viewer date picker icon doesn't change in dark mode. You've clearly been finding a few things in dark mode, which is great! One of the Core Collaborators team will review this as soon as possible - it might not be something they need to check, but because its a slight UI change, I'll just pop this for HQ to double check re design. It defo looks better from here though 👍 Best wishes Emma |
Hi @readingdancer thanks a lot for your effort on this matter. I do find this particular PR not as ideal as I would like, mainly because it does not work with other themes than the core dark theme. Which is determined by hardcoding the theme alias. Not ideal for maintenance. But impressive that you found this solution. I had to investigate a few opportunities myself to see if there was another way to go about this, and it turns out there is. So if you up for it it would be nice if you could try this approach instead? You can set So if we introduce a new CSS Custom Property in our themes, like in Then that could be used in the umb-input-date component, like this: static override styles = [
...UUIInputElement.styles,
css`
input {
color-scheme: var(--uui-color-scheme, normal);
}
`,
]; This component is already used by Scheduled Publishing and the Date Picker Property Editor. And by using that component in the Log-viewer, you have solved three cases. And then in time we should implement that in UI Library as well, making the custom style of umb-input-date component obsolete. I hope that makes sense and thanks in advance |
Prerequisites
Issue: #18371
Description
As described in the Issue I raised above, when viewing the log viewer in Dark mode, the data picker icon does not change to white and so it becomes almost invisible.
I have used the UMRACO_THEME_CONTEXT to get the current mode and if it's dark mode, the CSS uses a filter to invert the icon color. From what I have read ( and tested ) it is not possible to actually set a color, so I think this is the best option.
It was like this:

And now it's like this:
