rfellows commented on code in PR #11262:
URL: https://github.com/apache/nifi/pull/11262#discussion_r3320209019


##########
nifi-frontend/src/main/frontend/libs/shared/src/assets/themes/components/_status-variant.scss:
##########
@@ -0,0 +1,116 @@
+/*!
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+@use '@angular/material' as mat;
+
+@mixin generate-material-theme() {
+    :root {
+        // NOTE: The following styles are for the status badge and status 
banner components. The `.status-variant` class should only be applied to a div 
or span element that should adhear to the variant color and background.
+        .status-variant {
+            &.neutral {
+                color: var(--mat-sys-on-surface);
+                background-color: var(--mat-sys-surface-dim);
+            }
+            &.critical {
+                color: var(--mat-sys-on-error);
+                background-color: var(--mat-sys-error);
+            }
+            &.caution {
+                color: var(--nf-caution-contrast);
+                background-color: var(--nf-caution-default);
+            }
+            &.success {
+                color: var(--nf-success-contrast);
+                background-color: var(--nf-success-default);
+            }
+            &.info {
+                color: var(--nf-success-contrast);
+                background-color: var(--nf-success-variant);
+            }
+
+            .fa {
+                &.neutral {
+                    color: var(--mat-sys-on-surface);
+                }
+
+                &.critical {
+                    color: var(--mat-sys-on-error);
+                }
+
+                &.caution {
+                    color: var(--nf-caution-contrast);
+                }
+
+                &.success {
+                    color: var(--nf-success-contrast);
+                }
+
+                &.info {
+                    color: var(--nf-success-contrast);
+                }
+            }
+        }
+    }
+
+    .darkMode {

Review Comment:
   The `.darkMode { ... }` block on lines 69–115 is byte-for-byte identical to 
the `:root { ... }` block on lines 21–67 — every value uses `--mat-sys-*` or 
`--nf-*` custom properties, all of which are already rebound under `.darkMode` 
at the `material.scss` level. Duplicating the rules under a `.darkMode` 
selector emits the same CSS twice and doesn't change any computed values.
   
   NiFi's mode-aware values are reassigned at the variable level inside 
`material.scss`, so any rule that uses one of those custom properties is 
automatically mode-aware.
   
   The same redundancy exists in:
   - `_drag-and-drop.scss` (lines 84–106)
   - `_option.scss` (lines 28–32)
   - `_paginator.scss` (lines 27–31)
   - `_progress-bar.scss` (lines 47–71)
   - `_searchable-overlay.scss` (lines 93–107)
   - `_skeleton.scss` (lines 27–31)
   - `_tree.scss` (lines 28–32)
   - `_typography.scss` (lines 134–140)
   
   Suggest dropping the `.darkMode { ... }` block from each of these partials. 
Files where the dark-mode block is genuinely needed (different raw palette 
indices per mode) and should stay: `_button.scss`, `_checkbox.scss`, 
`_progress-spinner.scss`, `_snackbar.scss`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to