source: spip-zone/_plugins_/bootstrap/trunk/bootstrap/css/buttons.less @ 90741

Last change on this file since 90741 was 90741, checked in by cedric@…, 4 years ago

BS 3.3.5 dans la place, work in progress
le plugin passe en v3 dev
On s'occupera de la couche de compat BSv2 dans un second temps

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