Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customizable background and font colors #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Brief description of what is fixed or changed
_Put an `x` in the boxes that apply_

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ x ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update (Documentation content changed)
- [ ] Other (please describe):
Expand All @@ -20,11 +20,11 @@ _Put an `x` in the boxes that apply_

_Put an `x` in the boxes that apply_

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ x ] My code follows the style guidelines of this project
- [ x ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ x ] My changes generate no new warnings

## Screenshots

Expand Down
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"description": "",
"main": "build/index.js",
"scripts": {
"build": "webpack"
"build": "webpack",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"keywords": [
"Dark theme",
Expand Down Expand Up @@ -36,6 +38,7 @@
"webpack-cli": "^3.3.6"
},
"dependencies": {
"@babel/preset-env": "^7.5.4"
"@babel/preset-env": "^7.5.4",
"react-dark": "^1.0.9"
}
}
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Darktheme extends Component {

switchTheme(e) {
if (e.target.checked) {
document.documentElement.setAttribute("data-theme", "dark");
localStorage.setItem("theme", "dark");
document.documentElement.setAttribute("data-theme", "blue");
localStorage.setItem("theme", "blue");
} else {
document.documentElement.setAttribute("data-theme", "normal");
localStorage.setItem("theme", "normal");
Expand All @@ -24,11 +24,12 @@ class Darktheme extends Component {

onChange(e) {
this.switchTheme(e);
console.log('hello')
}

render() {
return (
<div className="App">
<div className="App" >
<label className="switch">
<input type="checkbox" onChange={e => this.onChange(e)} />
<span className="slider round"></span>
Expand Down
Loading