-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* themes implementation * home page update * scss update * scss update
- Loading branch information
1 parent
7f2512e
commit 6cbc73d
Showing
10 changed files
with
1,027 additions
and
793 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React, { useEffect } from 'react'; | ||
|
||
export const ThemeSwitcher = () => { | ||
useEffect(() => { | ||
document.getElementsByTagName('html')[0].classList.add('dark-theme'); | ||
document.getElementsByTagName('html')[0].setAttribute('style', 'color-scheme : dark;'); | ||
}, []); | ||
return ( | ||
<a onClick={() => {}}> | ||
<button> | ||
<i | ||
className="fas fa-palette" | ||
onClick={() => { | ||
let isLightTheme = document.getElementsByTagName('html')[0].classList.contains('light-theme'); | ||
document.getElementsByTagName('html')[0].classList.toggle('light-theme'); | ||
document.getElementsByTagName('html')[0].classList.toggle('dark-theme'); | ||
document.getElementsByTagName('html')[0].setAttribute('style', `color-scheme : ${isLightTheme ? 'dark' : 'light'};`); | ||
}} | ||
></i> | ||
</button> | ||
<span className="px-2 small-screen-only">Switch Theme</span> | ||
</a> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
6cbc73d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: