-
Notifications
You must be signed in to change notification settings - Fork 15
Fixes in ability to apply a dark theme only to the log viewer #87
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfecto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Though I'll mention that I think you can clean this up a little - I tested this quickly in dev tools and it seemed to work OK. You could try making changes to this block
react-log-viewer/packages/module/src/LogViewer/css/log-viewer.css
Lines 57 to 66 in 698523d
.pf-v6-c-log-viewer.pf-m-dark { | |
--pf-v6-c-log-viewer__main--BorderWidth: var(--pf-v6-c-log-viewer--m-dark__main--BorderWidth); | |
} | |
html:not(.pf-v6-theme-dark) .pf-v6-c-log-viewer.pf-m-dark .pf-v6-c-log-viewer__main { | |
--pf-v6-c-log-viewer__main--BackgroundColor: var(--pf-v6-c-log-viewer--m-dark__main--BackgroundColor); | |
--pf-v6-c-log-viewer__main--BorderColor: var(--pf-t--global--border--color--default); | |
--pf-v6-c-log-viewer__text--Color: var(--pf-v6-c-log-viewer--m-dark__text--Color); | |
--pf-v6-c-log-viewer__index--Color: var( --pf-v6-c-log-viewer--m-dark__index--Color); | |
--pf-v6-c-log-viewer--m-line-numbers__list--before--BackgroundColor: var(--pf-t--global--border--color--default); | |
} |
html:not(.pf-v6-theme-dark) .pf-v6-c-log-viewer.pf-m-dark {
--pf-v6-c-log-viewer__main--BorderWidth: var(--pf-v6-c-log-viewer--m-dark__main--BorderWidth);
--pf-v6-c-log-viewer__main--BackgroundColor: var(--pf-v6-c-log-viewer--m-dark__main--BackgroundColor);
--pf-v6-c-log-viewer__text--Color: var(--pf-v6-c-log-viewer--m-dark__text--Color);
--pf-v6-c-log-viewer__index--Color: var( --pf-v6-c-log-viewer--m-dark__index--Color);
}
The changes are:
- Moves
--pf-v6-c-log-viewer__main--BorderWidth: var(--pf-v6-c-log-viewer--m-dark__main--BorderWidth)
into the block withhtml:not(.pf-v6-theme-dark)
so the border is only removed in the dark log viewer in PF's light theme. Currently in this PR the dark log viewer in PF's dark mode is removing this border, which I'm assuming we don't want - Removes
--pf-v6-c-log-viewer__main--BorderColor: var(--pf-t--global--border--color--default)
. That declaration is redeclaring the log viewer var with the same token value as it was originally defined, so it isn't doing anything. - Removes
--pf-v6-c-log-viewer--m-line-numbers__list--before--BackgroundColor: var(--pf-t--global--border--color--default)
for the same reason as the previous bullet. - Removes
.pf-v6-c-log-viewer__main
from the selector for the dark theme overrides. Typically these modifications are best made at the top-level component selector (eg,.pf-v6-c-log-viewer
). It isn't always possible, depending on the override, but it should work fine here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nailed it! 🐸
🎉 This PR is included in version 6.1.0-prerelease.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Updated code to add the ability to always apply a dark theme to the log viewer.
https://issue82-logviewer.surge.sh