Skip to content

Commit 9700620

Browse files
authored
Merge pull request #87 from dlabaj/issue82
Fixes in ability to apply a dark theme only to the log viewer
2 parents fdcecca + 22385dc commit 9700620

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

packages/module/src/LogViewer/LogViewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ const LogViewerBase: React.FunctionComponent<LogViewerProps> = memo(
312312
hasLineNumbers && styles.modifiers.lineNumbers,
313313
!isTextWrapped && styles.modifiers.nowrap,
314314
initialIndexWidth && styles.modifiers.lineNumberChars,
315-
theme === 'dark' && styles.themeDark
315+
theme === 'dark' && styles.modifiers.dark
316316
)}
317317
{...(initialIndexWidth && {
318318
style: {

packages/module/src/LogViewer/css/log-viewer.css

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,22 @@
4545
--pf-v6-c-log-viewer--c-toolbar__group--m-toggle-group--spacer: 0;
4646
--pf-v6-c-log-viewer--c-toolbar__group--m-toggle-group--m-show--spacer: var(--pf-t--global--spacer--sm);
4747
--pf-v6-c-log-viewer--m-dark__main--BorderWidth: 0;
48+
--pf-v6-c-log-viewer--m-dark__main--BackgroundColor: var(--pf-t--global--background--color--inverse--default);
49+
--pf-v6-c-log-viewer--m-dark__text--Color: var(--pf-t--global--text--color--inverse);
50+
--pf-v6-c-log-viewer--m-dark__index--Color: var(--pf-t--global--text--color--inverse);
4851
display: flex;
4952
flex-direction: column;
5053
height: var(--pf-v6-c-log-viewer--Height);
5154
max-height: var(--pf-v6-c-log-viewer--MaxHeight);
5255
}
53-
.pf-v6-c-log-viewer.pf-v6-theme-dark {
56+
57+
html:not(.pf-v6-theme-dark) .pf-v6-c-log-viewer.pf-m-dark {
5458
--pf-v6-c-log-viewer__main--BorderWidth: var(--pf-v6-c-log-viewer--m-dark__main--BorderWidth);
59+
--pf-v6-c-log-viewer__main--BackgroundColor: var(--pf-v6-c-log-viewer--m-dark__main--BackgroundColor);
60+
--pf-v6-c-log-viewer__text--Color: var(--pf-v6-c-log-viewer--m-dark__text--Color);
61+
--pf-v6-c-log-viewer__index--Color: var( --pf-v6-c-log-viewer--m-dark__index--Color);
5562
}
56-
.pf-v6-c-log-viewer.pf-v6-theme-dark .pf-v6-c-log-viewer__main {
57-
--pf-v6-c-log-viewer__main--BackgroundColor: var(--pf-t--global--background--color--primary--default);
58-
--pf-v6-c-log-viewer__main--BorderColor: var(--pf-t--global--border--color--default);
59-
--pf-v6-c-log-viewer__text--Color: var(--pf-t--global--text--color--regular);
60-
--pf-v6-c-log-viewer__index--Color: var(--pf-t--global--text--color--subtle);
61-
--pf-v6-c-log-viewer--m-line-numbers__list--before--BackgroundColor: var(--pf-t--global--border--color--default);
62-
}
63+
6364
.pf-v6-c-log-viewer.pf-m-wrap-text {
6465
word-break: break-all;
6566
}

packages/module/src/LogViewer/css/log-viewer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default {
1111
"logViewerText": "pf-v6-c-log-viewer__text",
1212
"logViewerTimestamp": "pf-v6-c-log-viewer__timestamp",
1313
"modifiers": {
14+
"dark": "pf-m-dark",
1415
"wrapText": "pf-m-wrap-text",
1516
"nowrap": "pf-m-nowrap",
1617
"lineNumbers": "pf-m-line-numbers",

0 commit comments

Comments
 (0)