You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

406 lines
8.1 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. /*
  2. * # Semantic - Input
  3. * http://github.com/semantic-org/semantic-ui/
  4. *
  5. *
  6. * Copyright 2014 Contributor
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. */
  11. /*******************************
  12. Theme
  13. *******************************/
  14. @type : 'element';
  15. @element : 'input';
  16. @import '../../semantic.config';
  17. /*******************************
  18. Standard
  19. *******************************/
  20. /*--------------------
  21. Inputs
  22. ---------------------*/
  23. .ui.input {
  24. display: inline-block;
  25. position: relative;
  26. color: @inputColor;
  27. }
  28. .ui.input input {
  29. margin: 0em;
  30. width: 100%;
  31. outline: none;
  32. text-align: @textAlign;
  33. line-height: @lineHeight;
  34. font-family: @pageFont;
  35. padding: @padding;
  36. background: @background;
  37. border: @border;
  38. color: @inputColor;
  39. border-radius: @borderRadius;
  40. transition: @transition;
  41. box-shadow: @boxShadow;
  42. box-sizing: border-box;
  43. -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
  44. }
  45. /*--------------------
  46. Placeholder
  47. ---------------------*/
  48. /* browsers require these rules separate */
  49. .ui.input input::-webkit-input-placeholder {
  50. color: @placeholderColor;
  51. }
  52. .ui.input input::-moz-placeholder {
  53. color: @placeholderColor;
  54. }
  55. /*******************************
  56. States
  57. *******************************/
  58. /*--------------------
  59. Active
  60. ---------------------*/
  61. .ui.input input:active,
  62. .ui.input.down input {
  63. border-color: @downBorderColor;
  64. background: @downBackground;
  65. color: @downColor;
  66. box-shadow: @downBoxShadow;
  67. }
  68. /*--------------------
  69. Loading
  70. ---------------------*/
  71. .ui.loading.input > .icon {
  72. background: url(@loadingImage) no-repeat 50% 50%;
  73. }
  74. .ui.loading.input > .icon:before,
  75. .ui.loading.input > .icon:after {
  76. display: none;
  77. }
  78. /*--------------------
  79. Focus
  80. ---------------------*/
  81. .ui.input.focus input,
  82. .ui.input input:focus {
  83. border-color: @focusBorderColor;
  84. background: @focusBackground;
  85. color: @focusColor;
  86. box-shadow: @focusBoxShadow;
  87. }
  88. .ui.input.focus input input::-webkit-input-placeholder,
  89. .ui.input input:focus input::-webkit-input-placeholder {
  90. color: @placeholderFocusColor;
  91. }
  92. .ui.input.focus input input::-moz-placeholder,
  93. .ui.input input:focus input::-moz-placeholder {
  94. color: @placeholderFocusColor;
  95. }
  96. /*--------------------
  97. Error
  98. ---------------------*/
  99. .ui.input.error input {
  100. background-color: @errorBackground;
  101. border-color: @errorBorder;
  102. color: @errorColor;
  103. box-shadow: @errorBoxShadow;
  104. }
  105. /* Error Placeholder */
  106. .ui.input.error input ::-webkit-input-placeholder {
  107. color: @placeholderErrorColor;
  108. }
  109. .ui.input.error input ::-moz-placeholder {
  110. color: @placeholderErrorColor;
  111. }
  112. /* Focused Error Placeholder */
  113. .ui.input.error input :focus::-webkit-input-placeholder {
  114. color: @placeholderErrorFocusColor;
  115. }
  116. .ui.input.error input :focus::-moz-placeholder {
  117. color: @placeholderErrorFocusColor;
  118. }
  119. /*******************************
  120. Variations
  121. *******************************/
  122. /*--------------------
  123. Transparent
  124. ---------------------*/
  125. .ui.transparent.input input {
  126. border-color: transparent;
  127. background-color: transparent;
  128. padding: 0em;
  129. }
  130. /*--------------------
  131. Icon
  132. ---------------------*/
  133. .ui.icon.input > .icon {
  134. cursor: default;
  135. position: absolute;
  136. opacity: @iconOpacity;
  137. top: 0px;
  138. right: 0px;
  139. margin: 0em;
  140. width: @iconWidth;
  141. height: 100%;
  142. text-align: center;
  143. border-radius: 0em @borderRadius @borderRadius 0em;
  144. box-sizing: border-box;
  145. transition: @iconTransition;
  146. }
  147. .ui.icon.input > .icon:before,
  148. .ui.icon.input > .icon:after {
  149. left: 0;
  150. position: absolute;
  151. text-align: center;
  152. top: 50%;
  153. width: 100%;
  154. margin-top: @iconOffset;
  155. }
  156. .ui.icon.input > .link.icon {
  157. cursor: pointer;
  158. }
  159. .ui.icon.input input {
  160. padding-right: @iconMargin !important;
  161. }
  162. .ui.icon.input > .circular.icon {
  163. top: @circularIconVerticalOffset;
  164. right: @circularIconHorizontalOffset;
  165. }
  166. /* Left Icon Input */
  167. .ui[class*="left icon"].input > .icon {
  168. right: auto;
  169. left: @borderWidth;
  170. border-radius: @borderRadius 0em 0em @borderRadius;
  171. }
  172. .ui[class*="left icon"].input > .circular.icon {
  173. right: auto;
  174. left: @circularIconHorizontalOffset;
  175. }
  176. .ui[class*="left icon"].input > input {
  177. padding-left: @iconMargin !important;
  178. padding-right: @horizontalPadding !important;
  179. }
  180. /* Transparent Icon */
  181. .ui.transparent.icon.input > .icon {
  182. width: @transparentIconWidth;
  183. }
  184. .ui.transparent.icon.input > input {
  185. padding-left: 0em !important;
  186. padding-right: @transparentIconMargin !important;
  187. }
  188. .ui.transparent[class*="left icon"].input > input {
  189. padding-left: 0em !important;
  190. padding-left: @transparentIconMargin !important;
  191. }
  192. /* Focus */
  193. .ui.icon.input > input:focus ~ .icon {
  194. opacity: 1;
  195. }
  196. /*--------------------
  197. Labeled
  198. ---------------------*/
  199. /* Adjacent Label */
  200. .ui.labeled.input {
  201. display: table;
  202. }
  203. .ui.labeled.input > input {
  204. display: table-cell;
  205. vertical-align: top;
  206. }
  207. .ui.labeled.input > .label {
  208. display: table-cell;
  209. vertical-align: middle;
  210. white-space: nowrap;
  211. font-size: 1em;
  212. }
  213. .ui.labeled.input > .label > .icon {
  214. display: inline;
  215. vertical-align: top;
  216. }
  217. /* Fluid Labeled */
  218. .ui.fluid.labeled.input {
  219. display: table;
  220. width: 100%;
  221. }
  222. .ui.fluid.labeled.input > .label {
  223. width: 0.01%;
  224. }
  225. /* Label on Left */
  226. .ui.labeled.input:not([class*="corner labeled"]):not([class*="right labeled"]) > input {
  227. border-left: none;
  228. border-top-left-radius: 0px;
  229. border-bottom-left-radius: 0px;
  230. }
  231. .ui.labeled.input:not([class*="corner labeled"]):not([class*="right labeled"]) > .label {
  232. border-top-right-radius: 0px;
  233. border-bottom-right-radius: 0px;
  234. }
  235. /* Label on Right */
  236. .ui[class*="right labeled"].input > input {
  237. border-right: none;
  238. border-top-right-radius: 0px !important;
  239. border-bottom-right-radius: 0px !important;
  240. }
  241. .ui[class*="right labeled"].input > .label {
  242. border-top-left-radius: 0px;
  243. border-bottom-left-radius: 0px;
  244. }
  245. /* Corner Label */
  246. .ui.labeled.input .corner.label {
  247. top: @labelCornerTop;
  248. right: @labelCornerRight;
  249. font-size: @labelCornerSize;
  250. border-radius: 0em @borderRadius 0em 0em;
  251. }
  252. .ui.labeled.input input {
  253. padding-right: @labeledMargin !important;
  254. }
  255. /* Spacing with corner label */
  256. .ui[class*="corner labeled"].input {
  257. display: inline-block;
  258. }
  259. .ui[class*="corner labeled"].input > input {
  260. display: block;
  261. }
  262. .ui[class*="corner labeled"].icon.input:not(.left) > input {
  263. padding-right: @labeledIconInputMargin !important;
  264. }
  265. .ui[class*="corner labeled"].icon.input:not(.left) > .icon {
  266. margin-right: @labeledIconMargin;
  267. }
  268. /*--------------------
  269. Action
  270. ---------------------*/
  271. .ui.action.input {
  272. display: table;
  273. }
  274. .ui.action.input > input {
  275. display: table-cell;
  276. vertical-align: top;
  277. }
  278. .ui.action.input > .button,
  279. .ui.action.input > .buttons {
  280. display: table-cell;
  281. vertical-align: middle;
  282. white-space: nowrap;
  283. }
  284. .ui.action.input > .button > .icon,
  285. .ui.action.input > .buttons > .button > .icon {
  286. display: inline;
  287. vertical-align: top;
  288. }
  289. .ui.fluid.action.input {
  290. display: table;
  291. width: 100%;
  292. }
  293. .ui.fluid.action.input > .button {
  294. width: 0.01%;
  295. }
  296. /* Button on Right */
  297. .ui.action.input:not([class*="left action"]) > input {
  298. border-right: none;
  299. border-top-right-radius: 0px !important;
  300. border-bottom-right-radius: 0px !important;
  301. }
  302. .ui.action.input:not([class*="left action"]) > .button,
  303. .ui.action.input:not([class*="left action"]) > .buttons {
  304. border-top-left-radius: 0px;
  305. border-bottom-left-radius: 0px;
  306. }
  307. /* Button on Left */
  308. .ui[class*="left action"].input > .button,
  309. .ui[class*="left action"].input > .buttons {
  310. border-top-right-radius: 0px;
  311. border-bottom-right-radius: 0px;
  312. }
  313. .ui[class*="left action"].input > input {
  314. border-left: none;
  315. border-top-left-radius: 0px;
  316. border-bottom-left-radius: 0px;
  317. }
  318. /*--------------------
  319. Fluid
  320. ---------------------*/
  321. .ui.fluid.input {
  322. display: block;
  323. }
  324. /*--------------------
  325. Size
  326. ---------------------*/
  327. .ui.mini.input {
  328. font-size: 0.8125em;
  329. }
  330. .ui.small.input {
  331. font-size: 0.875em;
  332. }
  333. .ui.input {
  334. font-size: 1em;
  335. }
  336. .ui.large.input {
  337. font-size: 1.125em;
  338. }
  339. .ui.big.input {
  340. font-size: 1.25em;
  341. }
  342. .ui.huge.input {
  343. font-size: 1.375em;
  344. }
  345. .ui.massive.input {
  346. font-size: 1.5rem;
  347. }
  348. .loadUIOverrides();