Skip to content

Commit

Permalink
feat: change color attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Oct 7, 2024
1 parent 062bb86 commit f1b134d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export const theme = (() => {
theme.set('active', THEME_LIGHT);
document.documentElement.setAttribute('data-bs-theme', THEME_LIGHT);

// --bs-gray-100
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#f8f9fa');
document.querySelector('meta[name="color-scheme"]').setAttribute('content', THEME_LIGHT);

const elements = document.querySelectorAll('.text-light, .btn-theme-light, .bg-dark, .bg-black, .bg-theme-dark, .color-theme-black, .btn-outline-light, .bg-cover-black');
elements.forEach((element) => {
if (element.classList.contains('text-light')) {
Expand Down Expand Up @@ -59,6 +63,10 @@ export const theme = (() => {
theme.set('active', THEME_DARK);
document.documentElement.setAttribute('data-bs-theme', THEME_DARK);

// --bs-gray-800
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#343a40');
document.querySelector('meta[name="color-scheme"]').setAttribute('content', THEME_DARK);

const elements = document.querySelectorAll('.text-dark, .btn-theme-dark, .bg-light, .bg-white, .bg-theme-light, .color-theme-white, .btn-outline-dark, .bg-cover-white');
elements.forEach((element) => {
if (element.classList.contains('text-dark')) {
Expand Down

0 comments on commit f1b134d

Please sign in to comment.