style(list): modernize CSS variables and enhance overall styling for better UI consistency

This commit is contained in:
ryan 2025-06-05 15:33:42 +03:00
parent 7a98754e68
commit f1595c0756

View file

@ -1,243 +1,367 @@
/* Variables for non-cell elements */
:root {
--primary: #1e88e5;
--primary-dark: #1565c0;
--text-primary: #333;
--text-secondary: #666;
--background: #f4f4f9;
--card-bg: #ffffff;
--border: #ddd;
--danger: #ff4d4f;
--danger-hover: #ff7875;
--danger-active: #d9363e;
/* Spacing */
--spacing-xs: 4px;
--spacing-sm: 8px;
--spacing-md: 15px;
--spacing-lg: 20px;
--spacing-xl: 30px;
/* Shadows */
--shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 8px 12px rgba(0, 0, 0, 0.1);
/* Border radius */
--radius-sm: 4px;
--radius-md: 8px;
--radius-lg: 12px;
--radius-full: 9999px;
}
/* Base styles */
body { body {
font-family: Arial, sans-serif; font-family: 'Inter', Arial, sans-serif;
margin: 0; margin: 0;
padding: 0; padding: 0;
background-color: #f4f4f9; background-color: var(--background);
color: #333; color: var(--text-primary);
line-height: 1.6;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
} }
h1 { h1 {
color: #1e88e5; color: var(--primary);
text-align: center; text-align: center;
margin-bottom: 20px; margin-bottom: var(--spacing-lg);
font-size: 2rem;
letter-spacing: -0.5px;
font-weight: 600;
} }
/* Container for better content width control */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 var(--spacing-md);
}
/* Form styling */
form { form {
margin: 20px auto; margin: var(--spacing-xl) auto;
max-width: 600px; max-width: 600px;
padding: 20px; padding: var(--spacing-lg);
background: white; background: var(--card-bg);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); box-shadow: var(--shadow-md);
border-radius: 8px; border-radius: var(--radius-md);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
form:hover {
box-shadow: var(--shadow-lg);
transform: translateY(-2px);
} }
form input, form textarea, form button { form input, form textarea, form button {
display: block; display: block;
width: 100%; width: 100%;
margin-bottom: 15px; margin-bottom: var(--spacing-md);
padding: 10px; padding: var(--spacing-md);
font-size: 16px; font-size: 16px;
border: 1px solid #ccc; border: 1px solid var(--border);
border-radius: 4px; border-radius: var(--radius-sm);
} }
form button { form button {
background-color: #1e88e5; background-color: var(--primary);
color: white; color: white;
border: none; border: none;
cursor: pointer; cursor: pointer;
transition: background-color 0.3s ease; transition: background-color 0.3s ease, transform 0.1s ease;
font-weight: 600;
} }
form button:hover { form button:hover {
background-color: #1565c0; background-color: var(--primary-dark);
transform: translateY(-1px);
} }
form button:active {
transform: translateY(1px);
}
/* Lists */
ul { ul {
list-style: none; list-style: none;
padding: 0; padding: 0;
} }
ul li { ul li {
background: #fff; background: var(--card-bg);
margin: 10px 0; margin: var(--spacing-md) 0;
padding: 15px; padding: var(--spacing-lg);
border-radius: 5px; border-radius: var(--radius-sm);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); box-shadow: var(--shadow-sm);
transition: box-shadow 0.2s ease, transform 0.2s ease;
} }
ul li:hover {
box-shadow: var(--shadow-md);
transform: translateY(-2px);
}
/* Tables */
table { table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
margin: var(--spacing-lg) 0;
box-shadow: var(--shadow-sm);
border-radius: var(--radius-sm);
overflow: hidden;
} }
th, td { th, td {
border: 1px solid #ddd; border: 1px solid var(--border);
padding: 8px; padding: var(--spacing-md);
} }
th { th {
background-color: #f2f2f2; background-color: #f2f2f2;
font-weight: 600;
color: var(--text-primary);
}
tr {
transition: background-color 0.2s ease;
}
tr:hover {
background-color: rgba(30, 136, 229, 0.03);
} }
/* Style for the grid container */ /* Style for the grid container */
.grid-container { .grid-container {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Adjust the minimum width for cells */ grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 1px; /* Gap between cells */ gap: 1px;
background-color: #ccc;/* Grid line color */ background-color: #ccc;
border: 1px solid #aaa; /* Outer border */ border: 1px solid #aaa;
} }
/* Style for individual cells */ /* Style for individual cells */
.editable-cell { .editable-cell {
display: flex; /* Use flexbox for better layout control */ display: flex;
flex-direction: column; /* Stack children vertically */ flex-direction: column;
width: 100%; /* Full width of the allocated space */ width: 100%;
height: 100%; /* Full height of the allocated space */ height: 100%;
position: relative; /* Relative positioning for absolute children */ position: relative;
box-sizing: border-box; /* Ensure padding and border are included in width/height */ box-sizing: border-box;
} }
/* Style for the input field inside the editable cell */ /* Style for the input field inside the editable cell */
.editable-cell-input { .editable-cell-input {
width: 100%; /* Ensure input takes up full width */ width: 100%;
height: 100%; /* Ensure input takes up full height */ height: 100%;
border: none; /* Remove input box borders */ border: none;
padding: 8px; /* Add padding for spacing */ padding: 8px;
box-sizing: border-box; /* Ensure padding doesn't cause overflow */ box-sizing: border-box;
font-size: 14px; /* Adjust font size */ font-size: 14px;
text-align: left; /* Align text to the left */ text-align: left;
outline: none; /* Remove outline for better UI */ outline: none;
background-color: transparent; /* Make background transparent */ background-color: transparent;
} }
/* Style for the focused input field */ /* Style for the focused input field */
.editable-cell-input:focus { .editable-cell-input:focus {
background-color: #e0f7fa; /* Light blue background when focused */ background-color: #e0f7fa;
border: 1px solid #00796b; /* Green border when focused */ border: 1px solid #00796b;
} }
/* Style for the suggestions list */ /* Suggestion styling */
.editable-cell-suggestions { .editable-cell-suggestions {
position: absolute; /* Position suggestions absolutely within the cell */ position: absolute;
top: 100%; /* Place suggestions below the input field */ top: 100%;
left: 0; /* Align suggestions with the left edge of the cell */ left: 0;
width: 100%; /* Full width of the cell */ width: 100%;
max-height: 200px; /* Limit height of suggestions list */ max-height: 200px;
overflow-y: auto; /* Add scrollbar if suggestions exceed max height */ overflow-y: auto;
background-color: white; /* White background for suggestions */ background-color: white;
border: 1px solid #ddd; /* Light border for suggestions */ border: 1px solid var(--border);
z-index: 10; /* Ensure suggestions appear above other content */ z-index: 10;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add shadow for better visibility */ box-shadow: var(--shadow-md);
border-radius: 0 0 var(--radius-sm) var(--radius-sm);
} }
/* Style for individual suggestion items */
.editable-cell-suggestions li { .editable-cell-suggestions li {
padding: 8px; /* Add padding for spacing */ padding: 8px;
cursor: pointer; /* Change cursor to pointer on hover */ cursor: pointer;
border-bottom: 1px solid #eee; /* Add separator between items */ border-bottom: 1px solid #eee;
margin: 0;
box-shadow: none;
transform: none;
border-radius: 0;
} }
.editable-cell-suggestions li:hover { .editable-cell-suggestions li:hover {
background-color: #f5f5f5; /* Light gray background on hover */ background-color: #f5f5f5;
transform: none;
box-shadow: none;
} }
.search-icon { .editable-cell-suggestions li:last-child {
margin-left: 10px; border-bottom: none;
padding: 5px;
border: none;
background-color: transparent;
cursor: pointer;
}
.search-icon i {
font-size: 18px;
color: #333;
}
.search-icon i.fas.fa-search {
margin-left: 5px;
} }
/* Textarea */
.editable-cell-textarea { .editable-cell-textarea {
width: 100%; width: 100%;
height: 100px; height: 100px;
resize: vertical; resize: vertical;
overflow: auto; overflow: auto;
padding: var(--spacing-md);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
transition: border-color 0.2s ease;
} }
.editable-cell-textarea:focus {
outline: none;
border-color: var(--primary);
}
/* Typeahead */
.typeahead-container { .typeahead-container {
position: relative; position: relative;
} }
.tt-menu { .tt-menu {
width: 100%; width: 100%;
background: white; background: white;
border: 1px solid #ccc; border: 1px solid var(--border);
border-radius: 4px; border-radius: var(--radius-sm);
box-shadow: 0 2px 10px rgba(0,0,0,0.1); box-shadow: var(--shadow-md);
margin-top: 5px; margin-top: 5px;
} }
.tt-suggestion { .tt-suggestion {
padding: 8px 12px; padding: 8px 12px;
cursor: pointer; cursor: pointer;
transition: background-color 0.2s ease;
} }
.tt-suggestion:hover { .tt-suggestion:hover {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.tt-cursor { .tt-cursor {
background-color: #e9e9e9; background-color: #e9e9e9;
} }
.tt-hint { .tt-hint {
display: none !important; display: none !important;
} }
.tt-menu {
background: white;
border: 1px solid #ccc;
border-radius: 4px;
box-shadow: 0 5px 10px rgba(0,0,0,.2);
margin-top: 5px;
width: 100%;
}
.suggestion-item {
padding: 8px 12px;
cursor: pointer;
}
.suggestion-item.tt-cursor {
background-color: #f5f5f5;
}
/* Common styles for delete buttons */ .suggestion-item {
.delete-button { padding: 8px 12px;
display: inline-flex; cursor: pointer;
align-items: center; }
justify-content: center;
width: 24px; .suggestion-item.tt-cursor {
height: 24px; background-color: #f5f5f5;
border-radius: 50%; }
border: none;
background-color: #ff4d4f; /* Delete buttons */
color: white; .delete-button {
font-size: 16px; display: inline-flex;
font-weight: bold; align-items: center;
cursor: pointer; justify-content: center;
margin-left: 8px; width: 24px;
transition: all 0.2s ease; height: 24px;
padding: 0; border-radius: 50%;
line-height: 1; border: none;
} background-color: var(--danger);
.delete-button:hover { color: white;
background-color: #ff7875; font-size: 16px;
transform: scale(1.1); font-weight: bold;
} cursor: pointer;
.delete-button:active { margin-left: 8px;
background-color: #d9363e; transition: all 0.2s ease;
transform: scale(0.95); padding: 0;
} line-height: 1;
/* Specific styles for item delete buttons */ box-shadow: var(--shadow-sm);
.item-delete { }
vertical-align: middle;
} .delete-button:hover {
/* Specific styles for property delete buttons */ background-color: var(--danger-hover);
.property-delete { transform: scale(1.1);
vertical-align: middle; box-shadow: var(--shadow-md);
font-size: 14px; }
}
.delete-button:active {
background-color: var(--danger-active);
transform: scale(0.95);
}
.item-delete {
vertical-align: middle;
}
.property-delete {
vertical-align: middle;
font-size: 14px;
}
/* Button class for consistency */
.button {
display: inline-block;
padding: var(--spacing-sm) var(--spacing-md);
background-color: var(--primary);
color: white;
border: none;
border-radius: var(--radius-sm);
font-weight: 500;
cursor: pointer;
transition: background-color 0.2s ease, transform 0.1s ease;
}
.button:hover {
background-color: var(--primary-dark);
transform: translateY(-1px);
}
.button:active {
transform: translateY(1px);
}
/* Responsive adjustments */
@media (max-width: 768px) {
form {
padding: var(--spacing-md);
}
h1 {
font-size: 1.75rem;
}
}
@media (max-width: 480px) {
form input, form textarea, form button {
padding: var(--spacing-sm);
}
h1 {
font-size: 1.5rem;
}
}