_buttons.scss 2.6 KB
Newer Older
C
chomik 已提交
1
.btn {
2 3 4
  display: inline-flex;
  align-items: center;
  justify-content: center;
C
codecalm 已提交
5
  letter-spacing: .01em;
C
chomik 已提交
6
  box-shadow: 0 1px 1px rgba(0, 0, 0, .03);
C
chomik 已提交
7

C
codecalm 已提交
8
  &:not([class^="btn-outline"]):not([class*=" btn-outline"]):not(.btn-secondary) {
9
    text-shadow: 1px 1px 0 rgba(0, 0, 0, .05);
C
codecalm 已提交
10
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .05), inset 0 2px 0 -1px rgba(255, 255, 255, .1);
11 12

    svg.icon {
13
      filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .05));
14 15 16 17
    }
  }

  .icon {
C
codecalm 已提交
18
    margin: 0 .5em 0 -.25em;
19 20 21 22 23 24 25 26 27 28 29 30
    font-size: 1.2em;
    vertical-align: sub;
  }

  .icon-right {
    margin: 0 -.25em 0 .5em;
  }

  svg.icon {
    width: 1em;
    height: 1em;
    stroke-width: 1.5;
C
chomik 已提交
31
  }
C
chomik 已提交
32 33
}

C
codecalm 已提交
34 35 36 37
.btn-sm {
  font-weight: 400;
}

C
chomik 已提交
38 39
.btn-avatar {
  margin: 0 .25rem 0 -.25rem;
C
chomik 已提交
40 41 42 43 44

  @at-root .btn #{&} {
    width: 1.25rem;
    height: 1.25rem;
  }
C
chomik 已提交
45 46 47 48 49 50 51 52
}

.btn-pill {
  padding-right: 1.5em;
  padding-left: 1.5em;
  border-radius: 10rem;
}

C
codecalm 已提交
53 54 55 56 57 58
.btn-icon {
  .icon {
    margin: 0 -.5em;
  }
}

C
chomik 已提交
59
// stylelint-disable declaration-no-important
C
chomik 已提交
60 61 62 63 64
.btn-link {
  box-shadow: none !important;
}

.btn-secondary {
C
codecalm 已提交
65
  @include button-variant(#fff, $border-color, $text-muted);
C
chomik 已提交
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
}

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

.btn-list {
  margin-bottom: -.5rem;
  font-size: 0;

  > .btn,
  > .dropdown {
    margin-bottom: .5rem;

    &:not(:last-child) {
      margin-right: .5rem;
    }
  }
}

@if $generate-social-colors {
  @each $vendor, $color in $social-colors {
    .btn-#{$vendor} {
      @include button-variant($color, $color);
    }
C
codecalm 已提交
91 92 93 94

    .btn-outline-#{$vendor} {
      @include button-outline-variant($color, $color);
    }
C
chomik 已提交
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
  }

}

@if $generate-colors {
  @each $name, $color in $colors {
    .btn-#{$name} {
      @include button-variant($color, $color);
    }

    .btn-outline-#{$name} {
      @include button-outline-variant($color, $color);
    }
  }
}

.btn-loader {
  display: none;
  width: 1em;
  height: 1em;
  color: inherit;

  @at-root .btn-loading & {
    display: inline-block;
  }
}

.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;
  }
}

.btn-floating {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 1030;
}

/**
Button with label
 */
.btn-label {
  position: relative;
  padding-left: px2rem(48px);
}

.btn-label-icon {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: px2rem(36px);
  padding-top: px2rem(6px);
  padding-bottom: px2rem(6px);
  margin-bottom: 0;
  line-height: inherit;
  cursor: pointer;
  background-color: rgba(0, 0, 0, .1);
}