fixed star colours

This commit is contained in:
2025-05-27 14:49:55 +02:00
parent 17e1c4181f
commit 91a70a720c
3 changed files with 9 additions and 7 deletions

View File

@@ -33,7 +33,9 @@
--text-dark: #333333;
--text-muted: #6c757d;
--warning-color: #ffd700;
--warning-opacity-15: rgba(255, 215, 0, 0.15);
--danger-color: #dc3545;
--danger-opacity-15: rgba(220, 53, 69, 0.15);
--shadow-color: rgba(0, 0, 0, 0.1);
--shadow-color-light: rgba(0, 0, 0, 0.25);
--border-color: #dee2e6;

View File

@@ -1210,9 +1210,9 @@ function toggleStar(filename, path) {
// Get the current state from the button's title
const isStarred = starButton.title === 'Unstar';
// Update button appearance
starButton.style.backgroundColor = isStarred ? 'rgba(22,118,123,0.08)' : 'rgba(255,215,0,0.15)';
starButton.style.color = isStarred ? '#16767b' : '#ffd700';
// Update button appearance using CSS variables
starButton.style.backgroundColor = isStarred ? 'var(--primary-opacity-8)' : 'var(--warning-opacity-15)';
starButton.style.color = isStarred ? 'var(--primary-color)' : 'var(--warning-color)';
starButton.title = isStarred ? 'Star' : 'Unstar';
}
@@ -1245,8 +1245,8 @@ function toggleStar(filename, path) {
// Revert the button if the server request failed
if (starButton) {
const isStarred = starButton.title === 'Unstar';
starButton.style.backgroundColor = isStarred ? 'rgba(22,118,123,0.08)' : 'rgba(255,215,0,0.15)';
starButton.style.color = isStarred ? '#16767b' : '#ffd700';
starButton.style.backgroundColor = isStarred ? 'var(--primary-opacity-8)' : 'var(--warning-opacity-15)';
starButton.style.color = isStarred ? 'var(--primary-color)' : 'var(--warning-color)';
starButton.title = isStarred ? 'Star' : 'Unstar';
}
console.error('Failed to toggle star:', data.error);
@@ -1256,8 +1256,8 @@ function toggleStar(filename, path) {
// Revert the button if there was an error
if (starButton) {
const isStarred = starButton.title === 'Unstar';
starButton.style.backgroundColor = isStarred ? 'rgba(22,118,123,0.08)' : 'rgba(255,215,0,0.15)';
starButton.style.color = isStarred ? '#16767b' : '#ffd700';
starButton.style.backgroundColor = isStarred ? 'var(--primary-opacity-8)' : 'var(--warning-opacity-15)';
starButton.style.color = isStarred ? 'var(--primary-color)' : 'var(--warning-color)';
starButton.title = isStarred ? 'Star' : 'Unstar';
}
console.error('Error toggling star:', error);