widget.less 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. .enable_widgets() when(@enable-widgets = true) {
  2. //widget boxes
  3. .widget-box {
  4. padding: 0;
  5. .box-shadow(none);
  6. margin: 3px 0;
  7. border: 1px solid #CCC;
  8. //border-bottom-width: 2px;
  9. }
  10. @media only screen and (max-width: @screen-xs-max) {
  11. .widget-box {
  12. margin-top: 7px;
  13. margin-bottom: 7px;
  14. }
  15. }
  16. .widget-header {
  17. .box-sizing(content-box);
  18. position: relative;
  19. min-height: 38px;
  20. background: mix(#FFFFFF , #EEEEEE);
  21. #gradient > .vertical(#FFFFFF , #EEEEEE);
  22. color:@widget-header-color;
  23. border-bottom: 1px solid #DDD;
  24. padding-left: 12px;
  25. &:before, &:after {
  26. content: "";
  27. display: table;
  28. line-height: 0;
  29. }
  30. &:after {
  31. clear: right;
  32. }
  33. }
  34. .collapsed {
  35. //.widget-box& {border-bottom-width: 0px;}
  36. .widget-box& > .widget-header { border-bottom-width: 0; }
  37. &.fullscreen > .widget-header { border-bottom-width: 1px; }
  38. > .widget-body { display: none; }
  39. }
  40. .widget-header-flat {
  41. background: #F7F7F7;
  42. filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
  43. }
  44. .widget-header-large {
  45. min-height: 49px;
  46. padding-left: 18px;
  47. }
  48. .widget-header-small {
  49. min-height: 31px;
  50. padding-left: 10px;
  51. }
  52. .widget-header > .widget-title {
  53. line-height: 36px;
  54. padding: 0;
  55. margin: 0;
  56. display: inline;
  57. > .@{icon} {
  58. margin-right: 5px;
  59. font-weight: normal;
  60. display: inline-block;
  61. }
  62. }
  63. .widget-header-large > .widget-title {
  64. line-height: 48px;
  65. }
  66. .widget-header-small > .widget-title {
  67. line-height: 30px;
  68. }
  69. .widget-toolbar {
  70. display: inline-block;
  71. padding: 0 10px;
  72. line-height: 37px;
  73. float: right;
  74. position: relative;
  75. .widget-header-large > & {
  76. line-height:48px;
  77. }
  78. .widget-header-small > & {
  79. line-height:29px;
  80. }
  81. &.no-padding {
  82. padding:0;
  83. }
  84. &.padding-5 {
  85. padding:0 5px;
  86. }
  87. &:before {//border on left ot it!
  88. display:inline-block;
  89. content:"";
  90. position:absolute; top:3px; bottom:3px; left:-1px;
  91. border:1px solid #D9D9D9;
  92. border-width:0 1px 0 0;
  93. .widget-header-large > & {
  94. top:6px; bottom:6px;
  95. }
  96. [class*="widget-color-"] > .widget-header > & {
  97. border-color:#EEE;
  98. }
  99. .widget-color-orange > .widget-header > & {
  100. border-color:#FEA;
  101. }
  102. .widget-color-dark > .widget-header > & {
  103. border-color: #222;
  104. box-shadow: -1px 0 0 rgba(255, 255, 255, 0.2) , inset 1px 0 0 rgba(255, 255, 255, 0.1);
  105. }
  106. }
  107. &.no-border:before {
  108. display: none;
  109. }
  110. label {
  111. display: inline-block;
  112. vertical-align: middle;
  113. margin-bottom: 0;
  114. }
  115. //widget toolbar basic buttons
  116. > a , > .widget-menu > a {
  117. font-size: @font-size-widget-toolbar-icon;
  118. margin: 0 1px;
  119. display: inline-block;
  120. padding: 0;
  121. line-height: 24px;
  122. &:hover {
  123. text-decoration: none;
  124. }
  125. .widget-header-large > & {
  126. font-size: floor(@font-size-widget-toolbar-icon * 1.1);
  127. margin: 0 1px;
  128. }
  129. }
  130. //toolbar buttons
  131. > .btn {
  132. line-height:27px;
  133. margin-top:-2px;
  134. &.smaller { line-height:26px; }
  135. &.bigger { line-height:28px; }
  136. }
  137. > .btn-sm {
  138. line-height:24px;
  139. &.smaller { line-height:23px; }
  140. &.bigger { line-height:25px; }
  141. }
  142. > .btn-xs {
  143. line-height:22px;
  144. &.smaller { line-height:21px; }
  145. &.bigger { line-height:23px; }
  146. }
  147. > .btn-minier {
  148. line-height:18px;
  149. &.smaller { line-height:17px; }
  150. &.bigger { line-height:19px; }
  151. }
  152. > .btn-lg {
  153. line-height:36px;
  154. &.smaller { line-height:34px; }
  155. &.bigger { line-height:38px; }
  156. }
  157. }
  158. .widget-toolbar-dark {
  159. background: #444;
  160. }
  161. .widget-toolbar-light {
  162. background: rgba(255, 255, 255, 0.85);
  163. }
  164. //widget-toolbar buttons
  165. .widget-toolbar > .widget-menu {
  166. display: inline-block;
  167. position: relative;
  168. }
  169. .widget-toolbar > a[data-action] , .widget-toolbar > .widget-menu > a[data-action] {
  170. .transition(~"transform 0.1s");
  171. > .@{icon} {
  172. margin-right: 0;
  173. }
  174. &:focus {
  175. text-decoration: none;
  176. outline: none;
  177. }
  178. &:hover {
  179. .transform(~"scale(1.2)");
  180. }
  181. }
  182. .widget-body {
  183. background-color: #FFF;
  184. }
  185. .widget-main {
  186. padding: 12px;
  187. }
  188. .widget-main {
  189. .widget-paddingX (@index) when (@index >= 0) {
  190. &.padding-@{index} { padding:unit(@index,px); }
  191. .widget-paddingX(@index - 2);
  192. }
  193. .widget-paddingX(32);
  194. &.no-padding { padding:0; }
  195. }
  196. .widget-toolbar .progress {
  197. vertical-align: middle;
  198. display: inline-block;
  199. margin: 0;
  200. }
  201. //toolbar dropdowns
  202. .widget-toolbar > .dropdown , .widget-toolbar > .dropup {
  203. display: inline-block;
  204. }
  205. .widget-box , .widget-color-dark {
  206. > .widget-header > .widget-toolbar ,
  207. > .widget-header > .widget-toolbar > .widget-menu {
  208. > [data-action="settings"] {
  209. color: #99CADB;
  210. }
  211. > [data-action="reload"] {
  212. color: #ACD392;
  213. }
  214. > [data-action="collapse"] {
  215. color: #AAA;
  216. }
  217. > [data-action="close"] {
  218. color: #E09E96;
  219. }
  220. }
  221. }
  222. .enable_widget_colors() when(@enable-widget-colors = true) {
  223. // widget header colors
  224. .widget-box[class*="widget-color-"] > .widget-header {
  225. color: #FFF;
  226. filter: ~"progid:DXImageTransform.Microsoft.gradient(enabled=false)";
  227. }
  228. //widget color
  229. .widget-color(@color) {
  230. @widget-class:~`"widget-color-@{color}"`;
  231. @widget-bg:~`"widget-@{color}"`;
  232. @widget-cl:@@widget-bg;
  233. .@{widget-class} {
  234. border-color: @widget-cl;
  235. > .widget-header {
  236. background: @widget-cl;
  237. border-color: @widget-cl;
  238. }
  239. }
  240. }
  241. .widget-color(~"blue");
  242. .widget-color(~"blue2");
  243. .widget-color(~"blue3");
  244. .widget-color(~"green");
  245. .widget-color(~"green2");
  246. .widget-color(~"green3");
  247. .widget-color(~"red");
  248. .widget-color(~"red2");
  249. .widget-color(~"red3");
  250. .widget-color(~"purple");
  251. .widget-color(~"pink");
  252. .widget-color-orange {
  253. border-color:@widget-orange-border;
  254. > .widget-header {
  255. color:@widget-orange-txt !important;
  256. border-color:@widget-orange-border;
  257. background:@widget-orange;
  258. }
  259. }
  260. .widget-color-dark {
  261. border-color:lighten(@widget-dark, 10%);
  262. > .widget-header {
  263. border-color: lighten(@widget-dark, 15%);
  264. background: @widget-dark;
  265. }
  266. }
  267. .widget-color-grey {
  268. border-color: lighten(@widget-grey, 10%);
  269. > .widget-header {
  270. border-color:lighten(@widget-grey, 15%);
  271. background: @widget-grey;
  272. }
  273. }
  274. //transparent box
  275. .widget-box.transparent {
  276. border-width: 0;
  277. > .widget-header {
  278. background: none;
  279. filter: ~"progid:DXImageTransform.Microsoft.gradient(enabled=false)";
  280. border-width: 0;
  281. border-bottom: 1px solid #DCE8F1;
  282. color: #4383B4;
  283. padding-left: 3px;
  284. }
  285. > .widget-header-large {
  286. padding-left: 5px;
  287. }
  288. > .widget-header-small {
  289. padding-left: 1px;
  290. }
  291. > .widget-body {
  292. border-width: 0;
  293. background-color: transparent;
  294. }
  295. }
  296. [class*="widget-color-"] > .widget-header > .widget-toolbar ,
  297. [class*="widget-color-"] > .widget-header > .widget-toolbar > .widget-menu {
  298. > [data-action] {
  299. text-shadow: 0px 1px 1px rgba(0,0,0,0.2);
  300. }
  301. > [data-action="settings"] {
  302. color: #D3E4ED;
  303. }
  304. > [data-action="reload"] {
  305. color: #DEEAD3;
  306. }
  307. > [data-action="collapse"] {
  308. color: #E2E2E2;
  309. }
  310. > [data-action="close"] {
  311. color: #FFD9D5;
  312. }
  313. }
  314. .widget-color-orange > .widget-header > .widget-toolbar ,
  315. .widget-color-orange > .widget-header > .widget-toolbar > .widget-menu {
  316. > [data-action] {
  317. text-shadow: none;
  318. }
  319. > [data-action="settings"] {
  320. color: #559AAB;
  321. }
  322. > [data-action="reload"] {
  323. color: #7CA362;
  324. }
  325. > [data-action="collapse"] {
  326. color: #777;
  327. }
  328. > [data-action="close"] {
  329. color: #A05656;
  330. }
  331. }
  332. }
  333. .enable_widget_colors();
  334. //different borders
  335. .widget-box.light-border[class*="widget-color-"]:not(.fullscreen) {
  336. border-width: 0;
  337. > .widget-header {
  338. border: 1px solid;
  339. border-color: inherit;
  340. }
  341. > .widget-body {
  342. border: 1px solid;
  343. border-color: #D6D6D6;
  344. border-width: 0 1px 1px;
  345. }
  346. }
  347. .widget-box.no-border {
  348. border-width: 0;
  349. }
  350. .widget-box.fullscreen {
  351. position: fixed;
  352. margin: 0;
  353. top: 0;
  354. bottom: 0;
  355. left: 0;
  356. right: 0;
  357. background-color: #FFF;
  358. border-width: 3px;
  359. z-index: @zindex-navbar-fixed + 10 !important;//to override inline style from jquery ui draggable
  360. //-moz-backface-visibility: hidden;
  361. &:not([class*="widget-color-"]) {
  362. border-color: #AAA;
  363. }
  364. }
  365. //table in widget
  366. .widget-body .table {
  367. border-top: 1px solid #E5E5E5;
  368. thead:first-child tr {
  369. background: #FFF;
  370. [class*="widget-color-"] > & {
  371. background : mix(#F8F8F8 , #ECECEC);
  372. #gradient > .vertical(#F8F8F8 , #ECECEC);
  373. }
  374. }
  375. &.table-bordered thead:first-child > tr {
  376. border-top-width: 0;
  377. }
  378. }
  379. .widget-main.no-padding {
  380. .table {
  381. margin-bottom: 0;
  382. border-width: 0;
  383. }
  384. .table-bordered th:first-child,
  385. .table-bordered td:first-child {
  386. border-left-width: 0;
  387. }
  388. }
  389. .transparent > .widget-body .widget-main , .widget-main.no-padding {
  390. .table-bordered > thead > tr > th:last-child, .table-bordered > tbody > tr > td:last-child, .table-bordered > tfoot > tr > td:last-child {
  391. border-right-width: 0 !important;
  392. }
  393. }
  394. .transparent > .widget-body .widget-main , .widget-main.no-padding {
  395. .table-bordered > tbody > tr:last-child > td {
  396. border-bottom-width: 0 !important;
  397. }
  398. }
  399. .table-bordered > thead.thin-border-bottom > tr > th, .table-bordered > thead.thin-border-bottom > tr > td {
  400. border-bottom-width: 1px;
  401. }
  402. //elements in widget
  403. .widget-body .alert:last-child {
  404. margin-bottom: 0;
  405. }
  406. //tabs in widget
  407. .widget-main .tab-content {
  408. border-width: 0;
  409. }
  410. .widget-toolbar > .nav-tabs {
  411. border-bottom-width: 0;
  412. margin-bottom: 0;
  413. top: auto;
  414. margin-top: 3px !important;//to override .RTL's
  415. > li {
  416. margin-bottom: auto;
  417. }
  418. > li > a {
  419. box-shadow: none;
  420. position: relative;
  421. top: 1px;
  422. margin-top: 1px;
  423. }
  424. > li:not(.active) > a{
  425. border-color: transparent;
  426. background-color: transparent;
  427. &:hover {
  428. background-color: transparent;
  429. }
  430. }
  431. > li.active > a {
  432. background-color: #FFF;
  433. border-bottom-color: transparent;
  434. box-shadow: none;
  435. margin-top: auto;
  436. }
  437. .widget-header-small > & {
  438. > li > a {
  439. line-height:16px;
  440. padding-top:6px;
  441. padding-bottom:6px;
  442. }
  443. > li.active > a {
  444. border-top-width:2px;
  445. }
  446. }
  447. .widget-header-large > & {
  448. > li > a {
  449. line-height:22px;
  450. padding-top:9px;
  451. padding-bottom:9px;
  452. margin-top: 4px;
  453. }
  454. > li.active > a {
  455. margin-top: 3px;
  456. }
  457. }
  458. [class*="widget-color-"] > .widget-header > & {
  459. > li > a {
  460. border-color:transparent;
  461. background-color:transparent;
  462. color:#FFF;
  463. margin-right:1px;
  464. &:hover {
  465. background-color:#FFF;
  466. color:#555;
  467. border-top-color:#FFF;
  468. }
  469. }
  470. > li.active > a {
  471. background-color:#FFF;
  472. color:#555;
  473. border-top-width:1px;
  474. margin-top:0;
  475. }
  476. }
  477. .widget-color-orange > .widget-header > li > a {
  478. color:#855D10;
  479. }
  480. .transparent > .widget-header > & {
  481. > li > a {
  482. color:#555;
  483. background-color:transparent;
  484. border-right:1px solid transparent;
  485. border-left:1px solid transparent;
  486. }
  487. > li.active > a {
  488. border-top-color:#4C8FBD;
  489. border-right:1px solid #C5D0DC;
  490. border-left:1px solid #C5D0DC;
  491. background-color:#FFF;
  492. box-shadow:none;
  493. }
  494. }
  495. }
  496. // toolbox
  497. .widget-toolbox {
  498. background-color:#EEE;
  499. &:first-child {// the toolbox coming before content
  500. padding:2px;
  501. border-bottom:1px solid #CCC;
  502. }
  503. &:last-child {// the toolbox coming after content
  504. padding:2px;
  505. border-top:1px solid #CCC;
  506. .transparent > .widget-body > & {
  507. border:none;
  508. border-top:1px solid #CCC;
  509. }
  510. }
  511. > .btn-toolbar {
  512. margin: 0 !important;//to override .RTL's
  513. padding: 0;
  514. }
  515. &.center {
  516. text-align:center;
  517. }
  518. &.toolbox-vertical {
  519. border-bottom-width: 0;
  520. border-right: 1px solid #D9D9D9;
  521. display: table-cell;
  522. padding: 6px 4px;
  523. vertical-align: top;
  524. width: 1px;
  525. + .widget-main {
  526. display: table-cell;
  527. vertical-align: top;
  528. }
  529. }
  530. }
  531. .widget-toolbox {
  532. .widget-paddingX (@index) when (@index >= 0) {
  533. &.padding-@{index} { padding:unit(@index,px); }
  534. .widget-paddingX(@index - 2);
  535. }
  536. .widget-paddingX(16);
  537. }
  538. //when clicking refresh
  539. .widget-box-overlay {
  540. position: absolute;
  541. top: -1px;
  542. bottom: -1px;
  543. right: -1px;
  544. left: -1px;
  545. z-index: 999;
  546. text-align: center;
  547. min-height: 100%;
  548. background-color: rgba(0,0,0,0.3);
  549. > .loading-icon {
  550. position: relative;
  551. top: 20%;
  552. left: 0;
  553. right: 0;
  554. text-align: center;
  555. .widget-box.collapsed & {
  556. top: 10%;
  557. }
  558. &.icon-spin {
  559. .animation-duration(1.2s);
  560. }
  561. }
  562. }
  563. // simple forms in widgetboxes
  564. .widget-main {
  565. > form {
  566. margin-bottom:0;
  567. .input-append , .input-prepend {
  568. margin-bottom:0;
  569. }
  570. }
  571. &.no-padding, &.padding-0 {
  572. > form {
  573. > fieldset {
  574. padding:16px;
  575. + .form-actions {
  576. padding:10px 0 12px;
  577. }
  578. }
  579. > .form-actions {
  580. margin:0;
  581. padding:10px 12px 12px;
  582. }
  583. }
  584. }
  585. }
  586. }
  587. .enable_widgets();
  588. //for dragging and dropping using jQuery UI
  589. .widget-placeholder {
  590. border: 2px dashed #D9D9D9;
  591. }