feat(ui): add comprehensive webhook settings styling

- Create dedicated webhook-settings.css with modern design system
- Add webhook styles to CSS build process in build-css.mjs
- Implement card-based layout for webhook list and modal
- Add proper spacing, colors, and hover effects
- Use Obsidian design tokens for consistent theming
This commit is contained in:
Callum Alpass 2025-08-13 10:37:02 +10:00
parent c39de07ec6
commit b3c8e4963a
2 changed files with 576 additions and 0 deletions

View file

@ -31,6 +31,7 @@ const CSS_FILES = [
'styles/pomodoro-view.css', // PomodoroView component with proper BEM scoping
'styles/pomodoro-stats-view.css', // PomodoroStatsView component with proper BEM scoping
'styles/settings-view.css', // SettingsView component with proper BEM scoping
'styles/webhook-settings.css', // Webhook settings UI with proper BEM scoping
'styles/status-bar.css' // StatusBar component with proper BEM scoping
];

575
styles/webhook-settings.css Normal file
View file

@ -0,0 +1,575 @@
/*
* Webhook Settings UI Styles
* Modern, clean styling for the webhook configuration interface
*/
/* Webhook Container */
.tasknotes-webhooks-container {
display: flex;
flex-direction: column;
gap: 1rem;
margin-top: 1rem;
}
/* Empty State */
.tasknotes-webhooks-empty-state {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 2rem;
background: var(--background-modifier-form-field);
border: 1px dashed var(--background-modifier-border);
border-radius: 8px;
color: var(--text-muted);
font-size: 0.9rem;
}
.tasknotes-webhooks-empty-icon {
display: flex;
align-items: center;
opacity: 0.6;
}
.tasknotes-webhooks-empty-text {
flex: 1;
}
/* Webhook Card */
.tasknotes-webhook-card {
background: var(--background-primary);
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
padding: 0;
overflow: hidden;
transition: all 0.2s ease;
}
.tasknotes-webhook-card:hover {
border-color: var(--interactive-accent);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
/* Webhook Header */
.tasknotes-webhook-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.25rem;
background: var(--background-secondary);
border-bottom: 1px solid var(--background-modifier-border);
}
.tasknotes-webhook-url-section {
display: flex;
align-items: center;
gap: 0.5rem;
flex: 1;
min-width: 0;
}
.tasknotes-webhook-url-icon {
display: flex;
align-items: center;
color: var(--text-muted);
flex-shrink: 0;
}
.tasknotes-webhook-url {
font-family: var(--font-monospace);
font-size: 0.85rem;
color: var(--text-normal);
font-weight: 500;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.tasknotes-webhook-status-section {
display: flex;
align-items: center;
flex-shrink: 0;
}
.tasknotes-webhook-status-indicator {
display: flex;
align-items: center;
gap: 0.375rem;
padding: 0.25rem 0.75rem;
border-radius: 16px;
font-size: 0.8rem;
font-weight: 500;
}
.tasknotes-webhook-status-indicator.active {
background: var(--color-green-rgb);
background: rgba(var(--color-green-rgb), 0.15);
color: var(--color-green);
}
.tasknotes-webhook-status-indicator.inactive {
background: var(--color-red-rgb);
background: rgba(var(--color-red-rgb), 0.15);
color: var(--color-red);
}
.tasknotes-webhook-status-icon {
display: flex;
align-items: center;
}
.tasknotes-webhook-status-text {
font-weight: 500;
}
/* Webhook Content */
.tasknotes-webhook-content {
padding: 1rem 1.25rem;
}
.tasknotes-webhook-detail-row {
display: flex;
align-items: flex-start;
gap: 0.75rem;
margin-bottom: 0.75rem;
padding: 0.5rem 0;
}
.tasknotes-webhook-detail-row:last-child {
margin-bottom: 0;
}
.tasknotes-webhook-detail-row.warning {
background: rgba(var(--color-yellow-rgb), 0.1);
border-radius: 4px;
padding: 0.5rem 0.75rem;
margin-left: -0.75rem;
margin-right: -0.75rem;
}
.tasknotes-webhook-detail-icon {
display: flex;
align-items: center;
color: var(--text-muted);
margin-top: 1px;
flex-shrink: 0;
}
.tasknotes-webhook-detail-label {
font-weight: 500;
color: var(--text-normal);
min-width: 5rem;
flex-shrink: 0;
}
.tasknotes-webhook-detail-value {
color: var(--text-muted);
word-break: break-all;
flex: 1;
}
.tasknotes-webhook-detail-warning {
color: var(--color-yellow);
font-weight: 500;
}
/* Webhook Statistics */
.tasknotes-webhook-stats {
display: flex;
gap: 1rem;
}
.tasknotes-webhook-stat-success,
.tasknotes-webhook-stat-failure {
display: flex;
align-items: center;
gap: 0.25rem;
font-size: 0.85rem;
}
.tasknotes-webhook-stat-success {
color: var(--color-green);
}
.tasknotes-webhook-stat-failure {
color: var(--color-red);
}
.tasknotes-webhook-stat-icon {
display: flex;
align-items: center;
}
/* Webhook Actions */
.tasknotes-webhook-actions {
display: flex;
gap: 0.5rem;
padding: 1rem 1.25rem;
background: var(--background-modifier-form-field);
border-top: 1px solid var(--background-modifier-border);
}
.tasknotes-webhook-action-btn {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
border: 1px solid var(--background-modifier-border);
border-radius: 4px;
background: var(--background-primary);
color: var(--text-normal);
font-size: 0.85rem;
cursor: pointer;
transition: all 0.2s ease;
}
.tasknotes-webhook-action-btn:hover {
background: var(--background-modifier-hover);
border-color: var(--interactive-accent);
}
.tasknotes-webhook-action-btn.enable {
background: var(--color-green);
color: white;
border-color: var(--color-green);
}
.tasknotes-webhook-action-btn.enable:hover {
background: var(--color-green);
opacity: 0.9;
}
.tasknotes-webhook-action-btn.disable {
background: var(--color-orange);
color: white;
border-color: var(--color-orange);
}
.tasknotes-webhook-action-btn.disable:hover {
background: var(--color-orange);
opacity: 0.9;
}
.tasknotes-webhook-action-btn.delete {
background: var(--color-red);
color: white;
border-color: var(--color-red);
}
.tasknotes-webhook-action-btn.delete:hover {
background: var(--color-red);
opacity: 0.9;
}
.tasknotes-webhook-action-icon {
display: flex;
align-items: center;
}
.tasknotes-webhook-action-text {
font-weight: 500;
}
/* Webhook Modal */
.tasknotes-webhook-modal {
max-width: 600px;
width: 90vw;
box-sizing: border-box;
}
.tasknotes-webhook-modal * {
box-sizing: border-box;
max-width: 100%;
}
/* Better styling for Settings in modal */
.tasknotes-webhook-modal .setting-item {
padding: 1rem;
margin-bottom: 0.75rem;
background: var(--background-modifier-form-field);
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
transition: all 0.2s ease;
}
.tasknotes-webhook-modal .setting-item:hover {
border-color: var(--interactive-accent);
background: var(--background-modifier-hover);
}
.tasknotes-webhook-modal .setting-item:last-child {
margin-bottom: 0;
}
.tasknotes-webhook-modal .setting-item-info {
margin-right: 1rem;
}
.tasknotes-webhook-modal .setting-item-name {
font-weight: 500;
margin-bottom: 0.25rem;
color: var(--text-normal);
}
.tasknotes-webhook-modal .setting-item-description {
font-size: 0.85rem;
color: var(--text-muted);
line-height: 1.4;
}
.tasknotes-webhook-modal-header {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 2rem;
padding-bottom: 1.25rem;
border-bottom: 2px solid var(--background-modifier-border);
}
.tasknotes-webhook-modal-icon {
display: flex;
align-items: center;
color: var(--interactive-accent);
padding: 0.5rem;
background: rgba(var(--interactive-accent-rgb), 0.1);
border-radius: 8px;
}
.tasknotes-webhook-modal-title {
margin: 0;
color: var(--text-normal);
font-size: 1.4rem;
font-weight: 600;
}
.tasknotes-webhook-modal-section {
margin-bottom: 2rem;
width: 100%;
overflow: hidden;
}
.tasknotes-webhook-modal-subsection-header {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 1.5rem;
padding: 0.75rem 0;
border-bottom: 1px solid var(--background-modifier-border-hover);
}
.tasknotes-webhook-modal-subsection-header span {
color: var(--interactive-accent);
padding: 0.25rem;
background: rgba(var(--interactive-accent-rgb), 0.1);
border-radius: 4px;
}
.tasknotes-webhook-modal-subsection-header h3 {
margin: 0;
font-size: 1.1rem;
font-weight: 600;
color: var(--text-normal);
}
/* Events List */
.tasknotes-webhook-events-list {
margin-top: 1rem;
max-width: 100%;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
/* Transform Help */
.tasknotes-webhook-transform-help {
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
padding: 1.25rem;
margin-top: 1rem;
max-width: 100%;
overflow-wrap: break-word;
word-wrap: break-word;
}
.tasknotes-webhook-help-header {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.75rem;
font-weight: 500;
}
.tasknotes-webhook-help-list {
margin: 0.75rem 0;
padding-left: 1.25rem;
}
.tasknotes-webhook-help-list li {
margin-bottom: 0.5rem;
line-height: 1.4;
word-wrap: break-word;
overflow-wrap: break-word;
}
.tasknotes-webhook-help-example {
margin-top: 0.75rem;
padding-top: 0.75rem;
border-top: 1px solid var(--background-modifier-border);
font-size: 0.9rem;
word-wrap: break-word;
overflow-wrap: break-word;
}
/* Modal Buttons */
.tasknotes-webhook-modal-buttons {
display: flex;
gap: 0.75rem;
justify-content: flex-end;
margin-top: 2rem;
padding-top: 1.5rem;
border-top: 1px solid var(--background-modifier-border);
flex-wrap: wrap;
}
.tasknotes-webhook-modal-btn {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.875rem 1.5rem;
border: 1px solid var(--background-modifier-border);
border-radius: 6px;
background: var(--background-primary);
color: var(--text-normal);
font-size: 0.9rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
white-space: nowrap;
min-width: 0;
flex-shrink: 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.tasknotes-webhook-modal-btn:hover {
background: var(--background-modifier-hover);
border-color: var(--interactive-accent);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
transform: translateY(-1px);
}
.tasknotes-webhook-modal-btn.cancel {
background: var(--background-secondary);
border-color: var(--background-modifier-border-hover);
}
.tasknotes-webhook-modal-btn.cancel:hover {
background: var(--background-modifier-hover);
}
.tasknotes-webhook-modal-btn.save {
background: var(--interactive-accent);
color: var(--text-on-accent);
border-color: var(--interactive-accent);
}
.tasknotes-webhook-modal-btn.save:hover {
background: var(--interactive-accent-hover);
border-color: var(--interactive-accent-hover);
}
.tasknotes-webhook-modal-btn-icon {
display: flex;
align-items: center;
}
/* Secret Notice */
.tasknotes-webhook-secret-notice {
padding: 1rem;
}
.tasknotes-webhook-secret-title {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.75rem;
font-weight: 500;
color: var(--color-green);
}
.tasknotes-webhook-secret-content {
font-size: 0.9rem;
line-height: 1.4;
}
.tasknotes-webhook-secret-code {
background: var(--background-modifier-form-field);
border: 1px solid var(--background-modifier-border);
border-radius: 3px;
padding: 0.2rem 0.4rem;
font-family: var(--font-monospace);
font-size: 0.85rem;
margin: 0 0.25rem;
}
/* Responsive Design */
@media (max-width: 768px) {
.tasknotes-webhook-modal {
max-width: 95vw;
width: 95vw;
}
.tasknotes-webhook-card {
margin: 0 -0.5rem;
}
.tasknotes-webhook-header {
flex-direction: column;
align-items: flex-start;
gap: 0.75rem;
}
.tasknotes-webhook-url-section {
width: 100%;
}
.tasknotes-webhook-modal-buttons {
flex-direction: column;
}
.tasknotes-webhook-modal-btn {
width: 100%;
justify-content: center;
}
.tasknotes-webhook-stats {
flex-direction: column;
gap: 0.5rem;
}
}
/* Dark theme adjustments */
.theme-dark .tasknotes-webhook-card:hover {
box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}
/* Accessibility improvements */
.tasknotes-webhook-action-btn:focus,
.tasknotes-webhook-modal-btn:focus {
outline: 2px solid var(--interactive-accent);
outline-offset: 2px;
}
/* Animation for status changes */
.tasknotes-webhook-status-indicator {
transition: all 0.3s ease;
}
.tasknotes-webhook-card {
transition: all 0.2s ease, transform 0.2s ease;
}
.tasknotes-webhook-card:hover {
transform: translateY(-1px);
}