Skip to content

Commit

Permalink
some code clean up and reuse of .surface-contrast
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyaslan committed May 2, 2024
1 parent eed1bdd commit a3825e6
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
}

text.stats-label {
fill: $surface-contrast;
@extend .surface-contrast;
}

text.stats-value {
Expand Down Expand Up @@ -392,7 +392,7 @@
/* ports */

text.port-name {
fill: $surface-contrast;
@extend .surface-contrast;
}

text.port-icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@
$is-dark: map-get($nifi-theme-color-config, is-dark);
$nifi-theme-surface-palette-darker: mat.get-color-from-palette($nifi-theme-surface-palette, darker);
$nifi-theme-surface-palette-lighter: mat.get-color-from-palette($nifi-theme-surface-palette, lighter);
$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
);

div.navigation-control {
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@
$is-dark: map-get($nifi-theme-color-config, is-dark);
$nifi-theme-surface-palette-darker: mat.get-color-from-palette($nifi-theme-surface-palette, darker);
$nifi-theme-surface-palette-lighter: mat.get-color-from-palette($nifi-theme-surface-palette, lighter);
$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
);

div.operation-control {
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
Expand All @@ -50,9 +42,6 @@
transparent 35px
);
}

.operation-context-type {
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@
$material-theme-warn-palette-darker: mat.get-color-from-palette($material-theme-warn-palette, darker);
$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
);

.flow-status {
background: if($is-dark, $nifi-theme-surface-palette-darker, $nifi-theme-surface-palette-lighter);
Expand All @@ -55,11 +47,7 @@
);

.fa {
color: if(
$is-dark,
$nifi-theme-surface-palette-lighter-contrast,
$nifi-theme-surface-palette-darker-contrast
);
@extend .surface-contrast;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,22 @@

// Get hues from palette
$is-dark: map-get($material-theme-color-config, is-dark);
$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
);
$material-theme-primary-palette-default: mat.get-color-from-palette($material-theme-primary-palette);
$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);
$nifi-theme-surface-palette-darker: mat.get-color-from-palette($nifi-theme-surface-palette, darker);
$nifi-theme-surface-palette-lighter: mat.get-color-from-palette($nifi-theme-surface-palette, lighter);

$hover: var(--mat-menu-item-hover-state-layer-color);

.new-canvas-item {
.icon {
&.hovering {
// This solution re-uses the highlight value used throughout the UI, but because we need to hide the non-hover
// version of the icons, we create a double layered gradient with the matching background color of the
// navigation bar, then put the highlight on top of it.
background: linear-gradient(
var(--mat-menu-item-hover-state-layer-color),
var(--mat-menu-item-hover-state-layer-color)
),
linear-gradient(
if($is-dark, $nifi-theme-surface-palette-lighter, $nifi-theme-surface-palette-lighter),
if($is-dark, $nifi-theme-surface-palette-lighter, $nifi-theme-surface-palette-lighter)
);
background: linear-gradient($hover, $hover),
linear-gradient($nifi-theme-surface-palette-lighter, $nifi-theme-surface-palette-lighter);

.component-button-grip {
background: repeating-linear-gradient(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
}

marker {
fill: $surface-contrast;
@extend .surface-contrast;
}

circle.flowfile-link {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,12 @@

$is-dark: map-get($nifi-theme-color-config, is-dark);
$material-theme-warn-palette-darker: mat.get-color-from-palette($material-theme-warn-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
);
$surface-contrast: if(
$is-dark,
$nifi-theme-surface-palette-darker-contrast,
$nifi-theme-surface-palette-lighter-contrast
);

#lineage {
canvas,
svg {
text.event-type {
fill: $surface-contrast;
@extend .surface-contrast;
}

path.link.selected {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}

.CodeMirror-code {
color: $surface-contrast;
@extend .surface-contrast;
}

.CodeMirror-selected {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@
// Get hues from palette
$is-dark: map-get($nifi-theme-color-config, is-dark);

$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
);

$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);
$selected-row-color: if(
Expand Down

0 comments on commit a3825e6

Please sign in to comment.