style.css 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. @import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
  2. body {
  3. margin: 0;
  4. font-family: Arial, sans-serif;
  5. background: #f4f4f4;
  6. transition: background 0.3s, color 0.3s;
  7. display: flex;
  8. }
  9. body.dark {
  10. background: #333;
  11. color: #f4f4f4;
  12. }
  13. .sidebar {
  14. position: fixed;
  15. left: 0;
  16. top: 0;
  17. width: 60px;
  18. height: 100%;
  19. background: #231f20;
  20. padding: 20px;
  21. box-sizing: border-box;
  22. transition: width 0.3s ease-in-out;
  23. overflow: hidden;
  24. z-index: 1000;
  25. display: flex;
  26. flex-direction: column;
  27. justify-content: space-between;
  28. }
  29. .sidebar.close {
  30. width: 60px;
  31. }
  32. .sidebar.close .profile-label span,
  33. .sidebar.close a span {
  34. opacity: 0;
  35. visibility: hidden;
  36. transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  37. }
  38. .sidebar:not(.close) .profile-label span,
  39. .sidebar:not(.close) a span {
  40. opacity: 1;
  41. visibility: visible;
  42. transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  43. }
  44. .sidebar ul {
  45. margin-left: -6px;
  46. padding: 0;
  47. list-style: none;
  48. }
  49. .sidebar ul li span {
  50. margin-left: 10px;
  51. }
  52. .sidebar ul li a:has(img) {
  53. padding: 0;
  54. }
  55. .sidebar .toggle {
  56. cursor: pointer;
  57. font-size: 23px;
  58. color: #ddd;
  59. display: block;
  60. margin: 0 0 20px -3px;
  61. }
  62. .sidebar .toggle-switch {
  63. cursor: pointer;
  64. color: #ddd;
  65. display: flex;
  66. align-items: center;
  67. margin-top: auto;
  68. }
  69. .sidebar .toggle-switch .mode-text {
  70. margin-left: 10px;
  71. }
  72. .content {
  73. margin-left: 60px;
  74. padding: 20px;
  75. transition: margin-left 0.3s ease-in-out;
  76. flex-grow: 1;
  77. }
  78. #toggle-sidebar:checked ~ .sidebar {
  79. width: 250px;
  80. }
  81. #toggle-sidebar:checked ~ .content {
  82. margin-left: 250px;
  83. }
  84. #toggle-sidebar:checked ~ .sidebar .profile-label span,
  85. #toggle-sidebar:checked ~ .sidebar a span {
  86. opacity: 1;
  87. visibility: visible;
  88. transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  89. }
  90. .sidebar .profile-label,
  91. .sidebar a {
  92. display: flex;
  93. align-items: center;
  94. font-size: 18px;
  95. color: #ddd;
  96. text-decoration: none;
  97. margin: 10px 0;
  98. transition: font-size 0.3s ease-in-out, visibility 0.3s ease-in-out;
  99. position: relative;
  100. padding: 5px 0 0 5px;
  101. }
  102. .sidebar a:hover, .sidebar label:hover {
  103. color: #fff;
  104. }
  105. .sidebar .profile-label:before,
  106. .sidebar a:before {
  107. content: attr(data-icon);
  108. font-size: 24px;
  109. display: inline-block;
  110. width: 30px;
  111. text-align: center;
  112. position: absolute;
  113. left: 10px;
  114. top: 50%;
  115. transform: translateY(-50%);
  116. }
  117. #toggle-dark-mode:checked ~ body {
  118. background: #333;
  119. color: #f4f4f4;
  120. }
  121. #toggle-dark-mode:checked ~ .sidebar {
  122. background: #333;
  123. }
  124. #toggle-dark-mode:checked ~ .sidebar a,
  125. #toggle-dark-mode:checked ~ .sidebar .profile-label,
  126. #toggle-dark-mode:checked ~ .sidebar .toggle-switch .mode-text {
  127. color: #f4f4f4;
  128. }
  129. .sidebar .top-menu {
  130. flex-grow: 1;
  131. }
  132. .sidebar .bottom-menu {
  133. margin-top: 20px;
  134. }
  135. .sidebar .bottom-menu ul li {
  136. height: 40px;
  137. display: flex;
  138. align-items: center;
  139. }
  140. @media screen and (max-width: 768px) {
  141. .sidebar {
  142. width: 60px;
  143. }
  144. .content {
  145. margin-left: 60px;
  146. padding: 10px;
  147. }
  148. #toggle-sidebar:checked ~ .sidebar {
  149. width: 250px;
  150. }
  151. #toggle-sidebar:checked ~ .content {
  152. margin-left: 250px;
  153. }
  154. .sidebar .toggle {
  155. display: block;
  156. margin: 10px 0;
  157. }
  158. .sidebar .toggle-switch {
  159. display: none;
  160. }
  161. }
  162. @media screen and (max-width: 480px) {
  163. .sidebar .toggle {
  164. font-size: 18px;
  165. }
  166. .content h1 {
  167. font-size: 24px;
  168. }
  169. }