Skip to content

Commit 9bc330a

Browse files
committed
Define theme switcher on app vue
1 parent d003438 commit 9bc330a

File tree

7 files changed

+45
-47
lines changed

7 files changed

+45
-47
lines changed

src/App.vue

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<template>
2-
<!-- Header Start -->
3-
<Header></Header>
2+
<div :class="appTheme">
3+
<!-- Header Start -->
4+
<Header></Header>
45

5-
<!-- Render Active Component Contents Start -->
6-
<router-view />
6+
<!-- Render Active Component Contents Start -->
7+
<router-view />
78

8-
<!-- Footer Start -->
9-
<Footer></Footer>
9+
<!-- Footer Start -->
10+
<Footer></Footer>
11+
</div>
1012
</template>
1113

1214
<script>
@@ -19,6 +21,11 @@ export default {
1921
Header,
2022
Footer,
2123
},
24+
data: () => {
25+
return {
26+
appTheme: localStorage.getItem('theme'),
27+
};
28+
},
2229
mounted() {
2330
feather.replace();
2431
},
@@ -34,6 +41,5 @@ export default {
3441
-webkit-font-smoothing: antialiased;
3542
-moz-osx-font-smoothing: grayscale;
3643
text-align: center;
37-
color: #2c3e50;
3844
}
3945
</style>

src/assets/css/app.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,26 @@
55

66
.theme-light {
77
/*
8-
** Light Mode: Background Colors Variables
8+
** Light Mode Color Variables
99
*/
1010
--bg-primary: #f7f8fc;
1111
--bg-secondary: #ffffff;
1212
--bg-ternary: #f6f7f8;
13+
14+
--text-primary: #f7f8fc;
15+
--text-secondary: #ffffff;
16+
--text-ternary: #f6f7f8;
1317
}
1418

1519
.theme-dark {
1620
/*
17-
** Dark Mode: Background Colors Variables
21+
** Dark Mode Color Variables
1822
*/
1923
--bg-primary: #0d2438;
2024
--bg-secondary: #102d44;
2125
--bg-ternary: #1e3851;
26+
27+
--text-primary: #0d2438;
28+
--text-secondary: #102d44;
29+
--text-ternary: #1e3851;
2230
}

src/assets/css/tailwind.css

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,3 @@
33
@tailwind components;
44

55
@tailwind utilities;
6-
7-
.theme-light {
8-
/*
9-
** Light Mode: Background Colors Variables
10-
*/
11-
--bg-primary: #f7f8fc;
12-
--bg-secondary: #ffffff;
13-
--bg-ternary: #f6f7f8;
14-
}
15-
16-
.theme-dark {
17-
/*
18-
** Dark Mode: Background Colors Variables
19-
*/
20-
--bg-primary: #0d2438;
21-
--bg-secondary: #102d44;
22-
--bg-ternary: #1e3851;
23-
}

src/components/home/Banner.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
>
66
<div class="w-full sm:w-1/3 text-left">
77
<h1
8-
class="text-3xl sm:text-5xl text-center sm:text-left font-semibold text-gray-700 uppercase"
8+
class="text-3xl sm:text-5xl text-center sm:text-left font-semibold text-ternary-dark dark:text-primary-light uppercase"
99
>
1010
Hi, Iam Stoman
1111
</h1>

src/components/project/ProjectsGrid.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
/>
2424
</div>
2525
<div class="text-center px-4 py-4">
26-
<p class="text-2xl text-gray-600 font-semibold mb-3">
26+
<p
27+
class="text-2xl text-gray-600 dark:text-primary-light font-semibold mb-3"
28+
>
2729
King Health Platform
2830
</p>
2931
<span class="text-lg text-gray-500">Wen Application</span>

src/components/shared/Header.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
</button>
5454
</div>
5555
<div
56-
class="ml-8 bg-gray-50 p-3 shadow-sm rounded-xl cursor-pointer"
56+
class="ml-8 bg-gray-50 px-3 py-2 shadow-sm rounded-xl cursor-pointer"
5757
>
5858
<theme-switcher
5959
:theme="theme"

tailwind.config.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1+
const colors = require('tailwindcss/colors');
2+
13
module.exports = {
2-
purge: {
3-
content: ['./src/**/*.vue', './src/**/*.js', './src/**/*.html'],
4-
},
4+
// purge: [
5+
// './storage/framework/views/*.php',
6+
// './resources/views/**/*.blade.php',
7+
// ],
58
darkMode: 'class',
69
theme: {
710
extend: {
811
colors: {
912
'primary-light': '#F7F8FC',
1013
'secondary-light': '#FFFFFF',
1114
'ternary-light': '#f6f7f8',
15+
1216
'primary-dark': '#0D2438',
1317
'secondary-dark': '#102D44',
1418
'ternary-dark': '#1E3851',
1519
},
16-
},
17-
container: {
18-
padding: {
19-
DEFAULT: '1rem',
20-
sm: '2rem',
21-
lg: '4rem',
22-
xl: '5rem',
23-
'2xl': '6rem',
20+
container: {
21+
padding: {
22+
DEFAULT: '1rem',
23+
sm: '2rem',
24+
lg: '5rem',
25+
xl: '6rem',
26+
'2xl': '8rem',
27+
},
2428
},
2529
},
2630
},
2731
variants: {
28-
extend: {},
32+
extend: { opacity: ['disabled'] },
2933
},
30-
plugins: [
31-
require('@tailwindcss/forms')({
32-
strategy: 'class',
33-
}),
34-
],
34+
plugins: [require('@tailwindcss/forms')],
3535
};

0 commit comments

Comments
 (0)