Skip to content

Commit

Permalink
Update rt-html-css-fallback.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ledangtrung committed Dec 19, 2024
1 parent c0bdaf9 commit a5e9753
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions js/rt-html-css-fallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,25 @@ document.addEventListener('DOMContentLoaded', () => {

// Check and set fallback colors if needed
if (!isValidColor(style.getPropertyValue('--primary-color').trim())) {
root.style.setProperty('--primary-color', '#2c3e50');
root.style.setProperty('--secondary-color', '#3498db');
root.style.setProperty('--background-color', '#f8f9fa');
root.style.setProperty('--accent-color', '#f5f5f5');
root.style.setProperty('--primary-color', '#9370DB');
root.style.setProperty('--secondary-color', '#B19CD9');
root.style.setProperty('--background-color', '#FFFFFF');
root.style.setProperty('--accent-color', '#FFA07A');
root.style.setProperty('--surface-color', '#E6E6FA');
root.style.setProperty('--neutral_light-color', '#F5F5F5');
root.style.setProperty('--text_primary-color', '#212121');
root.style.setProperty('--text_secondary-color', '#424242');
}

// Check and set fallback colors if needed
if (!isValidColor(style.getPropertyValue('--color_theme_primary').trim())) {
root.style.setProperty('--color_theme_primary', '#2c3e50');
root.style.setProperty('--color_theme_secondary', '#3498db');
root.style.setProperty('--color_theme_background', '#f8f9fa');
root.style.setProperty('--color_theme_accent', '#f5f5f5');
root.style.setProperty('--color_theme_primary', '#9370DB');
root.style.setProperty('--color_theme_secondary', '#B19CD9');
root.style.setProperty('--color_theme_background', '#FFFFFF');
root.style.setProperty('--color_theme_accent', '#FFA07A');
root.style.setProperty('--color_theme_surface', '#E6E6FA');
root.style.setProperty('--color_theme_neutral_light', '#F5F5F5');
root.style.setProperty('--color_theme_text_primary', '#212121');
root.style.setProperty('--color_theme_text_secondary', '#424242');
}
});

0 comments on commit a5e9753

Please sign in to comment.