123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- @import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
- body {
- margin: 0;
- font-family: Arial, sans-serif;
- background: #f4f4f4;
- transition: background 0.3s, color 0.3s;
- display: flex;
- }
- body.dark {
- background: #333;
- color: #f4f4f4;
- }
- .sidebar {
- position: fixed;
- left: 0;
- top: 0;
- width: 60px;
- height: 100%;
- background: #231f20;
- padding: 20px;
- box-sizing: border-box;
- transition: width 0.3s ease-in-out;
- overflow: hidden;
- z-index: 1000;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- }
- .sidebar.close {
- width: 60px;
- }
- .sidebar.close .profile-label span,
- .sidebar.close a span {
- opacity: 0;
- visibility: hidden;
- transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
- }
- .sidebar:not(.close) .profile-label span,
- .sidebar:not(.close) a span {
- opacity: 1;
- visibility: visible;
- transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
- }
- .sidebar ul {
- margin-left: -6px;
- padding: 0;
- list-style: none;
- }
- .sidebar ul li span {
- margin-left: 10px;
- }
- .sidebar ul li a:has(img) {
- padding: 0;
- }
- .sidebar .toggle {
- cursor: pointer;
- font-size: 23px;
- color: #ddd;
- display: block;
- margin: 0 0 20px -3px;
- }
- .sidebar .toggle-switch {
- cursor: pointer;
- color: #ddd;
- display: flex;
- align-items: center;
- margin-top: auto;
- }
- .sidebar .toggle-switch .mode-text {
- margin-left: 10px;
- }
- .content {
- margin-left: 60px;
- padding: 20px;
- transition: margin-left 0.3s ease-in-out;
- flex-grow: 1;
- }
- #toggle-sidebar:checked ~ .sidebar {
- width: 250px;
- }
- #toggle-sidebar:checked ~ .content {
- margin-left: 250px;
- }
- #toggle-sidebar:checked ~ .sidebar .profile-label span,
- #toggle-sidebar:checked ~ .sidebar a span {
- opacity: 1;
- visibility: visible;
- transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
- }
- .sidebar .profile-label,
- .sidebar a {
- display: flex;
- align-items: center;
- font-size: 18px;
- color: #ddd;
- text-decoration: none;
- margin: 10px 0;
- transition: font-size 0.3s ease-in-out, visibility 0.3s ease-in-out;
- position: relative;
- padding: 5px 0 0 5px;
- }
- .sidebar a:hover, .sidebar label:hover {
- color: #fff;
- }
- .sidebar .profile-label:before,
- .sidebar a:before {
- content: attr(data-icon);
- font-size: 24px;
- display: inline-block;
- width: 30px;
- text-align: center;
- position: absolute;
- left: 10px;
- top: 50%;
- transform: translateY(-50%);
- }
- #toggle-dark-mode:checked ~ body {
- background: #333;
- color: #f4f4f4;
- }
- #toggle-dark-mode:checked ~ .sidebar {
- background: #333;
- }
- #toggle-dark-mode:checked ~ .sidebar a,
- #toggle-dark-mode:checked ~ .sidebar .profile-label,
- #toggle-dark-mode:checked ~ .sidebar .toggle-switch .mode-text {
- color: #f4f4f4;
- }
- .sidebar .top-menu {
- flex-grow: 1;
- }
- .sidebar .bottom-menu {
- margin-top: 20px;
- }
- .sidebar .bottom-menu ul li {
- height: 40px;
- display: flex;
- align-items: center;
- }
- @media screen and (max-width: 768px) {
- .sidebar {
- width: 60px;
- }
- .content {
- margin-left: 60px;
- padding: 10px;
- }
- #toggle-sidebar:checked ~ .sidebar {
- width: 250px;
- }
- #toggle-sidebar:checked ~ .content {
- margin-left: 250px;
- }
- .sidebar .toggle {
- display: block;
- margin: 10px 0;
- }
- .sidebar .toggle-switch {
- display: none;
- }
- }
- @media screen and (max-width: 480px) {
- .sidebar .toggle {
- font-size: 18px;
- }
- .content h1 {
- font-size: 24px;
- }
- }
|