@mixin ui-button() {
  & {
    padding: 0;
    background: transparent;
    border: none;
    outline: none;
    vertical-align: middle;
    position: relative;
    user-select: none;
    opacity: 0.99;
    transition: opacity .1s linear;
  }

  &::-moz-focus-inner {
    border: 0;
    padding: 0;
  }

  /* Overrides normalize.css */
  &:-moz-focusring {
    outline: none;
  }

  &:active {
    box-shadow: none;
    opacity: 1;
    transition: opacity .1s linear;
  }
}

.ui-button {
  @include ui-button()
}

@mixin ui-button() {
  & {
    padding: 0;
    background: transparent;
    border: none;
    outline: none;
    vertical-align: middle;
    position: relative;
    user-select: none;
    /* z-index & transition is for :active detection */
    z-index: 0;
    transition: z-index .1s linear;
  }

  &::-moz-focus-inner {
    border: 0;
    padding: 0;
  }

  /* Overrides normalize.css */
  &:-moz-focusring {
    outline: none;
  }

  &:active {
    box-shadow: none;
    /* z-index & transition is for :active detection */
    z-index: 1;
    transition: z-index .1s linear;
  }
}

.ui-button {
  @include ui-button()
}

Use z-index to detect :active
Use z-index to detect :active