From 88a40e0052d3cb2bd0eb4fecf9672dc317ca8e00 Mon Sep 17 00:00:00 2001 From: myoualid Date: Fri, 6 Sep 2024 20:51:46 +0100 Subject: [PATCH] improve cost table responsiveness and highlight currently loaded cost schedule --- .../webui/static/css/components/costTable.css | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 src/bonsai/bonsai/bim/data/webui/static/css/components/costTable.css diff --git a/src/bonsai/bonsai/bim/data/webui/static/css/components/costTable.css b/src/bonsai/bonsai/bim/data/webui/static/css/components/costTable.css new file mode 100644 index 0000000000..0d6f616ddf --- /dev/null +++ b/src/bonsai/bonsai/bim/data/webui/static/css/components/costTable.css @@ -0,0 +1,115 @@ +table { + width: 100%; + border-collapse: collapse; + user-select: none; +} + +td, th { + border: 1px solid #ddd; + padding: 8px; + text-align: left; +} + +td { + align-items: center; +} + +/* first td of a row, must be flex */ +td:first-child { + display: flex; + align-items: center; +} + +.nested { + display: none; +} + +.expand-collapse { + cursor: pointer; +} + +.caret-cell { + border: none; + background: none; + padding: 0; +} + +input, select { + background-color: var(--blender-button-background, var(--bg-color)); + color: var(--blender-button-text, var(--text-color)); + border-color: var(--blender-button-border, var(--border-color)); + transition: filter 0.2s ease; + border-radius: 6px; + padding: 6px 8px; + font-size: 14px; + line-height: 20px; + transition: border-color 0.2s cubic-bezier(0.3, 0, 0.5, 1); + height: inherit; + margin-left: 0.5em; + margin-right: 0.5em; + + min-width: 50px; /* Minimum width to prevent it from becoming too small */ + +} + +input:focus { + border-color: #28a745; + outline: none; + box-shadow: 0 0 0 3px #28a745; +} + +#cost-items tr:hover, .highlighted { + background-color: #ffb936; + color : black; +} + +.highlight { + background-color: #ffb936; + color : black; +} + +.cost-values-table { + width: 100%; + border-collapse: collapse; +} + +.cost-values-table th, .cost-values-table td { + border: 1px solid #ddd; + padding: 8px; +} + +.cost-values-table th { + background-color: #444444; + text-align: center; +} +/* Responsive Styles */ +@media (max-width: 768px) { + table { + font-size: 12px; + } + + td, th { + padding: 4px; + } + + input { + padding: 2px; + font-size: 12px; + } + +} + +@media (max-width: 480px) { + table { + font-size: 10px; + } + + td, th { + padding: 2px; + } + + input { + padding: 1px; + font-size: 10px; + } +} \ No newline at end of file