toolkit.less 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. // other solution : http://stackoverflow.com/questions/1577598/how-to-hide-parts-of-html-when-javascript-is-disabled/13857783#13857783
  2. html.no-js .hide_if_nojs {
  3. display: none;
  4. }
  5. html.js .show_if_nojs {
  6. display: none;
  7. }
  8. .center {
  9. text-align: center;
  10. }
  11. .right {
  12. float: right ;
  13. }
  14. .left {
  15. float: left;
  16. }
  17. .invisible {
  18. display: none;
  19. }
  20. .danger {
  21. background-color: @color-error-background;
  22. }
  23. .badge {
  24. display: inline-block;
  25. color: #fff;
  26. background-color: #777;
  27. text-align: center;
  28. white-space: nowrap;
  29. vertical-align: baseline;
  30. min-width: 10px;
  31. padding: 1px 5px;
  32. border-radius: 5px;
  33. }
  34. // table
  35. table {
  36. width: 100%;
  37. &.striped {
  38. tr {
  39. border-bottom: 1px solid @color-settings-tr-hover;
  40. }
  41. }
  42. }
  43. th {
  44. padding: 0.4em;
  45. }
  46. td {
  47. padding: 0 4px;
  48. }
  49. tr {
  50. &:hover {
  51. background: @color-settings-tr-hover;
  52. }
  53. }
  54. // dialog
  55. .dialog() {
  56. position: relative;
  57. width: 70%;
  58. padding: 1em 1em 1em 2.7em;
  59. margin: 0em 8% 1em 8%;
  60. border: 1px solid black;
  61. border-radius: 4px;
  62. text-align: left;
  63. &:before {
  64. position: absolute;
  65. top: 0.5em;
  66. left: 0.5em;
  67. font-family:"ion";
  68. font-size: 1.5em;
  69. }
  70. .close {
  71. float:right;
  72. position: relative;
  73. top: -3px;
  74. color: inherit;
  75. font-size: 1.5em;
  76. }
  77. ul, ol, p {
  78. margin: 1px 0 0 0;
  79. }
  80. }
  81. .dialog-error {
  82. .dialog();
  83. color: @color-error;
  84. background: @color-error-background;
  85. border-color: @color-error;
  86. .ion-error();
  87. }
  88. .dialog-warning {
  89. .dialog();
  90. color: @color-warning;
  91. background: @color-warning-background;
  92. border-color: @color-warning;
  93. .ion-warning();
  94. }
  95. // btn-collapse
  96. .btn-collapse {
  97. cursor: pointer;
  98. }
  99. //
  100. .scrollx {
  101. overflow-x: auto;
  102. overflow-y: hidden;
  103. display: block;
  104. padding: 0;
  105. margin: 0;
  106. border: none;
  107. }
  108. // tabs
  109. .tabs .tabs > label {
  110. font-size: 90%;
  111. }
  112. .tabs {
  113. .flexbox();
  114. flex-wrap: wrap;
  115. width: 100%;
  116. min-width: 100%;
  117. & > * {
  118. order: 2;
  119. }
  120. & > input[type=radio] {
  121. display: none;
  122. }
  123. & > label {
  124. order: 1;
  125. padding: 0.7em;
  126. margin: 0 0.7em;
  127. letter-spacing:0.5px;
  128. text-transform: uppercase;
  129. border: solid white;
  130. border-width: 0px 0px 2px 0;
  131. .disable-user-select();
  132. cursor: pointer;
  133. }
  134. & > label:hover {
  135. border-bottom: 2px solid @color-categories-item-border-selected;
  136. }
  137. & > section {
  138. min-width: 100%;
  139. padding: 0.7rem 0;
  140. box-sizing: border-box;
  141. border-top: 1px solid black;
  142. display: none;
  143. }
  144. // default selection
  145. & > label:last-of-type {
  146. border-bottom: 2px solid @color-categories-item-border-selected;
  147. background: @color-categories-item-selected;
  148. color: @color-categories-item-selected-font;
  149. font-weight: bold;
  150. letter-spacing:-0.1px;
  151. }
  152. & > section:last-of-type {
  153. display: block;
  154. }
  155. }
  156. html body .tabs > input:checked {
  157. ~ section {
  158. display: none;
  159. }
  160. ~ label {
  161. position: inherited;
  162. background: inherit;
  163. border-bottom: 2px solid transparent;
  164. font-weight: normal;
  165. color: inherit;
  166. &:hover {
  167. border-bottom: 2px solid @color-categories-item-border-selected;
  168. }
  169. }
  170. + label {
  171. border-bottom: 2px solid @color-categories-item-border-selected;
  172. background: @color-categories-item-selected;
  173. color: @color-categories-item-selected-font;
  174. font-weight: bold;
  175. letter-spacing:-0.1px;
  176. }
  177. + label + section {
  178. display: block;
  179. }
  180. }
  181. // select
  182. select {
  183. height: 28px;
  184. margin: 0 1em 0 0;
  185. padding: 2px 8px 2px 0 !important;
  186. color: @color-search-font;
  187. font-size: 12px;
  188. z-index: 2;
  189. &:hover, &:focus {
  190. cursor: pointer;
  191. }
  192. }
  193. @supports ((background-position-x: 100%) and ((appearance: none) or (-webkit-appearance: none) or (-moz-appearance: none))) {
  194. select {
  195. appearance: none;
  196. -webkit-appearance: none;
  197. -moz-appearance: none;
  198. border: none;
  199. border-bottom: 1px solid #d7d7d7;
  200. background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI1MTJweCIgaGVpZ2h0PSI1MTJweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUxMiA1MTIiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwb2x5Z29uIHBvaW50cz0iMTI4LDE5MiAyNTYsMzIwIDM4NCwxOTIiLz48L2c+PC9zdmc+Cg==) no-repeat;
  201. background-position-x: 105%;
  202. background-size: 2em;
  203. background-origin: content-box;
  204. outline: medium none;
  205. &:hover, &:focus {
  206. border-bottom: 1px solid @color-search-border;
  207. }
  208. }
  209. }
  210. // checkbox-onoff
  211. @supports (border-radius: 50px) {
  212. .checkbox-onoff {
  213. display: inline-block;
  214. width: 40px;
  215. height: 10px;
  216. background: #dcdcdc;
  217. margin: 8px auto;
  218. position: relative;
  219. border-radius: 50px;
  220. label {
  221. display: block;
  222. width: 20px;
  223. height: 20px;
  224. position: absolute;
  225. top: -5px;
  226. cursor: pointer;
  227. border-radius: 50px;
  228. box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.3);
  229. transition: all 0.4s ease;
  230. left: 27px;
  231. background-color: #3498DB;
  232. }
  233. input[type=checkbox] {
  234. visibility: hidden;
  235. &:checked + label {
  236. left: -5px;
  237. background: #dcdcdc;
  238. }
  239. }
  240. }
  241. }
  242. // checkbox
  243. @supports (transform: rotate(-45deg)) {
  244. .checkbox {
  245. width: 20px;
  246. position: relative;
  247. margin: 20px auto;
  248. label {
  249. width: 20px;
  250. height: 20px;
  251. cursor: pointer;
  252. position: absolute;
  253. top: 0;
  254. left: 0;
  255. background: white;
  256. border-radius: 4px;
  257. box-shadow: inset 0px 1px 1px white, 0px 1px 4px rgba(0,0,0,0.5);
  258. &:after {
  259. content: '';
  260. width: 9px;
  261. height: 5px;
  262. position: absolute;
  263. top: 4px;
  264. left: 4px;
  265. border: 3px solid #333;
  266. border-top: none;
  267. border-right: none;
  268. background: transparent;
  269. opacity: 0;
  270. transform: rotate(-45deg);
  271. }
  272. }
  273. input[type=checkbox] {
  274. visibility: hidden;
  275. &:checked + label:after {
  276. border-color: #3498DB;
  277. opacity: 1;
  278. }
  279. }
  280. // disabled : can't be focused, show only the check mark
  281. input[disabled] + label {
  282. background-color: transparent !important;
  283. box-shadow: none !important;
  284. cursor: inherit;;
  285. }
  286. // if not checked and possible to checked then display a "light" check mark on hover
  287. input:not(:checked):not([readonly]):not([disabled]) + label:hover::after {
  288. opacity: 0.5;
  289. }
  290. }
  291. }
  292. @media screen and (max-width: 50em) {
  293. .tabs > label {
  294. width: 100%;
  295. }
  296. }