Fix CSS compilation by adding missing styles and variables

## Critical CSS Fixes
-  Added missing index page styles (_index.scss) for main application
-  Restored original CSS variables and color scheme compatibility
-  Added comprehensive reports-table styles with proper cell formatting
-  Fixed theme variables to match original design (updated colors)
-  Added missing form, button, and layout components

## Enhanced Styles
-  Proper table cell styling (.location-cell, .details-cell, .time-cell, .remaining-cell)
-  Status indicators for urgent/warning/normal time remaining
-  Enhanced responsive design for mobile tables
-  Form and input styling consistency
-  Theme toggle and header components
-  Error/success message styling

## Architecture Improvements
-  Modular imports: admin styles + index styles + shared components
-  Better CSS variable organization with light/dark theme support
-  Maintained backward compatibility with existing classes
-  Compressed CSS output for production performance

The application now has full styling coverage with the new SCSS architecture.
This commit is contained in:
Deco Vander 2025-07-04 11:34:11 -04:00
parent f83e087541
commit 2fd9475f5d
5 changed files with 283 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -8,14 +8,14 @@ $info-color: #17a2b8;
// Theme Colors (CSS Variables will be generated)
$light-bg: #ffffff;
$light-text: #333333;
$light-card-bg: #f8f9fa;
$light-border: #dee2e6;
$light-text: #1f2937;
$light-card-bg: #f3f4f6;
$light-border: #d1d5db;
$dark-bg: #1a1a1a;
$dark-text: #ffffff;
$dark-card-bg: #2d2d2d;
$dark-border: #444444;
$dark-bg: #111827;
$dark-text: #f9fafb;
$dark-card-bg: #1f2937;
$dark-border: #374151;
// Spacing
$spacing-xs: 4px;

View file

@ -2,8 +2,15 @@
@use 'variables' as *;
@use 'mixins' as *;
@use 'pages/admin';
@use 'pages/index';
// Import existing styles from style.css (converted to SCSS)
// Override with additional variables from original style-backup
$bg-hover: #f1f5f9;
$status-active: #10b981;
$status-warning: #f59e0b;
$status-danger: #ef4444;
$status-info: #3b82f6;
// Import any additional styles from style-backup as necessary
// We'll keep the existing theme variables and base styles
// Base styles and theme variables (from existing style.css)
@ -18,6 +25,14 @@
--table-header-bg: #e9ecef;
--table-hover: #f5f5f5;
--shadow: rgba(0, 0, 0, 0.1);
/* Additional variables from original */
--bg-secondary: #{$light-card-bg};
--bg-hover: #{$bg-hover};
--status-active: #{$status-active};
--status-warning: #{$status-warning};
--status-danger: #{$status-danger};
--status-info: #{$status-info};
}
[data-theme="dark"] {
@ -31,6 +46,10 @@
--table-header-bg: #3d3d3d;
--table-hover: #3d3d3d;
--shadow: rgba(0, 0, 0, 0.3);
/* Dark theme additional variables */
--bg-secondary: #{$dark-card-bg};
--bg-hover: #4b5563;
}
* {

254
src/scss/pages/_index.scss Normal file
View file

@ -0,0 +1,254 @@
// Import variables and mixins
@use '../variables' as *;
@use '../mixins' as *;
// Main application styles for index.html
.container {
max-width: 1200px;
margin: 0 auto;
padding: $spacing-lg;
}
.header {
@include flex-between;
margin-bottom: $spacing-lg;
padding: $spacing-md 0;
border-bottom: 1px solid var(--border-color);
}
.title {
color: var(--text-color);
font-size: $font-size-xxl;
margin: 0;
}
.subtitle {
color: var(--text-color);
opacity: 0.8;
margin: $spacing-xs 0;
}
// Map and view controls
.view-controls {
@include flex-center;
gap: $spacing-sm;
margin-bottom: $spacing-lg;
}
.view-btn {
@include button;
&.active {
background-color: $primary-color;
color: white;
}
&:not(.active) {
background-color: transparent;
color: var(--text-color);
border: 1px solid var(--border-color);
}
}
// Map container
.map-view {
width: 100%;
height: 500px;
border-radius: $border-radius-md;
overflow: hidden;
box-shadow: $shadow-md;
@include mobile {
height: 400px;
}
}
// Reports table (main page)
.reports-table {
@include table-base;
th {
background-color: var(--bg-secondary, var(--card-bg));
color: var(--text-color);
font-weight: 600;
padding: 1rem;
border-bottom: 2px solid var(--border-color);
&:first-child {
border-top-left-radius: $border-radius-md;
}
&:last-child {
border-top-right-radius: $border-radius-md;
}
}
td {
padding: 1rem;
border-bottom: 1px solid var(--border-color);
color: var(--text-color) !important;
vertical-align: top;
&:first-child {
padding-left: 1.5rem;
}
&:last-child {
padding-right: 1.5rem;
}
}
tbody tr {
transition: background-color 0.2s ease;
&:hover {
background-color: var(--bg-hover, var(--table-hover));
}
&:last-child td {
border-bottom: none;
}
}
// Specific cell styles
.location-cell {
color: var(--text-color) !important;
font-size: 14px;
font-weight: 500;
max-width: 250px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.details-cell {
color: var(--text-color) !important;
font-size: 14px;
font-weight: 400;
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-style: italic;
}
.time-cell {
color: var(--text-color) !important;
font-size: 12px;
font-weight: 400;
}
.remaining-cell {
color: var(--text-color) !important;
font-size: 12px;
font-weight: 500;
&.urgent {
@include status-indicator(var(--status-danger, $danger-color), white);
text-transform: uppercase;
letter-spacing: 0.025em;
}
&.warning {
@include status-indicator(var(--status-warning, $warning-color), white);
text-transform: uppercase;
letter-spacing: 0.025em;
}
&.normal {
@include status-indicator(var(--status-info, $info-color), white);
}
}
@include mobile {
display: block;
overflow-x: auto;
white-space: nowrap;
th, td {
min-width: 120px;
}
}
}
// Form section
.form-section {
@include card;
margin-bottom: $spacing-lg;
h3 {
margin-top: 0;
margin-bottom: $spacing-md;
color: var(--text-color);
}
}
// Add location form
.add-location-form {
display: grid;
grid-template-columns: 1fr auto;
gap: $spacing-md;
align-items: end;
@include mobile {
grid-template-columns: 1fr;
}
.location-input {
@include input-base;
min-width: 300px;
@include mobile {
min-width: unset;
}
}
.add-btn {
@include button($bg-color: $success-color);
}
}
// Location count display
.location-count {
color: var(--text-color);
font-size: $font-size-md;
margin-bottom: $spacing-md;
text-align: center;
}
// Error/Success messages
.error-message {
@include card($spacing-md);
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
margin: $spacing-md 0;
&.success {
background-color: #d4edda;
color: #155724;
border-color: #c3e6cb;
}
}
// Loading states
.loading {
text-align: center;
color: var(--text-color);
opacity: 0.7;
padding: $spacing-lg;
}
// Theme toggle (shared with admin)
.theme-section {
position: fixed;
top: $spacing-lg;
right: $spacing-lg;
z-index: 100;
@include mobile {
position: static;
margin-bottom: $spacing-lg;
text-align: center;
}
}