/**
 * Licensed to The OpenNMS Group, Inc (TOG) under one or more
 * contributor license agreements.  See the LICENSE.md file
 * distributed with this work for additional information
 * regarding copyright ownership.
 *
 * TOG licenses this file to You under the GNU Affero General
 * Public License Version 3 (the "License") or (at your option)
 * any later version.  You may not use this file except in
 * compliance with the License.  You may obtain a copy of the
 * License at:
 *
 *      https://www.gnu.org/licenses/agpl-3.0.txt
 *
 * 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.
 */
@import "severity-definition.scss";

@mixin severity-variant($textcolor, $bgcolor, $bordercolor, $type) {
  .severity & {
    color: $textcolor;
    background-color: $bgcolor;

    /* border: 1px 0 solid $table-border-color; */

    td {
      /* border: 1px 0 solid $table-border-color; */
    }
    &.nodivider {
      border-top: 1px solid $table-border-color;
    }
    .bright, &.bright {
      background-image: url(/opennms/images/bg#{$type}.png);
      background-repeat: repeat-y;
      background-position: left top;
      padding-left: 18px;
      td: {
        padding-left: 18px;
      }
    }
  }
}

.severity-critical, .severity-Critical {
  @include severity-variant($severity-alarm-critical-text, $severity-alarm-critical-bg, $severity-alarm-critical-border, 'Critical');
}

.severity-major, .severity-Major {
  @include severity-variant($severity-alarm-major-text, $severity-alarm-major-bg, $severity-alarm-major-border, 'Major');
}

.severity-minor, .severity-Minor {
  @include severity-variant($severity-alarm-minor-text, $severity-alarm-minor-bg, $severity-alarm-minor-border, 'Minor');
}

.severity-warning, .severity-Warning {
  @include severity-variant($severity-alarm-warning-text, $severity-alarm-warning-bg, $severity-alarm-warning-border, 'Warning');
}

.severity-indeterminate, .severity-Indeterminate {
  @include severity-variant($severity-alarm-indeterminate-text, $severity-alarm-indeterminate-bg, $severity-alarm-indeterminate-border, 'Indeterminate');
}

.severity-normal, .severity-Normal {
  @include severity-variant($severity-alarm-normal-text, $severity-alarm-normal-bg, $severity-alarm-normal-border, 'Normal');
}

.severity-cleared, .severity-Cleared {
  @include severity-variant($severity-alarm-cleared-text, $severity-alarm-cleared-bg, $severity-alarm-cleared-border, 'Cleared');
}
