Skip to content

Commit a8cee80

Browse files
removing auto-dark-mode. i tried.
1 parent 0310811 commit a8cee80

File tree

6 files changed

+22
-204
lines changed

6 files changed

+22
-204
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ watch:
2929
watch-vite:
3030
vite
3131

32-
$(BUILD)/index.html: $(allsrc) index.html scripts/gen-theme.cjs *.config.js *.config.cjs
32+
$(BUILD)/index.html: $(allsrc) index.html *.config.js *.config.cjs
3333
@$(MKDIR)
3434
vite build
3535

scripts/gen-theme.cjs

Lines changed: 0 additions & 85 deletions
This file was deleted.

src/components/form/Input.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
const height = 'h-12';
3232
const height_class = is_textarea ? '' : height;
3333
const padding_top_class = is_textarea ? '' : 'pt-4';
34-
const color_class = error ? color('text-red-700') : color('text-black');
35-
const label_color_class = disabled ? color('text-slate-400') : color('text-black');
36-
const border_class = error ? color('border-b-red-600') : color('border-b-slate-300');
34+
const color_class = error ? 'text-red-700 dark:text-red-200' : 'text-black dark:text-white';
35+
const label_color_class = disabled ? 'text-slate-400 dark:text-slate-500' : 'text-black dark:text-white';
36+
const border_class = error ? 'border-b-red-600 dark:border-b-red-300' : 'border-b-slate-300 dark:border-b-slate-600';
3737
const padding_left = icon ? 'pl-11' : 'pl-4';
3838
const padding_right = icon_trailing ? 'pr-11' : 'pr-4';
3939
const pointer_events_class = is_textarea ? 'pointer-events-auto' : '';
@@ -55,7 +55,7 @@
5555
</script>
5656

5757
<div class="mb-6">
58-
<div class="relative {container_padding_class} {color('bg-slate-200/50')}">
58+
<div class="relative {container_padding_class} bg-slate-200/50 bg-slate-700/50">
5959
{#if icon}
6060
<div class="absolute z-0 top-0 bottom-0 left-0 ml-4 flex items-center {icon_class || ''}">
6161
<icon class="text-xl">{icon}</icon>
@@ -64,7 +64,7 @@
6464
<svelte:element this={tag}
6565
on:input={handle_input}
6666
use:set_value={value}
67-
class="relative z-10 block {height_class} w-full {padding_top_class} {color_class} border-b-2 {border_class} text-base {padding_left} {padding_right} bg-transparent focus:outline-none {color('focus:border-b-primary')} transition-colors {klass}"
67+
class="relative z-10 block {height_class} w-full {padding_top_class} {color_class} border-b-2 {border_class} text-base {padding_left} {padding_right} bg-transparent focus:outline-none focus:border-b-primary dark:focus:border-b-primary transition-colors {klass}"
6868
{name}
6969
{type}
7070
value="{value}"
@@ -91,7 +91,7 @@
9191
input:focus + label div,
9292
input[value]:not([value=""]) + label div,
9393
textarea:focus + label div,
94-
textarea[value]:not([value=""]) + label div {@apply text-sm text-primary-700 dark:text-primary-dark-700 -translate-y-[60%];}
94+
textarea[value]:not([value=""]) + label div {@apply text-sm text-primary-700 dark:text-primary-200 -translate-y-[60%];}
9595
textarea:focus + label div,
9696
textarea[value]:not([value=""]) + label div {@apply pointer-events-auto;}
9797
</style>

src/theme.cjs

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/util/theme.cjs

Lines changed: 0 additions & 67 deletions
This file was deleted.

tailwind.config.cjs

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,30 @@
11
const production = process.env.ENV === 'prod';
2-
const gen_theme = require('./scripts/gen-theme.cjs');
3-
const default_extractor = require('tailwindcss/lib/lib/defaultExtractor').defaultExtractor;
4-
const color = require('./src/util/theme.cjs').color;
52

6-
const extractor = default_extractor({
7-
tailwindConfig: {
8-
separator: '',
9-
prefix: '',
10-
},
11-
});
12-
13-
const theme = gen_theme.gen();
143
const config = {
154
content: {
165
files: [
176
'./index.html',
187
'./src/**/*.{html,js,svelte}',
198
],
20-
extract: {
21-
svelte: (content) => {
22-
const rules = extractor(content);
23-
const expanded = [];
24-
rules.forEach((rule) => {
25-
color(rule, () => {}).split(' ').forEach((split) => {
26-
expanded.push(split);
27-
});
28-
});
29-
return expanded;
30-
},
31-
},
329
},
3310
darkMode: 'class',
3411
theme: {
3512
extend: {
36-
colors: theme.colors,
13+
colors: {
14+
primary: {
15+
DEFAULT: "#8fc46a",
16+
'50': '#f2f8ee',
17+
'100': '#e7f2df',
18+
'200': '#d1e7c2',
19+
'300': '#bbdba4',
20+
'400': '#a5d087',
21+
'500': '#8fc46a',
22+
'600': '#71b046',
23+
'700': '#588836',
24+
'800': '#3e6026',
25+
'900': '#243816'
26+
},
27+
},
3728
},
3829
},
3930
variants: {

0 commit comments

Comments
 (0)