]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - themes/default/less/buttons.less
Release 6.5.3
[Github/sugarcrm.git] / themes / default / less / buttons.less
1 // BUTTON STYLES
2 // -------------
3
4
5 // Base styles
6 // --------------------------------------------------
7
8 // Core
9 .btn {
10   display: inline-block;
11   .ie7-inline-block();
12   padding: 4px 10px 4px;
13   margin-bottom: 0; // For input.btn
14   font-size: @baseFontSize;
15   line-height: @baseLineHeight;
16   *line-height: 20px;
17   color: @gray;
18   font-weight: 500;
19   text-align: center;
20   text-shadow: 0 1px 1px rgba(255,255,255,.75);
21   vertical-align: middle;
22   cursor: pointer;
23   .buttonBackground(@btnBackground, @btnBackgroundHighlight);
24   border: 1px solid @btnBorder;
25   *border: 0; // Remove the border to prevent IE7's black border on input:focus
26   border-bottom-color: darken(@btnBorder, 10%);
27   .border-radius(4px);
28   .ie7-restore-left-whitespace(); // Give IE7 some love
29   .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
30 }
31
32 .btn.down {
33     .buttonBackground(@btnBackgroundHighlight,@btnBackground);
34 }
35
36 // Hover state
37 .btn:hover {
38   color: @grayDark;
39   text-decoration: none;
40   background-color: darken(@white, 10%);
41   *background-color: darken(@white, 15%); /* Buttons in IE7 don't get borders, so darken on hover */
42   background-position: 0 -15px;
43
44   // transition is only when going to hover, otherwise the background
45   // behind the gradient (there for IE<=9 fallback) gets mismatched
46   .transition(background-position .1s linear);
47 }
48
49 // Focus state for keyboard and accessibility
50 .btn:focus {
51   .tab-focus();
52 }
53
54 // Active state
55 .btn.active,
56 .btn:active {
57   background-color: darken(@gray, 10%);
58   background-color: darken(@gray, 15%) e("\9");
59   background-image: none;
60   color: @grayLighter !important;
61   text-shadow: 0 1px 1px rgba(0,0,0,.75);
62   outline: 0;
63   .box-shadow(~"inset 0 1px 3px rgba(0,0,0,.5)");
64 }
65
66 // Disabled state
67 .btn.disabled,
68 .btn[disabled] {
69   cursor: default;
70   background-color: darken(@white, 10%);
71   background-image: none;
72   .opacity(65);
73   .box-shadow(none);
74 }
75
76
77 // Button Sizes
78 // --------------------------------------------------
79
80 // Large
81 .btn-large {
82   padding: 9px 14px;
83   font-size: @baseFontSize + 2px;
84   line-height: normal;
85   .border-radius(5px);
86 }
87 .btn-large [class^="icon-"] {
88   margin-top: 1px;
89 }
90
91 // Small
92 .btn-small {
93   padding: 5px 9px;
94   font-size: @baseFontSize - 2px;
95   line-height: @baseLineHeight - 2px;
96 }
97 .btn-small [class^="icon-"] {
98   margin-top: -1px;
99 }
100
101 // Mini
102 .btn-mini {
103   padding: 2px 6px;
104   font-size: @baseFontSize - 2px;
105   line-height: @baseLineHeight - 4px;
106 }
107
108
109 // Alternate buttonshttp://suga.site/sugar7/forecast_james_pro.html#
110 // --------------------------------------------------
111
112 // Set text color
113 // -------------------------
114 .btn-primary,
115 .btn-primary:hover,
116 .btn-warning,
117 .btn-warning:hover,
118 .btn-danger,
119 .btn-danger:hover,
120 .btn-success,
121 .btn-success:hover,
122 .btn-info,
123 .btn-info:hover,
124 .btn-inverse,
125 .btn-inverse:hover {
126   color: @white;
127   text-shadow: 0 -1px 0 rgba(0,0,0,.25);
128 }
129 // Provide *some* extra contrast for those who can get it
130 .btn-primary.active,
131 .btn-warning.active,
132 .btn-danger.active,
133 .btn-success.active,
134 .btn-info.active,
135 .btn-inverse.active,
136 .btn-invisible.active {
137   color: rgba(255,255,255,.75);
138 }
139
140 // Set the backgrounds
141 // -------------------------
142
143 .btn-primary {
144   .buttonBackground(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight);
145 }
146 // Warning appears are orange
147 .btn-warning {
148   .buttonBackground(@btnWarningBackground, @btnWarningBackgroundHighlight);
149 }
150 // Danger and error appear as red
151 .btn-danger {
152   .buttonBackground(@btnDangerBackground, @btnDangerBackgroundHighlight);
153 }
154 // Success appears as green
155 .btn-success {
156   .buttonBackground(@btnSuccessBackground, @btnSuccessBackgroundHighlight);
157 }
158 // Info appears as a neutral blue
159 .btn-info {
160   .buttonBackground(@btnInfoBackground, @btnInfoBackgroundHighlight);
161 }
162 // Inverse appears as dark gray
163 .btn-inverse {
164   .buttonBackground(@btnInverseBackground, @btnInverseBackgroundHighlight);
165 }
166
167 // invisible appears as no button
168 .btn-invisible {
169   background: none;
170   border: 1px solid transparent;
171   .box-shadow(none);
172 }
173 .btn-invisible:hover {
174 border: 1px solid lighten(@btnBorder, 1%);
175 *border: 0; // Remove the border to prevent IE7's black border on input:focus
176 border-top-color: darken(@btnBorder, 5%);
177 }
178
179
180
181 // Cross-browser Jank
182 // --------------------------------------------------
183
184 button.btn,
185 input[type="submit"].btn {
186
187   // Firefox 3.6 only I believe
188   &::-moz-focus-inner {
189     padding: 0;
190     border: 0;
191   }
192
193   // IE7 has some default padding on button controls
194   *padding-top: 2px;
195   *padding-bottom: 2px;
196   &.btn-large {
197     *padding-top: 7px;
198     *padding-bottom: 7px;
199   }
200   &.btn-small {
201     *padding-top: 3px;
202     *padding-bottom: 3px;
203   }
204   &.btn-mini {
205     *padding-top: 1px;
206     *padding-bottom: 1px;
207   }
208 }