form.less 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. //some extra form variables
  2. //more important ones are inside "variables.less"
  3. @input-placeholder-color:#C0C0C0;
  4. @input-readonly-color:#939192;
  5. @input-readonly-bg:#F5F5F5;
  6. @input-readonly-focus-border:#AAA;
  7. @input-readonly-focus-bg:#F9F9F9;
  8. @input-readonly-focus-shadow:~"0px 0px 0px 2px rgba(150, 150, 150, 0.3)";
  9. @input-disabled-color:#848484;
  10. @input-disabled-bg:#EEE;
  11. @input-hover-border:lighten(greyscale(@input-border-focus),10%);
  12. @option-hover-bg: #EEE;//desaturate(darken(#EEF5FA , 1%) , 4%);
  13. //form error states
  14. @success-state-border:lighten(#92BF65 , 4%);
  15. @success-state-color:#8BAD4C;
  16. @success-state-focus-border: darken(#81A85A , 4%);
  17. @success-state-focus-color:darken(@success-state-color, 10%);
  18. @success-state-focus-shadow:~"0px 0px 0px 2px rgba(130, 188, 58, 0.3)";
  19. @success-state-text-color:#7BA065;//the color of the help text, etc inside that control label
  20. @success-state-background-color: lighten(@success-state-border , 34.5%);
  21. @error-state-border:lighten(#F09784 , 4%);
  22. @error-state-color:#D68273;
  23. @error-state-focus-border: darken(#DB8978 , 4%);
  24. @error-state-focus-color:darken(@error-state-color, 10%);
  25. @error-state-focus-shadow:~"0px 0px 0px 2px rgba(219, 137, 120, 0.3)";
  26. @error-state-text-color:#D16E6C;
  27. @error-state-background-color: lighten(@error-state-border , 21.5%);
  28. @warning-state-border:lighten(#E0C43A , 4%);
  29. @warning-state-color: #D3BD50;
  30. @warning-state-focus-border: darken(#D8BC41 , 4%);
  31. @warning-state-focus-color: darken(@warning-state-color, 10%);
  32. @warning-state-focus-shadow:~"0px 0px 0px 2px rgba(216, 188, 65, 0.3)";
  33. @warning-state-text-color:#D19D59;
  34. @warning-state-background-color: lighten(@warning-state-border , 38%);
  35. @info-state-border:lighten(#64A6BC , 4%);
  36. @info-state-color:#4B89AA;
  37. @info-state-focus-border: darken(#64A6BC , 10%);
  38. @info-state-focus-color: darken(@info-state-color, 10%);
  39. @info-state-focus-shadow:~"0px 0px 0px 2px rgba(58, 120, 188, 0.3)";
  40. @info-state-text-color:#657BA0;
  41. @info-state-background-color: lighten(@info-state-border , 35.5%);
  42. @disabled-state-color:#848484;
  43. @disabled-state-bg:#EEE;
  44. //form elements
  45. .form-line {
  46. margin-bottom:24px; padding-bottom:12px;
  47. border-bottom:1px solid #EEE;
  48. }
  49. .form-actions {
  50. display:block;
  51. background-color: #F5F5F5;
  52. border-top: 1px solid #E5E5E5;
  53. margin-bottom: 20px;
  54. margin-top: 20px;
  55. padding: 19px 20px 20px;
  56. }
  57. .help-button {
  58. display: inline-block;
  59. height: 22px;
  60. width: 22px;
  61. line-height: 22px;
  62. text-align: center;
  63. padding: 0;
  64. background-color: @help-button-bg;
  65. color: #FFF;
  66. font-size: @font-size-help-button;
  67. font-weight: bold;
  68. cursor: default;
  69. margin-left: 4px;
  70. .border-radius(100%);
  71. border-color: #FFF;
  72. border: 2px solid #FFF;
  73. .box-shadow(~"0px 1px 0px 1px rgba(0, 0, 0, 0.2)");
  74. &:hover {
  75. background-color: @help-button-bg;
  76. text-shadow: none;
  77. }
  78. }
  79. label {
  80. font-weight: normal;
  81. font-size: @font-size-label;
  82. }
  83. .form-group > label[class*="col-"] {
  84. //padding-top: 4px;
  85. margin-bottom: 4px;
  86. }
  87. //label , .lbl {
  88. //vertical-align: middle;
  89. //}
  90. td > label , th > label
  91. {
  92. margin-bottom: 0;
  93. line-height: inherit;
  94. vertical-align: middle;
  95. }
  96. label.inline {
  97. margin-bottom: 3px;
  98. }
  99. textarea,
  100. input[type="text"],
  101. input[type="password"],
  102. input[type="datetime"],
  103. input[type="datetime-local"],
  104. input[type="date"],
  105. input[type="month"],
  106. input[type="time"],
  107. input[type="week"],
  108. input[type="number"],
  109. input[type="email"],
  110. input[type="url"],
  111. input[type="search"],
  112. input[type="tel"],
  113. input[type="color"] {
  114. .border-radius(0) !important;
  115. color: @input-color;
  116. background-color: @input-background;
  117. border: 1px solid @input-border;
  118. padding: 5px 4px 6px;
  119. //line-height: 1.3;
  120. font-size: @font-size-text-input;
  121. font-family: inherit;
  122. .box-shadow(none) !important;
  123. .transition-duration(0.1s);
  124. &:hover {
  125. border-color: @input-hover-border;
  126. }
  127. &:focus {
  128. //.box-shadow(@input-shadow-focus);
  129. .box-shadow(none);
  130. color: @input-color-focus;
  131. border-color: @input-border-focus;
  132. background-color: @input-background-focus;
  133. outline: none;
  134. }
  135. }
  136. input::-webkit-input-placeholder, .form-control::-webkit-input-placeholder {
  137. color: @input-placeholder-color;
  138. }
  139. input:-moz-placeholder, .form-control:-moz-placeholder { //FF 4 - 18
  140. color: @input-placeholder-color;
  141. opacity: 1;
  142. }
  143. input::-moz-placeholder, .form-control::-moz-placeholder { //FF 19+
  144. color: @input-placeholder-color;
  145. opacity: 1;
  146. }
  147. input:-ms-input-placeholder, .form-control:-ms-input-placeholder { //IE 10+
  148. color: @input-placeholder-color;
  149. }
  150. .form-control , select {
  151. //line-height: 1;
  152. border-radius : 0;
  153. .box-shadow(none) !important;
  154. color: @input-color;
  155. background-color: @input-background;
  156. border:1px solid @input-border;
  157. &:focus {
  158. color: @input-color-focus;
  159. border-color: @input-border-focus;
  160. background-color: @input-background-focus;
  161. outline:none;
  162. }
  163. }
  164. textarea.form-control {
  165. padding:5px 9px
  166. }
  167. select {
  168. padding:3px 4px;
  169. height: 30px;
  170. }
  171. select.form-control {
  172. padding:4px 6px;
  173. //height: 32px;
  174. }
  175. select[multiple] , select.form-control[multiple] {
  176. height: auto;
  177. }
  178. select.input-sm {
  179. border-radius: 0;
  180. padding: 2px 3px;
  181. }
  182. select.input-lg {
  183. border-radius: 0;
  184. padding: 6px 8px;
  185. }
  186. input.block {
  187. display:block;
  188. margin-bottom:9px;
  189. }
  190. textarea.autosize-transition {
  191. .transition-duration("height 0.2s");
  192. }
  193. .limiterBox {
  194. border: 1px solid #222;
  195. border-top: none;
  196. background-color: #333;
  197. padding: 3px 6px;
  198. font-size: @base-font-size;
  199. color:#FFF;
  200. margin-top:6px;
  201. &:after {
  202. display:none;
  203. }
  204. &:before {
  205. display:block;
  206. content:"";
  207. position: absolute;
  208. width: 0; height: 0;
  209. top: -8px;
  210. left: 50%;
  211. margin-left: -5px;
  212. border-color: transparent;
  213. border-style: solid;
  214. border-bottom-color: #333;
  215. -moz-border-bottom-colors: #333;
  216. border-width: 0 8px 8px;
  217. }
  218. }
  219. select {
  220. & , &.form-control {
  221. option {
  222. padding: 3px 4px 5px;
  223. &:active , &:hover, &:focus {
  224. background-color: @option-hover-bg;
  225. color: #444;
  226. }
  227. &.no-option {
  228. padding: 1px 0;
  229. }
  230. }
  231. }
  232. }
  233. input[disabled] {
  234. color: @input-disabled-color !important;
  235. background-color: @input-disabled-bg !important;
  236. &:hover {
  237. border-color: @input-border !important;
  238. }
  239. }
  240. input[readonly] {
  241. color: @input-readonly-color;
  242. background: @input-readonly-bg !important;
  243. cursor:default;
  244. &:hover {
  245. border-color:lighten(@input-readonly-focus-border , 10%);
  246. }
  247. &:focus {
  248. //.box-shadow(@input-readonly-focus-shadow);
  249. .box-shadow(none);
  250. border-color: @input-readonly-focus-border;
  251. background-color: @input-readonly-focus-bg;
  252. }
  253. }
  254. .help-inline {
  255. font-size: @font-size-help-inline !important;
  256. }
  257. .input-icon {
  258. position:relative;
  259. span& {
  260. display:inline-block;
  261. }
  262. > input {
  263. padding-left:24px;
  264. padding-right:6px;
  265. }
  266. &.input-icon-right > input {
  267. padding-left:6px;
  268. padding-right:24px;
  269. }
  270. > .@{icon} {
  271. padding: 0 3px;
  272. z-index: 2;
  273. position: absolute;
  274. top: 1px;
  275. bottom: 1px;
  276. left: 3px;
  277. line-height: 30px;
  278. display: inline-block;
  279. color: #909090;
  280. font-size: @font-size-input-icon;
  281. }
  282. &.input-icon-right > .@{icon} {
  283. left:auto;
  284. right:3px;
  285. }
  286. > input:focus + .@{icon} {
  287. color:#579;
  288. }
  289. ~ .help-inline {
  290. padding-left:8px;
  291. }
  292. //.form-group.has-warning & > .@{icon} { color: @warning-state-color; }
  293. //.form-group.has-success & > .@{icon} { color: @success-state-color; }
  294. //.form-group.has-error & > .@{icon} { color: @error-state-color; }
  295. //.form-group.has-info & > .@{icon} { color: @info-state-color; }
  296. }
  297. //checkboxes , radio and switches
  298. .form-search , .form-inline {
  299. .radio [type=radio] + label, .checkbox [type=checkbox] + label {
  300. float: left;
  301. margin-left: -20px;
  302. .form-search & , .form-inline & {
  303. margin-left:0;
  304. margin-right:3px;
  305. }
  306. }
  307. }
  308. .input-append , .input-prepend {
  309. .form-search & .search-query:focus {
  310. .box-shadow(none);
  311. }
  312. input, select, .uneditable-input {
  313. .border-radius(0);
  314. }
  315. }
  316. .input-mini {
  317. width: 60px;
  318. max-width: 100%;
  319. }
  320. .input-small {
  321. width: 90px;
  322. max-width: 100%;
  323. }
  324. .input-medium , .input-md {
  325. width: 150px;
  326. max-width: 100%;
  327. }
  328. .input-large {
  329. width: 210px;
  330. max-width: 100%;
  331. }
  332. .input-xlarge {
  333. width: 270px;
  334. max-width: 100%;
  335. }
  336. .input-xxlarge {
  337. width: 530px;
  338. max-width: 100%;
  339. }
  340. input.input-lg {
  341. font-size: @font-size-large;
  342. }
  343. @import "form/checkbox.less";
  344. @import "form/file.less";
  345. //addon
  346. .input-group {
  347. .input-group-addon {
  348. .border-radius(0) !important;
  349. .form-group.has-success & {
  350. border-color: @success-state-border;
  351. }
  352. .form-group.has-error & {
  353. border-color: @error-state-border;
  354. }
  355. .form-group.has-warning & {
  356. border-color: @warning-state-border;
  357. }
  358. .form-group.has-info & {
  359. border-color: @info-state-border;
  360. }
  361. }
  362. > .btn {
  363. line-height:20px;
  364. padding:0 6px;
  365. .border-radius(0) !important;
  366. &.btn-sm {
  367. line-height:22px;
  368. }
  369. + .btn{
  370. margin-left:1px;
  371. }
  372. }
  373. > .btn-group > .btn {
  374. line-height:23px;
  375. &.btn-sm {
  376. line-height:26px;
  377. }
  378. }
  379. > .btn , > .btn-group > .btn {
  380. & , &.btn-sm {
  381. > .caret {
  382. margin-top:10px;
  383. }
  384. }
  385. }
  386. }
  387. .input-group.input-group-compact {
  388. width: 1px;
  389. }
  390. //input error states
  391. .form-group select,
  392. .form-group textarea,
  393. .form-group input[type="text"],
  394. .form-group input[type="password"],
  395. .form-group input[type="datetime"],
  396. .form-group input[type="datetime-local"],
  397. .form-group input[type="date"],
  398. .form-group input[type="month"],
  399. .form-group input[type="time"],
  400. .form-group input[type="week"],
  401. .form-group input[type="number"],
  402. .form-group input[type="email"],
  403. .form-group input[type="url"],
  404. .form-group input[type="search"],
  405. .form-group input[type="tel"],
  406. .form-group input[type="color"] {
  407. background:#FFF;
  408. }
  409. .form-group.has-success {
  410. input, select, textarea {
  411. border-color: @success-state-border;
  412. color: @success-state-color;
  413. .box-shadow(none);
  414. &:focus {
  415. .box-shadow(@success-state-focus-shadow);
  416. color: @success-state-focus-color;
  417. border-color: @success-state-focus-border;
  418. background-color: @success-state-background-color;
  419. + .@{icon} {
  420. color: @success-state-color;
  421. }
  422. }
  423. }
  424. .@{icon} {
  425. color: @success-state-color;
  426. }
  427. .btn .@{icon} {
  428. color: inherit;
  429. }
  430. .control-label , .help-block , .help-inline {
  431. color: @success-state-text-color;
  432. }
  433. }
  434. .form-group.has-info {
  435. input , select, textarea {
  436. border-color: @info-state-border;
  437. color: @info-state-color;
  438. .box-shadow(none);
  439. &:focus {
  440. .box-shadow(@info-state-focus-shadow);
  441. color: @info-state-focus-color;
  442. border-color: @info-state-focus-border;
  443. background-color: @info-state-background-color;
  444. + .@{icon} {
  445. color: @info-state-color;
  446. }
  447. }
  448. }
  449. .@{icon} {
  450. color: @info-state-color;
  451. }
  452. .btn .@{icon} {
  453. color: inherit;
  454. }
  455. .control-label , .help-block , .help-inline {
  456. color: @info-state-text-color;
  457. }
  458. }
  459. .form-group.has-error {
  460. input , select, textarea {
  461. border-color: @error-state-border;
  462. color: @error-state-color;
  463. .box-shadow(none);
  464. &:focus {
  465. .box-shadow(@error-state-focus-shadow);
  466. color: @error-state-focus-color;
  467. border-color: @error-state-focus-border;
  468. background-color: @error-state-background-color;
  469. + .@{icon} {
  470. color: @error-state-color;
  471. }
  472. }
  473. }
  474. .@{icon} {
  475. color: @error-state-color;
  476. }
  477. .btn .@{icon} {
  478. color: inherit;
  479. }
  480. .control-label , .help-block , .help-inline {
  481. color: @error-state-text-color;
  482. }
  483. }
  484. .form-group.has-warning {
  485. input , select, textarea {
  486. border-color: @warning-state-border;
  487. color: @warning-state-color;
  488. .box-shadow(none);
  489. &:focus {
  490. .box-shadow(@warning-state-focus-shadow);
  491. color: @warning-state-focus-color;
  492. border-color: @warning-state-focus-border;
  493. background-color: @warning-state-background-color;
  494. + .@{icon} {
  495. color: @warning-state-color;
  496. }
  497. }
  498. }
  499. .@{icon} {
  500. color: @warning-state-color;
  501. }
  502. .btn .@{icon} {
  503. color: inherit;
  504. }
  505. .control-label , .help-block , .help-inline {
  506. color: @warning-state-text-color;
  507. }
  508. }
  509. .form-group input{
  510. &[disabled] , &:disabled{
  511. color: @disabled-state-color !important;
  512. background-color: @disabled-state-bg !important;
  513. }
  514. }
  515. @media only screen and (max-width: @screen-xs-max) {
  516. .help-inline , .input-icon + .help-inline {
  517. padding-left: 0;
  518. display: block !important;
  519. }
  520. }