Refactor color styles to use CSS variables for improved consistency and maintainability

This commit is contained in:
2026-04-19 23:35:45 +02:00
parent 2f6ab9c3fb
commit bfbc8b6796
3 changed files with 91 additions and 86 deletions
+15 -15
View File
@@ -196,7 +196,7 @@ select:focus {
} }
.ausleihen { .ausleihen {
color: black !important; /* Override any existing color */ /* Color handled securely below */
} }
/* Modal image display fix */ /* Modal image display fix */
@@ -263,12 +263,12 @@ select:focus {
.view-toggle-btn { .view-toggle-btn {
width: 38px; width: 38px;
height: 38px; height: 38px;
border: 1px solid #c7ced6; border: 1px solid var(--ui-border);
border-radius: 50%; border-radius: 50%;
background: #ffffff; background: var(--ui-surface);
font-size: 1.15rem; font-size: 1.15rem;
cursor: pointer; cursor: pointer;
color: #2f3e4e; color: var(--ui-text);
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@@ -277,8 +277,8 @@ select:focus {
.view-toggle-btn:hover { .view-toggle-btn:hover {
transform: translateY(-1px); transform: translateY(-1px);
border-color: #8fa2b7; border-color: var(--ui-border);
background: #f8fbff; background: var(--ui-surface-soft);
box-shadow: 0 3px 8px rgba(33, 37, 41, 0.12); box-shadow: 0 3px 8px rgba(33, 37, 41, 0.12);
} }
@@ -287,9 +287,9 @@ select:focus {
} }
.view-toggle-btn[aria-pressed='true'] { .view-toggle-btn[aria-pressed='true'] {
background: #e9f2ff; background: var(--module-primary-color);
border-color: #7ea1c8; border-color: var(--module-primary-color);
color: #1f4f7a; color: white;
} }
.table-view-header { .table-view-header {
@@ -306,7 +306,7 @@ body.table-view .table-view-header {
border: 0; border: 0;
border-radius: 10px; border-radius: 10px;
background: transparent; background: transparent;
color: #3f4e5d; color: var(--ui-text-muted);
font-size: 0.82rem; font-size: 0.82rem;
font-weight: 700; font-weight: 700;
text-transform: uppercase; text-transform: uppercase;
@@ -325,9 +325,9 @@ body.table-view .item-card {
max-width: none; max-width: none;
margin: 0 0 10px 0; margin: 0 0 10px 0;
padding: 12px 14px; padding: 12px 14px;
border: 1px solid #e1e6ed; border: 1px solid var(--ui-border);
border-radius: 10px; border-radius: 10px;
background: #ffffff; background: var(--ui-surface);
box-shadow: none; box-shadow: none;
scroll-snap-align: none; scroll-snap-align: none;
} }
@@ -353,7 +353,7 @@ body.table-view .item-card .card-content .item-name-cell,
body.table-view .item-card .card-content .item-col-name { body.table-view .item-card .card-content .item-col-name {
font-size: 0.98rem; font-size: 0.98rem;
font-weight: 700; font-weight: 700;
color: #1f2d3d; color: var(--ui-title);
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@@ -370,7 +370,7 @@ body.table-view .item-card .card-content .item-col-filter3,
body.table-view .item-card .card-content .item-code-cell, body.table-view .item-card .card-content .item-code-cell,
body.table-view .item-card .card-content .item-col-code, body.table-view .item-card .card-content .item-col-code,
body.table-view .item-card .card-content .item-col-count { body.table-view .item-card .card-content .item-col-count {
color: #445465; color: var(--ui-text-muted);
font-size: 0.9rem; font-size: 0.9rem;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
@@ -387,7 +387,7 @@ body.table-view .item-card .damage-badge {
body.table-view .item-card .actions { body.table-view .item-card .actions {
margin-top: 10px; margin-top: 10px;
padding-top: 10px; padding-top: 10px;
border-top: 1px dashed #d9e0e8; border-top: 1px dashed var(--ui-border);
} }
@media (max-width: 900px) { @media (max-width: 900px) {
+42 -39
View File
@@ -19,7 +19,7 @@
align-items: center; align-items: center;
gap: 12px; gap: 12px;
padding: 12px; padding: 12px;
border-bottom: 1px solid #e7edf5; border-bottom: 1px solid var(--ui-border);
background: #f8fafc; background: #f8fafc;
} }
@@ -29,7 +29,7 @@
border: 1px solid #dbe3ee; border: 1px solid #dbe3ee;
border-radius: 8px; border-radius: 8px;
background: var(--ui-surface); background: var(--ui-surface);
color: #334155; color: var(--ui-text);
font-weight: 700; font-weight: 700;
line-height: 1; line-height: 1;
cursor: pointer; cursor: pointer;
@@ -60,7 +60,7 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: 8px; border-radius: 8px;
color: #334155; color: var(--ui-text);
font-size: 0.95rem; font-size: 0.95rem;
font-weight: 600; font-weight: 600;
line-height: 1; line-height: 1;
@@ -173,7 +173,7 @@
.cal-booking-period { .cal-booking-period {
margin-left: 8px; margin-left: 8px;
color: #475569; color: var(--ui-text);
font-size: 0.85rem; font-size: 0.85rem;
font-weight: 600; font-weight: 600;
} }
@@ -225,14 +225,14 @@
.filter-option-group { .filter-option-group {
margin-bottom: 12px; margin-bottom: 12px;
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--ui-border);
padding-bottom: 8px; padding-bottom: 8px;
} }
.filter-group-header { .filter-group-header {
font-weight: bold; font-weight: bold;
margin-bottom: 5px; margin-bottom: 5px;
color: #495057; color: var(--ui-text-muted);
font-size: 0.9rem; font-size: 0.9rem;
} }
@@ -253,7 +253,7 @@
} }
.filter-tag-group { .filter-tag-group {
color: #6c757d; color: var(--ui-text-muted);
font-size: 0.8em; font-size: 0.8em;
font-style: italic; font-style: italic;
margin-right: 2px; margin-right: 2px;
@@ -262,7 +262,7 @@
.filter-tag-remove { .filter-tag-remove {
background: none; background: none;
border: none; border: none;
color: #6c757d; color: var(--ui-text-muted);
margin-left: 5px; margin-left: 5px;
cursor: pointer; cursor: pointer;
font-size: 1rem; font-size: 1rem;
@@ -2856,7 +2856,7 @@
.clear-filter { .clear-filter {
font-size: 0.8rem; font-size: 0.8rem;
color: #6c757d; color: var(--ui-text-muted);
} }
.filter-dropdown { .filter-dropdown {
@@ -2903,14 +2903,14 @@
.filter-option-group { .filter-option-group {
margin-bottom: 12px; margin-bottom: 12px;
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--ui-border);
padding-bottom: 8px; padding-bottom: 8px;
} }
.filter-group-header { .filter-group-header {
font-weight: bold; font-weight: bold;
margin-bottom: 5px; margin-bottom: 5px;
color: #495057; color: var(--ui-text-muted);
font-size: 0.9rem; font-size: 0.9rem;
} }
@@ -2931,7 +2931,7 @@
} }
.filter-tag-group { .filter-tag-group {
color: #6c757d; color: var(--ui-text-muted);
font-size: 0.8em; font-size: 0.8em;
font-style: italic; font-style: italic;
margin-right: 2px; margin-right: 2px;
@@ -2940,7 +2940,7 @@
.filter-tag-remove { .filter-tag-remove {
background: none; background: none;
border: none; border: none;
color: #6c757d; color: var(--ui-text-muted);
margin-left: 5px; margin-left: 5px;
cursor: pointer; cursor: pointer;
font-size: 1rem; font-size: 1rem;
@@ -3029,7 +3029,7 @@
border: 1px solid #dbe3ee; border: 1px solid #dbe3ee;
border-radius: 10px; border-radius: 10px;
background: #f8fafc; background: #f8fafc;
color: #334155; color: var(--ui-text);
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
@@ -3088,17 +3088,15 @@
.item-card { .item-card {
background-color: var(--ui-surface); background-color: var(--ui-surface);
border: 1px solid var(--ui-border); border: 1px solid var(--ui-border);
border-radius: 5px; border-radius: var(--ui-radius);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); box-shadow: var(--ui-shadow-sm);
padding: 20px; padding: 20px;
max-width: 300px; width: 100%;
flex-shrink: 0; max-width: 340px;
flex: 1 1 300px;
scroll-snap-align: center; scroll-snap-align: center;
cursor: pointer; cursor: pointer;
transition: transform 0.2s; transition: transform 0.2s, box-shadow 0.2s;
position: relative;
}
.item-card:hover { .item-card:hover {
transform: translateY(-5px); transform: translateY(-5px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
@@ -3238,7 +3236,7 @@
} }
.cancel-button { .cancel-button {
background-color: #6c757d; background-color: var(--ui-text-muted);
color: white; color: white;
} }
@@ -3640,7 +3638,7 @@
display: block !important; display: block !important;
margin-bottom: 8px !important; margin-bottom: 8px !important;
font-weight: 600 !important; font-weight: 600 !important;
color: #333 !important; color: var(--ui-title) !important;
} }
.form-group input, .form-group select, .form-group textarea { .form-group input, .form-group select, .form-group textarea {
@@ -3711,8 +3709,8 @@
} }
/* Element text colors for better visibility */ /* Element text colors for better visibility */
.edit-button, .duplicate-button, .generate-qr-button, .ausleihen { .edit-button, .duplicate-button, .generate-qr-button {
color: black !important; color: var(--ui-title) !important;
} }
/* Standardized button styles across the application */ /* Standardized button styles across the application */
@@ -3873,7 +3871,7 @@
.modal-details { margin: 20px 0; } .modal-details { margin: 20px 0; }
.detail-group { display: flex; margin-bottom: 10px; align-items: flex-start; } .detail-group { display: flex; margin-bottom: 10px; align-items: flex-start; }
.detail-group.full-width { flex-direction: column; margin-bottom: 15px; } .detail-group.full-width { flex-direction: column; margin-bottom: 15px; }
.detail-label { font-weight: bold; color: #495057; min-width: 150px; margin-right: 10px; } .detail-label { font-weight: bold; color: var(--ui-text-muted); min-width: 150px; margin-right: 10px; }
.detail-value { color: #212529; flex: 1; word-wrap: break-word; } .detail-value { color: #212529; flex: 1; word-wrap: break-word; }
.detail-group.full-width .detail-label { margin-bottom: 5px; } .detail-group.full-width .detail-label { margin-bottom: 5px; }
.detail-group.full-width .detail-value { .detail-group.full-width .detail-value {
@@ -3955,7 +3953,7 @@
align-items: center; align-items: center;
padding: 15px; padding: 15px;
background-color: var(--ui-surface); background-color: var(--ui-surface);
border-bottom: 1px solid #f3f4f6; border-bottom: 1px solid var(--ui-border);
} }
.calendar-header button { .calendar-header button {
@@ -4121,7 +4119,7 @@
font-size: 0.95rem !important; font-size: 0.95rem !important;
font-weight: 600 !important; font-weight: 600 !important;
line-height: 1.35 !important; line-height: 1.35 !important;
color: #212529 !important; color: var(--ui-title) !important;
word-break: break-word !important; word-break: break-word !important;
overflow-wrap: anywhere !important; overflow-wrap: anywhere !important;
} }
@@ -4199,7 +4197,7 @@
display: block !important; display: block !important;
margin-right: 0 !important; margin-right: 0 !important;
margin-bottom: 2px !important; margin-bottom: 2px !important;
color: #6c757d !important; color: var(--ui-text-muted) !important;
font-size: 0.8rem !important; font-size: 0.8rem !important;
} }
@@ -4219,8 +4217,12 @@
} }
.items-container { .items-container {
padding: 6px 0 !important; display: grid !important;
gap: 10px !important; grid-template-columns: 1fr !important;
gap: 15px !important;
padding: 10px 0 !important;
overflow-x: visible !important;
scroll-snap-type: none !important;
} }
body.table-view .table-view-header { body.table-view .table-view-header {
@@ -4237,16 +4239,17 @@
} }
.item-card { .item-card {
border: none !important; max-width: 100% !important;
border-radius: 0 !important; margin: 0 !important;
box-shadow: none !important; padding: 15px !important;
border-bottom: 1px solid #e5e7eb !important; scroll-snap-align: none !important;
padding: 12px 0 !important; content-visibility: auto;
contain-intrinsic-size: auto 300px;
} }
.item-card:hover { .item-card:hover {
transform: none !important; transform: translateY(-2px) !important;
box-shadow: none !important; box-shadow: var(--ui-shadow-md) !important;
} }
.item-card .image-container { .item-card .image-container {
+34 -32
View File
@@ -21,7 +21,7 @@
.items-indicator { .items-indicator {
text-align: center; text-align: center;
font-size: 0.9rem; font-size: 0.9rem;
color: #495057; color: var(--ui-text-muted);
margin: 6px 0 16px; margin: 6px 0 16px;
font-weight: 600; font-weight: 600;
} }
@@ -78,7 +78,7 @@
} }
.bulk-delete-summary { .bulk-delete-summary {
color: #334155; color: var(--ui-text);
font-size: 0.92rem; font-size: 0.92rem;
margin-top: 4px; margin-top: 4px;
} }
@@ -105,7 +105,7 @@
padding: 9px 12px; padding: 9px 12px;
cursor: pointer; cursor: pointer;
background: #f8fafc; background: #f8fafc;
color: #1e293b; color: var(--ui-title);
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
} }
@@ -161,7 +161,7 @@
.clear-filter { .clear-filter {
font-size: 0.8rem; font-size: 0.8rem;
color: #6c757d; color: var(--ui-text-muted);
} }
.filter-dropdown { .filter-dropdown {
@@ -208,14 +208,14 @@
.filter-option-group { .filter-option-group {
margin-bottom: 12px; margin-bottom: 12px;
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--ui-border);
padding-bottom: 8px; padding-bottom: 8px;
} }
.filter-group-header { .filter-group-header {
font-weight: bold; font-weight: bold;
margin-bottom: 5px; margin-bottom: 5px;
color: #495057; color: var(--ui-text-muted);
font-size: 0.9rem; font-size: 0.9rem;
} }
@@ -236,7 +236,7 @@
} }
.filter-tag-group { .filter-tag-group {
color: #6c757d; color: var(--ui-text-muted);
font-size: 0.8em; font-size: 0.8em;
font-style: italic; font-style: italic;
margin-right: 2px; margin-right: 2px;
@@ -245,7 +245,7 @@
.filter-tag-remove { .filter-tag-remove {
background: none; background: none;
border: none; border: none;
color: #6c757d; color: var(--ui-text-muted);
margin-left: 5px; margin-left: 5px;
cursor: pointer; cursor: pointer;
font-size: 1rem; font-size: 1rem;
@@ -334,7 +334,7 @@
border: 1px solid #dbe3ee; border: 1px solid #dbe3ee;
border-radius: 10px; border-radius: 10px;
background: #f8fafc; background: #f8fafc;
color: #334155; color: var(--ui-text);
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
@@ -393,14 +393,15 @@
.item-card { .item-card {
background-color: var(--ui-surface); background-color: var(--ui-surface);
border: 1px solid var(--ui-border); border: 1px solid var(--ui-border);
border-radius: 5px; border-radius: var(--ui-radius);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); box-shadow: var(--ui-shadow-sm);
padding: 20px; padding: 20px;
max-width: 300px; width: 100%;
flex-shrink: 0; max-width: 340px;
flex: 1 1 300px;
scroll-snap-align: center; scroll-snap-align: center;
cursor: pointer; cursor: pointer;
transition: transform 0.2s; transition: transform 0.2s, box-shadow 0.2s;
position: relative; position: relative;
} }
@@ -447,7 +448,7 @@
align-items: center; align-items: center;
gap: 6px; gap: 6px;
font-size: 0.9rem; font-size: 0.9rem;
color: #475569; color: var(--ui-text);
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
} }
@@ -676,7 +677,7 @@
} }
.cancel-button { .cancel-button {
background-color: #6c757d; background-color: var(--ui-text-muted);
color: white; color: white;
} }
@@ -711,7 +712,7 @@
.filter-inputs h3 { .filter-inputs h3 {
margin-top: 0; margin-top: 0;
margin-bottom: 15px; margin-bottom: 15px;
color: #495057; color: var(--ui-text-muted);
} }
.multi-filter { .multi-filter {
@@ -1000,16 +1001,16 @@
/* Disabled Button */ /* Disabled Button */
.disabled-button { .disabled-button {
background-color: #6c757d !important; background-color: var(--ui-text-muted) !important;
border-color: #6c757d !important; border-color: var(--ui-text-muted) !important;
color: #fff !important; color: #fff !important;
cursor: not-allowed !important; cursor: not-allowed !important;
opacity: 0.6; opacity: 0.6;
} }
.disabled-button:hover { .disabled-button:hover {
background-color: #6c757d !important; background-color: var(--ui-text-muted) !important;
border-color: #6c757d !important; border-color: var(--ui-text-muted) !important;
transform: none !important; transform: none !important;
box-shadow: none !important; box-shadow: none !important;
} }
@@ -1032,7 +1033,7 @@
.detail-label { .detail-label {
font-weight: bold; font-weight: bold;
color: #495057; color: var(--ui-text-muted);
min-width: 150px; min-width: 150px;
margin-right: 10px; margin-right: 10px;
} }
@@ -1351,7 +1352,7 @@
display: block !important; display: block !important;
margin-bottom: 8px !important; margin-bottom: 8px !important;
font-weight: 600 !important; font-weight: 600 !important;
color: #333 !important; color: var(--ui-title) !important;
} }
.form-group input, .form-group select, .form-group textarea { .form-group input, .form-group select, .form-group textarea {
@@ -1389,7 +1390,7 @@
/* Tab navigation improvements */ /* Tab navigation improvements */
.nav-tabs { .nav-tabs {
flex-wrap: wrap !important; flex-wrap: wrap !important;
border-bottom: 1px solid #dee2e6 !important; border-bottom: 1px solid var(--ui-border) !important;
} }
.nav-tabs .nav-link { .nav-tabs .nav-link {
@@ -1605,6 +1606,7 @@
gap: 15px !important; gap: 15px !important;
padding: 10px 0 !important; padding: 10px 0 !important;
overflow-x: visible !important; overflow-x: visible !important;
scroll-snap-type: none !important;
} }
.item-card { .item-card {
@@ -1688,7 +1690,7 @@
display: block !important; display: block !important;
margin-bottom: 8px !important; margin-bottom: 8px !important;
font-weight: 600 !important; font-weight: 600 !important;
color: #333 !important; color: var(--ui-title) !important;
} }
.form-group input, .form-group select, .form-group textarea { .form-group input, .form-group select, .form-group textarea {
@@ -1962,8 +1964,8 @@
} }
/* Element text colors for better visibility */ /* Element text colors for better visibility */
.edit-button, .duplicate-button, .generate-qr-button, .ausleihen { .edit-button, .duplicate-button, .generate-qr-button {
color: black !important; color: var(--ui-title) !important;
} }
/* Standardized button styles across the application */ /* Standardized button styles across the application */
@@ -2019,7 +2021,7 @@
align-items: center; align-items: center;
gap: 12px; gap: 12px;
padding: 12px; padding: 12px;
border-bottom: 1px solid #e7edf5; border-bottom: 1px solid var(--ui-border);
background: #f8fafc; background: #f8fafc;
} }
@@ -2029,7 +2031,7 @@
border: 1px solid #dbe3ee; border: 1px solid #dbe3ee;
border-radius: 8px; border-radius: 8px;
background: var(--ui-surface); background: var(--ui-surface);
color: #334155; color: var(--ui-text);
font-weight: 700; font-weight: 700;
line-height: 1; line-height: 1;
cursor: pointer; cursor: pointer;
@@ -2060,7 +2062,7 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: 8px; border-radius: 8px;
color: #334155; color: var(--ui-text);
font-size: 0.95rem; font-size: 0.95rem;
font-weight: 600; font-weight: 600;
line-height: 1; line-height: 1;
@@ -2173,7 +2175,7 @@
.cal-booking-period { .cal-booking-period {
margin-left: 8px; margin-left: 8px;
color: #475569; color: var(--ui-text);
font-size: 0.85rem; font-size: 0.85rem;
font-weight: 600; font-weight: 600;
} }
@@ -5667,7 +5669,7 @@ document.addEventListener('DOMContentLoaded', ()=>{
display: block !important; display: block !important;
margin-right: 0 !important; margin-right: 0 !important;
margin-bottom: 2px !important; margin-bottom: 2px !important;
color: #6c757d !important; color: var(--ui-text-muted) !important;
font-size: 0.8rem !important; font-size: 0.8rem !important;
} }