bootstrap-source/bootstrap-3.0.3/less/buttons.less
author stetrabby <info@trabucchi.de>
Fri, 20 Dec 2013 22:49:16 +0100
changeset 54 0ded9d7748b7
permissions -rwxr-xr-x
initial less based on the pymove3d.css
info@54
     1
//
info@54
     2
// Buttons
info@54
     3
// --------------------------------------------------
info@54
     4
info@54
     5
info@54
     6
// Base styles
info@54
     7
// --------------------------------------------------
info@54
     8
info@54
     9
.btn {
info@54
    10
  display: inline-block;
info@54
    11
  margin-bottom: 0; // For input.btn
info@54
    12
  font-weight: @btn-font-weight;
info@54
    13
  text-align: center;
info@54
    14
  vertical-align: middle;
info@54
    15
  cursor: pointer;
info@54
    16
  background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
info@54
    17
  border: 1px solid transparent;
info@54
    18
  white-space: nowrap;
info@54
    19
  .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @border-radius-base);
info@54
    20
  .user-select(none);
info@54
    21
info@54
    22
  &:focus {
info@54
    23
    .tab-focus();
info@54
    24
  }
info@54
    25
info@54
    26
  &:hover,
info@54
    27
  &:focus {
info@54
    28
    color: @btn-default-color;
info@54
    29
    text-decoration: none;
info@54
    30
  }
info@54
    31
info@54
    32
  &:active,
info@54
    33
  &.active {
info@54
    34
    outline: 0;
info@54
    35
    background-image: none;
info@54
    36
    .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
info@54
    37
  }
info@54
    38
info@54
    39
  &.disabled,
info@54
    40
  &[disabled],
info@54
    41
  fieldset[disabled] & {
info@54
    42
    cursor: not-allowed;
info@54
    43
    pointer-events: none; // Future-proof disabling of clicks
info@54
    44
    .opacity(.65);
info@54
    45
    .box-shadow(none);
info@54
    46
  }
info@54
    47
}
info@54
    48
info@54
    49
info@54
    50
// Alternate buttons
info@54
    51
// --------------------------------------------------
info@54
    52
info@54
    53
.btn-default {
info@54
    54
  .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border);
info@54
    55
}
info@54
    56
.btn-primary {
info@54
    57
  .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);
info@54
    58
}
info@54
    59
// Warning appears as orange
info@54
    60
.btn-warning {
info@54
    61
  .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border);
info@54
    62
}
info@54
    63
// Danger and error appear as red
info@54
    64
.btn-danger {
info@54
    65
  .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border);
info@54
    66
}
info@54
    67
// Success appears as green
info@54
    68
.btn-success {
info@54
    69
  .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border);
info@54
    70
}
info@54
    71
// Info appears as blue-green
info@54
    72
.btn-info {
info@54
    73
  .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);
info@54
    74
}
info@54
    75
info@54
    76
info@54
    77
// Link buttons
info@54
    78
// -------------------------
info@54
    79
info@54
    80
// Make a button look and behave like a link
info@54
    81
.btn-link {
info@54
    82
  color: @link-color;
info@54
    83
  font-weight: normal;
info@54
    84
  cursor: pointer;
info@54
    85
  border-radius: 0;
info@54
    86
info@54
    87
  &,
info@54
    88
  &:active,
info@54
    89
  &[disabled],
info@54
    90
  fieldset[disabled] & {
info@54
    91
    background-color: transparent;
info@54
    92
    .box-shadow(none);
info@54
    93
  }
info@54
    94
  &,
info@54
    95
  &:hover,
info@54
    96
  &:focus,
info@54
    97
  &:active {
info@54
    98
    border-color: transparent;
info@54
    99
  }
info@54
   100
  &:hover,
info@54
   101
  &:focus {
info@54
   102
    color: @link-hover-color;
info@54
   103
    text-decoration: underline;
info@54
   104
    background-color: transparent;
info@54
   105
  }
info@54
   106
  &[disabled],
info@54
   107
  fieldset[disabled] & {
info@54
   108
    &:hover,
info@54
   109
    &:focus {
info@54
   110
      color: @btn-link-disabled-color;
info@54
   111
      text-decoration: none;
info@54
   112
    }
info@54
   113
  }
info@54
   114
}
info@54
   115
info@54
   116
info@54
   117
// Button Sizes
info@54
   118
// --------------------------------------------------
info@54
   119
info@54
   120
.btn-lg {
info@54
   121
  // line-height: ensure even-numbered height of button next to large input
info@54
   122
  .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
info@54
   123
}
info@54
   124
.btn-sm {
info@54
   125
  // line-height: ensure proper height of button next to small input
info@54
   126
  .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
info@54
   127
}
info@54
   128
.btn-xs {
info@54
   129
  .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @border-radius-small);
info@54
   130
}
info@54
   131
info@54
   132
info@54
   133
// Block button
info@54
   134
// --------------------------------------------------
info@54
   135
info@54
   136
.btn-block {
info@54
   137
  display: block;
info@54
   138
  width: 100%;
info@54
   139
  padding-left: 0;
info@54
   140
  padding-right: 0;
info@54
   141
}
info@54
   142
info@54
   143
// Vertically space out multiple block buttons
info@54
   144
.btn-block + .btn-block {
info@54
   145
  margin-top: 5px;
info@54
   146
}
info@54
   147
info@54
   148
// Specificity overrides
info@54
   149
input[type="submit"],
info@54
   150
input[type="reset"],
info@54
   151
input[type="button"] {
info@54
   152
  &.btn-block {
info@54
   153
    width: 100%;
info@54
   154
  }
info@54
   155
}
Impressum Datenschutzerklärung