_buttons.scss 2.5 KB
Newer Older
C
chomik 已提交
1
.btn {
C
codecalm 已提交
2
  &:not([class^="btn-outline"]):not([class*=" btn-outline"]):not([class^="btn-ghost"]):not([class*=" btn-ghost"]):not(.btn-secondary) {
3
    text-shadow: 1px 1px 0 rgba(0, 0, 0, .05);
C
codecalm 已提交
4 5 6 7

    &: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);
    }
8 9

    svg.icon {
10
      filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .05));
11 12 13
    }
  }

C
codecalm 已提交
14 15 16 17 18
  &:disabled,
  &.disabled {
    cursor: not-allowed;
  }

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

C
codecalm 已提交
25 26 27 28 29 30 31
  .avatar {
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: text-top;
    margin: 0 .5em 0 -.25em;
  }

32 33 34 35 36 37 38 39
  .icon-right {
    margin: 0 -.25em 0 .5em;
  }

  svg.icon {
    width: 1em;
    height: 1em;
    stroke-width: 1.5;
C
chomik 已提交
40
  }
C
chomik 已提交
41 42
}

C
codecalm 已提交
43 44 45 46
.btn-lg {
  svg.icon {
    stroke-width: 2;
  }
C
codecalm 已提交
47 48
}

C
chomik 已提交
49 50 51 52 53 54
.btn-pill {
  padding-right: 1.5em;
  padding-left: 1.5em;
  border-radius: 10rem;
}

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

C
codecalm 已提交
58
  .icon {
C
codecalm 已提交
59
    margin: 0 -1em;
C
codecalm 已提交
60 61 62
  }
}

C
chomik 已提交
63
// stylelint-disable declaration-no-important
C
chomik 已提交
64 65 66 67 68
.btn-link {
  box-shadow: none !important;
}

.btn-secondary {
C
codecalm 已提交
69
  @include button-variant(#fff, $border-color, $body-color);
C
codecalm 已提交
70
  background-image: linear-gradient(-180deg, transparent, $gray-100 90%);
C
chomik 已提交
71 72 73 74 75 76 77
}

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

.btn-list {
C
codecalm 已提交
78 79
  display: flex;
  flex-wrap: wrap;
C
chomik 已提交
80
  margin-bottom: -.5rem;
C
codecalm 已提交
81
  margin-right: -.5rem;
C
chomik 已提交
82 83 84 85 86 87 88 89 90 91 92

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

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

C
codecalm 已提交
93 94 95 96 97 98 99 100 101
@if $enable-ghost-buttons {
  @each $vendor, $color in $theme-colors {
    .btn-ghost-#{$vendor} {
      @include button-variant(transparent, transparent, $color, $color, $color, #fff, $color, $color);
    }
  }
}

@if $enable-social-colors {
C
chomik 已提交
102 103 104 105
  @each $vendor, $color in $social-colors {
    .btn-#{$vendor} {
      @include button-variant($color, $color);
    }
C
codecalm 已提交
106 107 108 109

    .btn-outline-#{$vendor} {
      @include button-outline-variant($color, $color);
    }
C
chomik 已提交
110 111 112
  }
}

C
codecalm 已提交
113
@if $enable-extra-colors {
C
chomik 已提交
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
  @each $name, $color in $colors {
    .btn-#{$name} {
      @include button-variant($color, $color);
    }

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

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