mirror of
https://github.com/forketyfork/obsidian-food-tracker.git
synced 2026-07-22 13:00:26 +00:00
244 lines
4.7 KiB
CSS
244 lines
4.7 KiB
CSS
.food-tracker-total {
|
|
position: sticky;
|
|
bottom: 0;
|
|
background-color: var(--background-secondary);
|
|
border-top: 1px solid var(--background-modifier-border);
|
|
padding: 8px 16px;
|
|
font-size: 0.9em;
|
|
z-index: 1000;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
/* Nutrient modal layout and animations */
|
|
.nutrient-modal {
|
|
transition:
|
|
width 0.3s ease-in-out,
|
|
max-width 0.3s ease-in-out;
|
|
width: min(490px, 90vw);
|
|
max-width: min(490px, 90vw);
|
|
}
|
|
|
|
.nutrient-modal-expanded {
|
|
width: min(920px, 95vw);
|
|
max-width: min(920px, 95vw);
|
|
}
|
|
|
|
.nutrient-modal .modal-content {
|
|
padding: 20px;
|
|
}
|
|
|
|
.nutrient-modal-main {
|
|
display: flex;
|
|
gap: 20px;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.nutrient-form-container {
|
|
flex: 0 0 450px;
|
|
max-width: 450px;
|
|
min-width: min(450px, 50vw);
|
|
padding-right: 20px;
|
|
}
|
|
|
|
.search-results-container {
|
|
flex: 1;
|
|
min-width: min(300px, 40vw);
|
|
max-width: 500px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-self: flex-start;
|
|
height: 100%;
|
|
}
|
|
|
|
.search-results-container.is-visible {
|
|
animation: fadeInRight 0.4s ease-out 0.2s forwards;
|
|
}
|
|
|
|
@keyframes fadeInRight {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateX(20px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateX(0);
|
|
}
|
|
}
|
|
|
|
.search-results {
|
|
height: 100%;
|
|
min-height: 400px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.search-results h3 {
|
|
margin-bottom: 12px;
|
|
color: var(--text-accent);
|
|
}
|
|
|
|
.search-result-item {
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 6px;
|
|
padding: 8px 12px;
|
|
margin-bottom: 6px;
|
|
background-color: var(--background-secondary);
|
|
position: relative;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.search-result-item:hover {
|
|
background-color: var(--background-modifier-hover);
|
|
}
|
|
|
|
.product-name {
|
|
font-weight: bold;
|
|
margin-bottom: 2px;
|
|
color: var(--text-normal);
|
|
font-size: 0.9em;
|
|
}
|
|
|
|
.product-info {
|
|
font-size: 0.75em;
|
|
color: var(--text-faint);
|
|
margin-bottom: 3px;
|
|
font-style: italic;
|
|
}
|
|
|
|
.nutrition-preview {
|
|
font-size: 0.8em;
|
|
color: var(--text-muted);
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.search-error,
|
|
.search-no-results {
|
|
padding: 12px;
|
|
text-align: center;
|
|
color: var(--text-muted);
|
|
font-style: italic;
|
|
}
|
|
|
|
.food-value {
|
|
background-color: rgba(var(--color-purple-rgb), 0.5);
|
|
color: var(--text-on-accent-inverted);
|
|
border-radius: 4px;
|
|
padding: 0 4px;
|
|
}
|
|
|
|
.food-nutrition-value {
|
|
background-color: rgba(var(--color-blue-rgb), 0.5);
|
|
color: var(--text-on-accent-inverted);
|
|
border-radius: 4px;
|
|
padding: 0 4px;
|
|
}
|
|
|
|
/* Search button loading state */
|
|
.setting-item-control button:disabled {
|
|
opacity: 0.6;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* Fixed width for search button to prevent resizing */
|
|
.setting-item-control button[data-search-button] {
|
|
min-width: 110px;
|
|
text-align: center;
|
|
}
|
|
|
|
.food-tracker-progress {
|
|
--food-tracker-progress-percent: 0%;
|
|
--food-tracker-progress-color: var(--background-primary);
|
|
background-image: linear-gradient(
|
|
to right,
|
|
var(--food-tracker-progress-color) var(--food-tracker-progress-percent),
|
|
transparent var(--food-tracker-progress-percent)
|
|
);
|
|
border-radius: 3px;
|
|
padding: 0;
|
|
}
|
|
|
|
.food-tracker-nutrition-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
border: 1px solid var(--food-tracker-progress-color, var(--background-modifier-border));
|
|
border-radius: 6px;
|
|
background-color: var(--background-secondary);
|
|
padding: 2px;
|
|
gap: 2px;
|
|
max-width: fit-content;
|
|
}
|
|
|
|
/* Reusable tooltip utility class */
|
|
.food-tracker-tooltip-host {
|
|
position: relative;
|
|
cursor: help;
|
|
}
|
|
|
|
.food-tracker-tooltip-host::after {
|
|
content: attr(data-tooltip);
|
|
position: absolute;
|
|
bottom: 100%;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
background-color: var(--background-primary);
|
|
color: var(--text-normal);
|
|
padding: 4px 8px;
|
|
border-radius: 4px;
|
|
font-size: 12px;
|
|
white-space: nowrap;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
transition: opacity 0.2s;
|
|
z-index: 1000;
|
|
border: 1px solid var(--background-modifier-border);
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.food-tracker-tooltip-host:hover::after {
|
|
opacity: 1;
|
|
}
|
|
|
|
.food-tracker-icon {
|
|
color: var(--interactive-accent);
|
|
flex-shrink: 0;
|
|
margin-left: 4px;
|
|
margin-right: 6px;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.food-tracker-nutrient-item {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 48px;
|
|
height: 24px;
|
|
font-size: 16px;
|
|
padding: 0;
|
|
border: 1px solid var(--food-tracker-progress-color, var(--background-modifier-border));
|
|
background-color: var(--background-secondary);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.food-tracker-separator {
|
|
display: none;
|
|
}
|
|
|
|
.food-tracker-progress-green {
|
|
--food-tracker-progress-color: var(--color-green, #3a9f4c);
|
|
}
|
|
|
|
.food-tracker-progress-yellow {
|
|
--food-tracker-progress-color: var(--color-yellow, #d8a000);
|
|
}
|
|
|
|
.food-tracker-progress-red {
|
|
--food-tracker-progress-color: var(--color-red, #d84c4c);
|
|
}
|
|
|
|
.goals-value {
|
|
background-color: rgba(var(--color-green-rgb), 0.5);
|
|
color: var(--text-on-accent-inverted);
|
|
border-radius: 4px;
|
|
padding: 0 4px;
|
|
}
|