mixins.less 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. .gradient (@color1; @color2) {
  2. background:@color1;
  3. background: -webkit-linear-gradient(top, @color1 0%,@color2 100%);
  4. background: linear-gradient(to bottom, @color1 0%,@color2 100%);
  5. }
  6. .jstree-theme (@base-height, @image, @image-height) {
  7. @correction: (@image-height - @base-height) / 2;
  8. .jstree-node { min-height:@base-height; line-height:@base-height; margin-left:@base-height; min-width:@base-height; }
  9. .jstree-anchor { line-height:@base-height; height:@base-height; }
  10. .jstree-icon { width:@base-height; height:@base-height; line-height:@base-height; }
  11. .jstree-icon:empty { width:@base-height; height:@base-height; line-height:@base-height; }
  12. &.jstree-rtl .jstree-node { margin-right:@base-height; }
  13. .jstree-wholerow { height:@base-height; }
  14. .jstree-node,
  15. .jstree-icon { background-image:url("@{image}"); }
  16. .jstree-node { background-position:-(@image-height * 9 + @correction) -@correction; background-repeat:repeat-y; }
  17. .jstree-last { background:transparent; }
  18. .jstree-open > .jstree-ocl { background-position:-(@image-height * 4 + @correction) -@correction; }
  19. .jstree-closed > .jstree-ocl { background-position:-(@image-height * 3 + @correction) -@correction; }
  20. .jstree-leaf > .jstree-ocl { background-position:-(@image-height * 2 + @correction) -@correction; }
  21. .jstree-themeicon { background-position:-(@image-height * 8 + @correction) -@correction; }
  22. > .jstree-no-dots {
  23. .jstree-node,
  24. .jstree-leaf > .jstree-ocl { background:transparent; }
  25. .jstree-open > .jstree-ocl { background-position:-(@image-height * 1 + @correction) -@correction; }
  26. .jstree-closed > .jstree-ocl { background-position:-@correction -@correction; }
  27. }
  28. .jstree-disabled {
  29. background:transparent;
  30. &.jstree-hovered {
  31. background:transparent;
  32. }
  33. &.jstree-clicked {
  34. background:#efefef;
  35. }
  36. }
  37. .jstree-checkbox {
  38. background-position:-(@image-height * 5 + @correction) -@correction;
  39. &:hover { background-position:-(@image-height * 5 + @correction) -(@image-height * 1 + @correction); }
  40. }
  41. &.jstree-checkbox-selection .jstree-clicked, .jstree-checked {
  42. > .jstree-checkbox {
  43. background-position:-(@image-height * 7 + @correction) -@correction;
  44. &:hover { background-position:-(@image-height * 7 + @correction) -(@image-height * 1 + @correction); }
  45. }
  46. }
  47. .jstree-anchor {
  48. > .jstree-undetermined {
  49. background-position:-(@image-height * 6 + @correction) -@correction;
  50. &:hover {
  51. background-position:-(@image-height * 6 + @correction) -(@image-height * 1 + @correction);
  52. }
  53. }
  54. }
  55. .jstree-checkbox-disabled { opacity:0.8; filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'jstree-grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#jstree-grayscale"); /* Firefox 10+ */ filter: gray; /* IE6-9 */ -webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */ }
  56. > .jstree-striped { background-size:auto (@base-height * 2); }
  57. &.jstree-rtl {
  58. .jstree-node { background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); background-position: 100% 1px; background-repeat:repeat-y; }
  59. .jstree-last { background:transparent; }
  60. .jstree-open > .jstree-ocl { background-position:-(@image-height * 4 + @correction) -(@image-height * 1 + @correction); }
  61. .jstree-closed > .jstree-ocl { background-position:-(@image-height * 3 + @correction) -(@image-height * 1 + @correction); }
  62. .jstree-leaf > .jstree-ocl { background-position:-(@image-height * 2 + @correction) -(@image-height * 1 + @correction); }
  63. > .jstree-no-dots {
  64. .jstree-node,
  65. .jstree-leaf > .jstree-ocl { background:transparent; }
  66. .jstree-open > .jstree-ocl { background-position:-(@image-height * 1 + @correction) -(@image-height * 1 + @correction); }
  67. .jstree-closed > .jstree-ocl { background-position:-@correction -(@image-height * 1 + @correction); }
  68. }
  69. }
  70. .jstree-themeicon-custom { background-color:transparent; background-image:none; background-position:0 0; }
  71. > .jstree-container-ul .jstree-loading > .jstree-ocl { background:url("@{image-path}throbber.gif") center center no-repeat; }
  72. .jstree-file { background:url("@{image}") -(@image-height * 3 + @correction) -(@image-height * 2 + @correction) no-repeat; }
  73. .jstree-folder { background:url("@{image}") -(@image-height * 8 + @correction) -(@correction) no-repeat; }
  74. > .jstree-container-ul > .jstree-node { margin-left:0; margin-right:0; }
  75. // drag'n'drop
  76. #jstree-dnd& {
  77. line-height:@base-height; padding:0 4px;
  78. .jstree-ok,
  79. .jstree-er { background-image:url("@{image-path}32px.png"); background-repeat:no-repeat; background-color:transparent; }
  80. i { background:transparent; width:@base-height; height:@base-height; line-height:@base-height; }
  81. .jstree-ok { background-position: -(@correction) -(@image-height * 2 + @correction); }
  82. .jstree-er { background-position: -(@image-height * 1 + @correction) -(@image-height * 2 + @correction); }
  83. }
  84. // ellipsis
  85. .jstree-ellipsis { overflow: hidden; }
  86. // base height + PADDINGS!
  87. .jstree-ellipsis .jstree-anchor { width: calc(100% ~"-" (@base-height + 5px)); text-overflow: ellipsis; overflow: hidden; }
  88. }