_buttons.scss 2.7 KB
Newer Older
C
chomik 已提交
1
.btn {
C
codecalm 已提交
2
  font-weight: 600;
C
codecalm 已提交
3 4 5
  display: inline-flex;
  align-items: center;
  justify-content: center;
C
codecalm 已提交
6

C
codecalm 已提交
7
  &:not([class^="btn-outline"]):not([class*=" btn-outline"]):not([class^="btn-ghost"]):not([class*=" btn-ghost"]) {
C
codecalm 已提交
8 9 10 11
    &:not(.btn-secondary) {
      text-shadow: 1px 1px 0 rgba(0, 0, 0, .02);
    }

C
codecalm 已提交
12 13 14
    &:not(:focus):not(.focus) {
      box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .05), inset 0 2px 0 -1px rgba(255, 255, 255, .1);
    }
15 16

    svg.icon {
17
      filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .05));
18 19 20
    }
  }

C
codecalm 已提交
21 22 23 24 25
  &:disabled,
  &.disabled {
    cursor: not-allowed;
  }

26
  .icon {
C
codecalm 已提交
27
    margin: 0 .25em 0 -.25em;
28 29 30 31
    font-size: 1.2em;
    vertical-align: sub;
  }

C
codecalm 已提交
32 33 34 35 36 37 38
  .avatar {
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: text-top;
    margin: 0 .5em 0 -.25em;
  }

39 40 41 42 43 44 45
  .icon-right {
    margin: 0 -.25em 0 .5em;
  }

  svg.icon {
    width: 1em;
    height: 1em;
C
codecalm 已提交
46
    stroke-width: 1.75;
C
chomik 已提交
47
  }
C
chomik 已提交
48 49
}

C
codecalm 已提交
50 51 52 53 54 55 56 57 58 59 60 61
.btn-secondary {
  @include button-variant($white, $border-color, $dark);
  background-image: linear-gradient(-180deg, rgba($dark, 0), rgba($dark, .04) 100%);
  box-shadow: none !important;

  &.active {
    background: $primary;
    color: $white;
    z-index: 3 !important;
  }
}

C
codecalm 已提交
62 63 64 65
.btn-lg {
  svg.icon {
    stroke-width: 2;
  }
C
codecalm 已提交
66 67
}

C
chomik 已提交
68 69 70 71 72 73
.btn-pill {
  padding-right: 1.5em;
  padding-left: 1.5em;
  border-radius: 10rem;
}

C
codecalm 已提交
74
.btn-icon {
C
codecalm 已提交
75 76
  min-width: add($btn-line-height * $btn-font-size + $btn-padding-y * 2, $btn-border-width * 2);

C
codecalm 已提交
77
  .icon {
C
codecalm 已提交
78
    margin: 0 -1em;
C
codecalm 已提交
79 80 81
  }
}

C
chomik 已提交
82
// stylelint-disable declaration-no-important
C
chomik 已提交
83 84 85 86 87 88 89 90 91
.btn-link {
  box-shadow: none !important;
}

.btn-square {
  border-radius: 0;
}

.btn-list {
C
codecalm 已提交
92 93
  display: flex;
  flex-wrap: wrap;
C
codecalm 已提交
94
  margin-bottom: -.5rem !important;
C
codecalm 已提交
95
  margin-right: -.5rem;
C
chomik 已提交
96 97 98

  > .btn,
  > .dropdown {
C
codecalm 已提交
99 100 101 102 103 104
    margin: 0 .5rem .5rem 0;
  }

  >.btn-block {
    flex: 1;
    white-space: nowrap;
C
chomik 已提交
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
  }
}

.btn-options {
  display: flex;
  align-items: center;
  padding: 0;
  color: $text-muted;
  cursor: pointer;
  background: none;
  border: none;

  &:focus {
    outline: 0;
  }

  .icon {
    width: 1rem;
    height: 1rem;
  }
}
C
codecalm 已提交
126 127 128 129 130 131 132 133

.btn-floating {
  position: fixed;
  z-index: $zindex-fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  border-radius: 50%;
}
C
codecalm 已提交
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156

.btn-loading {
  position: relative;
  color: transparent !important;
  text-shadow: none !important;
  pointer-events: none;

  &:after {
    content: '';
    display: inline-block;
    vertical-align: text-bottom;
    border: $spinner-border-width-sm solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    color: $white;
    position: absolute;
    width: 1rem;
    height: 1rem;
    left: calc(50% - .5rem);
    top: calc(50% - .5rem);
    animation: spinner-border .75s linear infinite;
  }
}