Button.css 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /*
  2. ---
  3. name: Button
  4. description: OOCSS Button class
  5. provides: Button
  6. # requires:
  7. license: |
  8. Licensed to Cloudera, Inc. under one
  9. or more contributor license agreements. See the NOTICE file
  10. distributed with this work for additional information
  11. regarding copyright ownership. Cloudera, Inc. licenses this file
  12. to you under the Apache License, Version 2.0 (the
  13. "License"); you may not use this file except in compliance
  14. with the License. You may obtain a copy of the License at
  15. http://www.apache.org/licenses/LICENSE-2.0
  16. Unless required by applicable law or agreed to in writing, software
  17. distributed under the License is distributed on an "AS IS" BASIS,
  18. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. See the License for the specific language governing permissions and
  20. limitations under the License.
  21. authors:
  22. - Thomas Aylott <thomas@cloudera.com>
  23. ...
  24. */
  25. .Button:link,
  26. .Button:hover,
  27. .Button:focus,
  28. .Button:active,
  29. .Button{
  30. position: relative;
  31. display: inline-block;
  32. text-align: center;
  33. vertical-align: middle;
  34. padding: 2px 1em;
  35. cursor: pointer;
  36. text-decoration: none;
  37. -webkit-box-sizing: border-box;
  38. -moz-box-sizing: border-box;
  39. -o-box-sizing: border-box;
  40. box-sizing: border-box;
  41. -webkit-user-select:none;
  42. -moz-user-select:none;
  43. -o-user-select:none;
  44. user-select:none;
  45. -webkit-user-drag: element;
  46. -moz-user-drag: element;
  47. -o-user-drag: element;
  48. user-drag: element;
  49. -webkit-background-clip: border-box;
  50. -moz-background-clip: border-box;
  51. -o-background-clip: border-box;
  52. background-clip: border-box;
  53. }
  54. /*remove all disabled states by forcing them to the default state*/
  55. .Button[disabled],
  56. .Button[disabled]:link,
  57. .Button[disabled]:hover,
  58. .Button[disabled]:focus,
  59. .Button[disabled]:active,
  60. .Button.disabled,
  61. .Button.disabled:link,
  62. .Button.disabled:hover,
  63. .Button.disabled:focus,
  64. .Button.disabled:active,
  65. .Button:link,
  66. .Button:visited,
  67. .Button{
  68. font-family: "Lucida Grande", Lucida, Tahoma, sans-serif;
  69. color: #000;
  70. border: 1px solid;
  71. border-top-color: #666;
  72. border-right-color: #333;
  73. border-bottom-color: #111;
  74. border-left-color: #555;
  75. -webkit-box-shadow: inset 0 0 2px #fff;
  76. -moz-box-shadow: inset 0 0 2px #fff;
  77. -o-box-shadow: inset 0 0 2px #fff;
  78. box-shadow: inset 0 0 2px #fff;
  79. background: #A4A4A4;
  80. background: -moz-linear-gradient(top, #DEDEDE, #A4A4A4);
  81. background: -webkit-gradient(linear, left top, left bottom, from(#DEDEDE), to(#A4A4A4));
  82. -ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#DEDEDE, EndColorStr=#A4A4A4)";
  83. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#DEDEDE, EndColorStr=#A4A4A4);
  84. }
  85. /*disabled subclass*/
  86. .Button[disabled],
  87. .Button[disabled]:link,
  88. .Button[disabled]:visited,
  89. .Button[disabled]:hover,
  90. .Button[disabled]:focus,
  91. .Button[disabled]:active,
  92. .Button.disabled,
  93. .Button.disabled:link,
  94. .Button.disabled:visited,
  95. .Button.disabled:hover,
  96. .Button.disabled:focus,
  97. .Button.disabled:active{
  98. cursor: default;
  99. color: #666;
  100. border-color: #999;
  101. }
  102. /*States*/
  103. .Button:hover,
  104. .Button:focus{
  105. border-color: #5074d4;
  106. z-index: 1; /*current Button should be above its siblings*/
  107. -webkit-box-shadow: inset 0 0 2px #fff, 0 0 3px #5074d4;
  108. -moz-box-shadow: inset 0 0 2px #fff, 0 0 3px #5074d4;
  109. -o-box-shadow: inset 0 0 2px #fff, 0 0 3px #5074d4;
  110. box-shadow: inset 0 0 2px #fff, 0 0 3px #5074d4;
  111. -ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#EEEEEE, EndColorStr=#AAAAAA)";
  112. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#EEEEEE, EndColorStr=#AAAAAA);
  113. }
  114. .Button:active{
  115. -webkit-box-shadow: inset 0 2px 3px #777;
  116. -moz-box-shadow: inset 0 2px 3px #777;
  117. -o-box-shadow: inset 0 2px 3px #777;
  118. box-shadow: inset 0 2px 3px #777;
  119. background: #888888;
  120. background: -moz-linear-gradient(top, #888888, #A2A2A2);
  121. background: -webkit-gradient(linear, left top, left bottom, from(#888888), to(#A2A2A2));
  122. -ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#888888, EndColorStr=#A2A2A2)";
  123. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#888888, EndColorStr=#A2A2A2);
  124. }
  125. /*notFocused parent*/
  126. .notFocused .Button,
  127. .notFocused .Button:link,
  128. .notFocused .Button:visited,
  129. .notFocused .Button:hover,
  130. .notFocused .Button:focus,
  131. .notFocused .Button:active{
  132. border-color: #999;
  133. color: #666;
  134. background: #E5E5E5;
  135. background: -moz-linear-gradient(top, #F6F6F6, #E5E5E5);
  136. background: -webkit-gradient(linear, left top, left bottom, from(#F6F6F6), to(#E5E5E5));
  137. -ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#F6F6F6, EndColorStr=#E5E5E5)";
  138. filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#F6F6F6, EndColorStr=#E5E5E5);
  139. }
  140. .notFocused .Button:active{
  141. -webkit-box-shadow: inset 0 2px 3px #ccc;
  142. -moz-box-shadow: inset 0 2px 3px #ccc;
  143. -o-box-shadow: inset 0 2px 3px #ccc;
  144. box-shadow: inset 0 2px 3px #ccc;
  145. }
  146. /*round*/
  147. input.round,
  148. input.roundLeft,
  149. button.round,
  150. button.roundLeft,
  151. .Button.round,
  152. .Button.roundLeft{
  153. -webkit-border-top-left-radius: 1ex;
  154. -webkit-border-bottom-left-radius: 1ex;
  155. -moz-border-radius-topleft: 1ex;
  156. -moz-border-radius-bottomleft: 1ex;
  157. border-top-left-radius: 1ex;
  158. border-bottom-left-radius: 1ex;
  159. }
  160. input.round,
  161. input.roundRight,
  162. button.round,
  163. button.roundRight,
  164. .Button.round,
  165. .Button.roundRight{
  166. -webkit-border-top-right-radius: 1ex;
  167. -webkit-border-bottom-right-radius: 1ex;
  168. -moz-border-radius-topright: 1ex;
  169. -moz-border-radius-bottomright: 1ex;
  170. border-top-right-radius: 1ex;
  171. border-bottom-right-radius: 1ex;
  172. }