rfellows commented on code in PR #8855: URL: https://github.com/apache/nifi/pull/8855#discussion_r1608579895
########## nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/assets/styles/_codemirror-theme.scss: ########## @@ -0,0 +1,227 @@ +/*! + * 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 'sass:map'; +@use '@angular/material' as mat; + +@mixin generate-nifi-theme($material-theme, $nifi-theme) { + // Get the color config from the theme. + $material-theme-color-config: mat.get-color-config($material-theme); + $nifi-theme-color-config: mat.get-color-config($nifi-theme); + + // Get the color palette from the color-config. + $material-theme-primary-palette: map.get($material-theme-color-config, 'primary'); + $nifi-theme-surface-palette: map.get($nifi-theme-color-config, 'primary'); + $material-theme-accent-palette: map.get($material-theme-color-config, 'accent'); + + // Get hues from palette + $is-dark: map-get($nifi-theme-color-config, is-dark); + + $material-theme-primary-palette-lighter: mat.get-color-from-palette($material-theme-primary-palette, lighter); + $material-theme-primary-palette-darker: mat.get-color-from-palette($material-theme-primary-palette, darker); + $material-theme-primary-palette-default: mat.get-color-from-palette($material-theme-primary-palette, default); + + $nifi-theme-surface-palette-default: mat.get-color-from-palette($nifi-theme-surface-palette, default); + $nifi-theme-surface-palette-lighter: mat.get-color-from-palette($nifi-theme-surface-palette, lighter); + $nifi-theme-surface-palette-darker: mat.get-color-from-palette($nifi-theme-surface-palette, darker); + $nifi-theme-surface-palette-darker-contrast: mat.get-color-from-palette( + $nifi-theme-surface-palette, + darker-contrast + ); + $nifi-theme-surface-palette-lighter-contrast: mat.get-color-from-palette( + $nifi-theme-surface-palette, + lighter-contrast + ); + + .cm-s-nifi.CodeMirror { + @extend .surface-contrast; + background-color: if($is-dark, $nifi-theme-surface-palette-darker, $nifi-theme-surface-palette-lighter); + border: 1px solid var(--mdc-outlined-text-field-label-text-color); + } + + .cm-s-nifi .CodeMirror-gutters { + background: if($is-dark, #3b3b3b, #efefef); + } + + .cm-s-nifi .CodeMirror-guttermarker, + .cm-s-nifi .CodeMirror-guttermarker-subtle, + .cm-s-nifi .CodeMirror-linenumber { + color: if($is-dark, #bbbbbb, #b4b4b4); + } + + .cm-s-nifi .CodeMirror-cursor { + border-left: 1px solid + if($is-dark, $nifi-theme-surface-palette-darker-contrast, $nifi-theme-surface-palette-lighter-contrast); + } + + .cm-s-nifi div.CodeMirror-selected { + background: if( + $is-dark, + rgba($material-theme-primary-palette-default, 0.4), + rgba($material-theme-primary-palette-darker, 0.4) + ); + } + + .cm-s-nifi.CodeMirror-focused div.CodeMirror-selected { + background: if( + $is-dark, + rgba($material-theme-primary-palette-default, 0.4), + rgba($material-theme-primary-palette-darker, 0.4) + ); + } + + .cm-s-nifi .CodeMirror-line::selection, + .cm-s-nifi .CodeMirror-line > span::selection, + .cm-s-nifi .CodeMirror-line > span > span::selection { + background: if($is-dark, rgba(128, 203, 196, 0.2), rgba(128, 203, 196, 0.8)); + } + + .cm-s-nifi .CodeMirror-line::-moz-selection, + .cm-s-nifi .CodeMirror-line > span::-moz-selection, + .cm-s-nifi .CodeMirror-line > span > span::-moz-selection { + background: if($is-dark, rgba(128, 203, 196, 0.2), rgba(128, 203, 196, 0.8)); + } + + .cm-s-nifi .cm-header { + color: if($is-dark, #b8b8ff, #0000ff); + } + + .cm-s-nifi .cm-quote { + color: if($is-dark, #6bfd6b, #009400); + } + + .cm-s-nifi .cm-negative { + color: if($is-dark, #fc9797, #de3535); + } + + .cm-s-nifi .cm-positive { + color: if($is-dark, #8cfd8c, #219a21); + } + + .cm-s-nifi .cm-bracket { + color: if($is-dark, #93937c, #93937c); + } + + .cm-s-nifi .cm-link { + color: if($is-dark, #8e8ef6, #0000ce); + } + + .cm-s-nifi .cm-invalidchar { + color: if($is-dark, #ff9c9c, #ff0000); + } + + .cm-s-nifi .cm-keyword { + color: if($is-dark, #c792ea, #6800ab); + } + + .cm-s-nifi .cm-operator { + color: if($is-dark, #89ddff, #0083b9); + } + + .cm-s-nifi .cm-variable-2 { + color: if($is-dark, #72b6fc, #0054a6); + } + + .cm-s-nifi .cm-variable-3, + .cm-s-nifi .cm-type { + color: if($is-dark, #f07178, #ad0007); + } + + .cm-s-nifi .cm-builtin { + color: if($is-dark, #a280f3, #3400ad); + } + + .cm-s-nifi .cm-atom { + color: if($is-dark, #f78c6c, #bd2b00); + } + + .cm-s-nifi .cm-number { + color: if($is-dark, #fd758c, #c20021); + } + + .cm-s-nifi .cm-def { + color: if($is-dark, #82aaff, #0553f8); + } + + .cm-s-nifi .cm-string { + color: if($is-dark, #c3e88d, #82dc00); + } Review Comment: This is different than original nifi. Before, if the parameter name didn't align with a known param, it turned red and signified bad input. Now it turns green and doesn't really convey the same thing.   ########## nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-frontend/src/main/nifi/src/assets/styles/_codemirror-theme.scss: ########## Review Comment: There is a flash of what appears to be a text box when opening the editor  _However, this doesn't seem to be related to this pr specifically. We can track it separately if you like_ -- 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]
