bootstrap-source/bootstrap-3.0.3/less/input-groups.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
// Input groups
info@54
     3
// --------------------------------------------------
info@54
     4
info@54
     5
// Base styles
info@54
     6
// -------------------------
info@54
     7
.input-group {
info@54
     8
  position: relative; // For dropdowns
info@54
     9
  display: table;
info@54
    10
  border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
info@54
    11
info@54
    12
  // Undo padding and float of grid classes
info@54
    13
  &[class*="col-"] {
info@54
    14
    float: none;
info@54
    15
    padding-left: 0;
info@54
    16
    padding-right: 0;
info@54
    17
  }
info@54
    18
info@54
    19
  .form-control {
info@54
    20
    width: 100%;
info@54
    21
    margin-bottom: 0;
info@54
    22
  }
info@54
    23
}
info@54
    24
info@54
    25
// Sizing options
info@54
    26
//
info@54
    27
// Remix the default form control sizing classes into new ones for easier
info@54
    28
// manipulation.
info@54
    29
info@54
    30
.input-group-lg > .form-control,
info@54
    31
.input-group-lg > .input-group-addon,
info@54
    32
.input-group-lg > .input-group-btn > .btn { .input-lg(); }
info@54
    33
.input-group-sm > .form-control,
info@54
    34
.input-group-sm > .input-group-addon,
info@54
    35
.input-group-sm > .input-group-btn > .btn { .input-sm(); }
info@54
    36
info@54
    37
info@54
    38
// Display as table-cell
info@54
    39
// -------------------------
info@54
    40
.input-group-addon,
info@54
    41
.input-group-btn,
info@54
    42
.input-group .form-control {
info@54
    43
  display: table-cell;
info@54
    44
info@54
    45
  &:not(:first-child):not(:last-child) {
info@54
    46
    border-radius: 0;
info@54
    47
  }
info@54
    48
}
info@54
    49
// Addon and addon wrapper for buttons
info@54
    50
.input-group-addon,
info@54
    51
.input-group-btn {
info@54
    52
  width: 1%;
info@54
    53
  white-space: nowrap;
info@54
    54
  vertical-align: middle; // Match the inputs
info@54
    55
}
info@54
    56
info@54
    57
// Text input groups
info@54
    58
// -------------------------
info@54
    59
.input-group-addon {
info@54
    60
  padding: @padding-base-vertical @padding-base-horizontal;
info@54
    61
  font-size: @font-size-base;
info@54
    62
  font-weight: normal;
info@54
    63
  line-height: 1;
info@54
    64
  color: @input-color;
info@54
    65
  text-align: center;
info@54
    66
  background-color: @input-group-addon-bg;
info@54
    67
  border: 1px solid @input-group-addon-border-color;
info@54
    68
  border-radius: @border-radius-base;
info@54
    69
info@54
    70
  // Sizing
info@54
    71
  &.input-sm {
info@54
    72
    padding: @padding-small-vertical @padding-small-horizontal;
info@54
    73
    font-size: @font-size-small;
info@54
    74
    border-radius: @border-radius-small;
info@54
    75
  }
info@54
    76
  &.input-lg {
info@54
    77
    padding: @padding-large-vertical @padding-large-horizontal;
info@54
    78
    font-size: @font-size-large;
info@54
    79
    border-radius: @border-radius-large;
info@54
    80
  }
info@54
    81
info@54
    82
  // Nuke default margins from checkboxes and radios to vertically center within.
info@54
    83
  input[type="radio"],
info@54
    84
  input[type="checkbox"] {
info@54
    85
    margin-top: 0;
info@54
    86
  }
info@54
    87
}
info@54
    88
info@54
    89
// Reset rounded corners
info@54
    90
.input-group .form-control:first-child,
info@54
    91
.input-group-addon:first-child,
info@54
    92
.input-group-btn:first-child > .btn,
info@54
    93
.input-group-btn:first-child > .dropdown-toggle,
info@54
    94
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
info@54
    95
  .border-right-radius(0);
info@54
    96
}
info@54
    97
.input-group-addon:first-child {
info@54
    98
  border-right: 0;
info@54
    99
}
info@54
   100
.input-group .form-control:last-child,
info@54
   101
.input-group-addon:last-child,
info@54
   102
.input-group-btn:last-child > .btn,
info@54
   103
.input-group-btn:last-child > .dropdown-toggle,
info@54
   104
.input-group-btn:first-child > .btn:not(:first-child) {
info@54
   105
  .border-left-radius(0);
info@54
   106
}
info@54
   107
.input-group-addon:last-child {
info@54
   108
  border-left: 0;
info@54
   109
}
info@54
   110
info@54
   111
// Button input groups
info@54
   112
// -------------------------
info@54
   113
.input-group-btn {
info@54
   114
  position: relative;
info@54
   115
  white-space: nowrap;
info@54
   116
info@54
   117
  // Negative margin to only have a 1px border between the two
info@54
   118
  &:first-child > .btn {
info@54
   119
    margin-right: -1px;
info@54
   120
  }
info@54
   121
  &:last-child > .btn {
info@54
   122
    margin-left: -1px;
info@54
   123
  }
info@54
   124
}
info@54
   125
.input-group-btn > .btn {
info@54
   126
  position: relative;
info@54
   127
  // Jankily prevent input button groups from wrapping
info@54
   128
  + .btn {
info@54
   129
    margin-left: -4px;
info@54
   130
  }
info@54
   131
  // Bring the "active" button to the front
info@54
   132
  &:hover,
info@54
   133
  &:active {
info@54
   134
    z-index: 2;
info@54
   135
  }
info@54
   136
}
Impressum Datenschutzerklärung