tree.css 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* Remove default bullets */
  2. ul, #tree {
  3. list-style-type: none;
  4. }
  5. /* Remove margins and padding from the parent ul */
  6. #tree {
  7. margin: 0;
  8. padding: 0;
  9. }
  10. #tree li {
  11. line-height: 1.2;
  12. position: relative;
  13. padding: 0 0 1em 1em;
  14. }
  15. #tree ul li { padding: 1em 0 0 1em; }
  16. #tree > li:last-child { padding-bottom: 0; }
  17. /* ————————————————————–
  18. Tree labels
  19. */
  20. #tree_label {
  21. position: relative;
  22. display: inline-block;
  23. background: #fff;
  24. }
  25. label#tree_label { cursor: pointer; }
  26. label#tree_label:hover { color: #666; }
  27. /* ————————————————————–
  28. Tree expanded icon
  29. */
  30. label#tree_label:before {
  31. background: #000;
  32. color: #fff;
  33. position: relative;
  34. z-index: 1;
  35. float: left;
  36. margin: 0 1em 0 -2em;
  37. width: 1em;
  38. height: 1em;
  39. border-radius: 1em;
  40. content: '+';
  41. text-align: center;
  42. line-height: .9em;
  43. }
  44. :checked ~ label#tree_label:before { content: '–'; }
  45. /* ————————————————————–
  46. Tree branches
  47. */
  48. .fa {
  49. margin-right: 5px;
  50. }
  51. span.tree_label:after {
  52. position: absolute;
  53. top: 0;
  54. left: -2em;
  55. display: block;
  56. height: 1.8em;
  57. width: 2.5em;
  58. border-bottom: 1px solid #777;
  59. border-left: 1px solid #777;
  60. border-radius: 0 0 0 0.3em;
  61. content: '';
  62. }
  63. #tree li:last-child:before {
  64. height: 1em;
  65. bottom: auto;
  66. border:0px;
  67. }
  68. #tree > li:last-child:before { display: none; }
  69. #tree_custom {
  70. display: block;
  71. background: #eee;
  72. padding: 1em;
  73. border-radius: 0.3em;
  74. }