@use "../../variables/index" as *;

// Icon font/SVG base styles
// These mixins replace @extend for better performance

@mixin c8y-glyph {
  display: inline-block;
  text-decoration: inherit;
  text-transform: none;
  font-weight: normal;
  font-style: normal;
  font-variant: normal;
  line-height: 1;
  text-rendering: optimizeLegibility;
  @if $use-svg-icons {
    &::before {
      content: "";
      display: inline-block;
      width: 1em;
      height: 1em;
      vertical-align: top;
      background-color: currentColor;
      mask-size: contain;
      mask-repeat: no-repeat;
      mask-position: center;
      -webkit-mask-size: contain;
      -webkit-mask-repeat: no-repeat;
      -webkit-mask-position: center;
    }
  } @else {
    font-family: 'c8y-glyphs' !important;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
  }
}

// Inline variant for use directly inside ::before/::after blocks
// (the regular c8y-glyph mixin nests under &::before which doesn't work on pseudo-elements)
@mixin c8y-glyph-inline {
  @if $use-svg-icons {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: top;
    background-color: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
  } @else {
    font-family: 'c8y-glyphs' !important;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
  }
}

@mixin dlt-c8y-icon {
  display: inline-block;
  text-transform: none;
  font-weight: normal;
  font-style: normal;
  font-variant: normal;
  line-height: 1;
  @if $use-svg-icons {
    &::before {
      content: "";
      display: inline-block;
      width: 1.1em;
      height: 1.1em;
      vertical-align: top;
      background-color: currentColor;
      mask-size: contain;
      mask-repeat: no-repeat;
      mask-position: center;
      -webkit-mask-size: contain;
      -webkit-mask-repeat: no-repeat;
      -webkit-mask-position: center;
    }
  } @else {
    font-family: 'dlt-c8y-icons' !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

// Inline variant for use directly inside ::before/::after blocks
// (the regular dlt-c8y-icon mixin nests under &::before which doesn't work on pseudo-elements)
@mixin dlt-c8y-icon-inline {
  @if $use-svg-icons {
    content: "";
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    vertical-align: top;
    background-color: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
  } @else {
    font-family: 'dlt-c8y-icons' !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}
