Arunkumar-60 / Arunkumar-60/CCW_Express
issue with the theme toggle button in the nav bar
- Dominant language
- EJS
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
step 1 :
fork the repository for code.
step 2 :
install packages via terminal at the root directory of this repository file on ur local device.
$ `npm install ejs express bootstrap express-ejs-layouts`
$ `npm i --save-dev nodemon`
step 3 :
$ `npm start`
(to run the server at port 3000)
step 4 :
the code runs on port 3000, http://localhost:3000/ on your local device (web browser)
step 5 :
location for files that takes care of the theme and code
1. views -> partials -> header.ejs ( the toggle button is on line 11 - 21).
`
2. views -> layouts -> layout.ejs (line 21 (body tag is where I defined the theme attribute)).
``
3. public -> js -> index.js (is the function on line 2 - 6 ).
`function myFunction() {
var element = document.body;
element.dataset.bsTheme =
element.dataset.bsTheme == "light" ? "dark" : "light";
}`
issue description: I want the session to start with dark theme , if the user decides to switch to light theme he should be able to do that , but once is switches to a different page he needs to retain the theme of his choice.
Contributor guide
No contributing guide indexed for this repository
Research direction
Run the application with npm install and npm start, then inspect views/partials/header.ejs, views/layouts/layout.ejs, and public/js/index.js. Trace the existing theme toggle across page navigation and make the selected light or dark theme persist when moving between pages, while keeping dark as the initial theme.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bootstrap, express, javascript, node.js
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100