Skip to content

Commit efdb51b

Browse files
committed
Fix: theme issue
1 parent 6c4b69f commit efdb51b

File tree

4 files changed

+246
-54
lines changed

4 files changed

+246
-54
lines changed

.astro/content.d.ts

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
declare module 'astro:content' {
2+
interface Render {
3+
'.mdx': Promise<{
4+
Content: import('astro').MarkdownInstance<{}>['Content'];
5+
headings: import('astro').MarkdownHeading[];
6+
remarkPluginFrontmatter: Record<string, any>;
7+
components: import('astro').MDXInstance<{}>['components'];
8+
}>;
9+
}
10+
}
11+
12+
declare module 'astro:content' {
13+
export interface RenderResult {
14+
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
15+
headings: import('astro').MarkdownHeading[];
16+
remarkPluginFrontmatter: Record<string, any>;
17+
}
18+
interface Render {
19+
'.md': Promise<RenderResult>;
20+
}
21+
22+
export interface RenderedContent {
23+
html: string;
24+
metadata?: {
25+
imagePaths: Array<string>;
26+
[key: string]: unknown;
27+
};
28+
}
29+
}
30+
31+
declare module 'astro:content' {
32+
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
33+
34+
export type CollectionKey = keyof AnyEntryMap;
35+
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
36+
37+
export type ContentCollectionKey = keyof ContentEntryMap;
38+
export type DataCollectionKey = keyof DataEntryMap;
39+
40+
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
41+
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
42+
ContentEntryMap[C]
43+
>['slug'];
44+
45+
/** @deprecated Use `getEntry` instead. */
46+
export function getEntryBySlug<
47+
C extends keyof ContentEntryMap,
48+
E extends ValidContentEntrySlug<C> | (string & {}),
49+
>(
50+
collection: C,
51+
// Note that this has to accept a regular string too, for SSR
52+
entrySlug: E,
53+
): E extends ValidContentEntrySlug<C>
54+
? Promise<CollectionEntry<C>>
55+
: Promise<CollectionEntry<C> | undefined>;
56+
57+
/** @deprecated Use `getEntry` instead. */
58+
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
59+
collection: C,
60+
entryId: E,
61+
): Promise<CollectionEntry<C>>;
62+
63+
export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
64+
collection: C,
65+
filter?: (entry: CollectionEntry<C>) => entry is E,
66+
): Promise<E[]>;
67+
export function getCollection<C extends keyof AnyEntryMap>(
68+
collection: C,
69+
filter?: (entry: CollectionEntry<C>) => unknown,
70+
): Promise<CollectionEntry<C>[]>;
71+
72+
export function getEntry<
73+
C extends keyof ContentEntryMap,
74+
E extends ValidContentEntrySlug<C> | (string & {}),
75+
>(entry: {
76+
collection: C;
77+
slug: E;
78+
}): E extends ValidContentEntrySlug<C>
79+
? Promise<CollectionEntry<C>>
80+
: Promise<CollectionEntry<C> | undefined>;
81+
export function getEntry<
82+
C extends keyof DataEntryMap,
83+
E extends keyof DataEntryMap[C] | (string & {}),
84+
>(entry: {
85+
collection: C;
86+
id: E;
87+
}): E extends keyof DataEntryMap[C]
88+
? Promise<DataEntryMap[C][E]>
89+
: Promise<CollectionEntry<C> | undefined>;
90+
export function getEntry<
91+
C extends keyof ContentEntryMap,
92+
E extends ValidContentEntrySlug<C> | (string & {}),
93+
>(
94+
collection: C,
95+
slug: E,
96+
): E extends ValidContentEntrySlug<C>
97+
? Promise<CollectionEntry<C>>
98+
: Promise<CollectionEntry<C> | undefined>;
99+
export function getEntry<
100+
C extends keyof DataEntryMap,
101+
E extends keyof DataEntryMap[C] | (string & {}),
102+
>(
103+
collection: C,
104+
id: E,
105+
): E extends keyof DataEntryMap[C]
106+
? string extends keyof DataEntryMap[C]
107+
? Promise<DataEntryMap[C][E]> | undefined
108+
: Promise<DataEntryMap[C][E]>
109+
: Promise<CollectionEntry<C> | undefined>;
110+
111+
/** Resolve an array of entry references from the same collection */
112+
export function getEntries<C extends keyof ContentEntryMap>(
113+
entries: {
114+
collection: C;
115+
slug: ValidContentEntrySlug<C>;
116+
}[],
117+
): Promise<CollectionEntry<C>[]>;
118+
export function getEntries<C extends keyof DataEntryMap>(
119+
entries: {
120+
collection: C;
121+
id: keyof DataEntryMap[C];
122+
}[],
123+
): Promise<CollectionEntry<C>[]>;
124+
125+
export function render<C extends keyof AnyEntryMap>(
126+
entry: AnyEntryMap[C][string],
127+
): Promise<RenderResult>;
128+
129+
export function reference<C extends keyof AnyEntryMap>(
130+
collection: C,
131+
): import('astro/zod').ZodEffects<
132+
import('astro/zod').ZodString,
133+
C extends keyof ContentEntryMap
134+
? {
135+
collection: C;
136+
slug: ValidContentEntrySlug<C>;
137+
}
138+
: {
139+
collection: C;
140+
id: keyof DataEntryMap[C];
141+
}
142+
>;
143+
// Allow generic `string` to avoid excessive type errors in the config
144+
// if `dev` is not running to update as you edit.
145+
// Invalid collection names will be caught at build time.
146+
export function reference<C extends string>(
147+
collection: C,
148+
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
149+
150+
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
151+
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
152+
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
153+
>;
154+
155+
type ContentEntryMap = {
156+
157+
};
158+
159+
type DataEntryMap = {
160+
"articles": Record<string, {
161+
id: string;
162+
body?: string;
163+
collection: "articles";
164+
data: InferEntrySchema<"articles">;
165+
rendered?: RenderedContent;
166+
filePath?: string;
167+
}>;
168+
"blogs": Record<string, {
169+
id: string;
170+
body?: string;
171+
collection: "blogs";
172+
data: InferEntrySchema<"blogs">;
173+
rendered?: RenderedContent;
174+
filePath?: string;
175+
}>;
176+
177+
};
178+
179+
type AnyEntryMap = ContentEntryMap & DataEntryMap;
180+
181+
export type ContentConfig = typeof import("../src/content.config.js");
182+
}

src/assets/styles/bharat-map/components/controls.css

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@
55
display: flex;
66
gap: 12px;
77
z-index: 100;
8-
background: rgba(255, 255, 255, 0.9);
8+
background: color-mix(in srgb, var(--modal-bg) 90%, transparent);
99
padding: 8px;
1010
border-radius: 12px;
1111
backdrop-filter: blur(4px);
12-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
12+
box-shadow: 0 2px 8px var(--shadow-color);
1313
}
1414

15-
.zoom-button,
16-
.theme-toggle {
17-
background: white;
18-
border: 1px solid #4f46e5;
19-
color: #4f46e5;
15+
.zoom-button {
16+
background: var(--modal-bg);
17+
border: 1px solid var(--primary-color);
18+
color: var(--primary-color);
2019
width: 36px;
2120
height: 36px;
2221
border-radius: 8px;
@@ -25,13 +24,12 @@
2524
justify-content: center;
2625
cursor: pointer;
2726
transition: all 0.2s ease;
28-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
27+
box-shadow: 0 2px 4px var(--shadow-color);
2928
}
3029

31-
.zoom-button:hover,
32-
.theme-toggle:hover {
33-
background: #4f46e5;
34-
color: white;
30+
.zoom-button:hover {
31+
background: var(--primary-color);
32+
color: var(--modal-bg);
3533
transform: translateY(-2px);
3634
}
3735

@@ -40,15 +38,13 @@
4038
background: rgba(30, 41, 59, 0.9);
4139
}
4240

43-
[data-theme="dark"] .theme-toggle,
4441
[data-theme="dark"] .zoom-button {
4542
background: #1e293b;
4643
border-color: #818cf8;
4744
color: #818cf8;
4845
}
4946

50-
[data-theme="dark"] .theme-toggle:hover,
5147
[data-theme="dark"] .zoom-button:hover {
5248
background: #818cf8;
5349
color: #0f172a;
54-
}
50+
}
Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Map container and SVG styles */
22
.map-container {
3-
background: white;
3+
background: var(--modal-bg);
44
margin: 1rem;
55
padding: 1rem;
66
border-radius: 16px;
7-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
7+
box-shadow: 0 2px 8px var(--shadow-color);
88
flex: 1;
99
display: flex;
1010
align-items: center;
@@ -14,7 +14,7 @@
1414
svg {
1515
width: 100%;
1616
height: 100%;
17-
border: 1px solid #e1e8ef;
17+
border: 1px solid var(--border-color);
1818
border-radius: 12px;
1919
padding: 1rem;
2020
margin: 0 auto;
@@ -23,23 +23,23 @@ svg {
2323

2424
/* State and capital styling */
2525
.state {
26-
fill: #c7d2fe;
27-
stroke: #4f46e5;
26+
fill: var(--modal-details-bg);
27+
stroke: var(--primary-color);
2828
stroke-width: 0.5;
2929
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
3030
}
3131

3232
.state:hover {
3333
opacity: 0.8;
34-
fill: #6366f1;
34+
fill: var(--secondary-color);
3535
cursor: pointer;
3636
transform: translateY(-2px);
37-
filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
37+
filter: drop-shadow(0 4px 6px var(--shadow-color));
3838
}
3939

4040
.capital-marker {
41-
fill: #6366f1;
42-
stroke: white;
41+
fill: var(--secondary-color);
42+
stroke: var(--modal-bg);
4343
stroke-width: 2;
4444
transition: all 0.3s ease;
4545
r: 3;
@@ -48,18 +48,18 @@ svg {
4848

4949
.capital-marker:hover {
5050
r: 5;
51-
fill: #818cf8;
51+
fill: var(--primary-color);
5252
}
5353

54-
.capital-marker:hover + .capital-label {
54+
.capital-marker:hover+.capital-label {
5555
opacity: 1;
5656
transform: translateY(-8px);
5757
}
5858

5959
.capital-label {
6060
font-size: 10px;
6161
font-weight: 500;
62-
fill: #495057;
62+
fill: var(--text-color);
6363
opacity: 0;
6464
transition: all 0.3s ease;
6565
pointer-events: none;
@@ -68,34 +68,10 @@ svg {
6868

6969
.capital-marker.active {
7070
r: 5;
71-
fill: #818cf8;
71+
fill: var(--primary-color);
7272
}
7373

7474
.capital-label:hover,
7575
.capital-label.active {
7676
opacity: 1;
77-
}
78-
79-
/* Dark mode map styles */
80-
[data-theme="dark"] .map-container {
81-
background: #1e293b;
82-
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
83-
}
84-
85-
[data-theme="dark"] .state {
86-
fill: #334155;
87-
stroke: #818cf8;
88-
}
89-
90-
[data-theme="dark"] .state:hover {
91-
fill: #818cf8;
92-
opacity: 0.6;
93-
}
94-
95-
[data-theme="dark"] .capital-label {
96-
fill: #e2e8f0;
97-
}
98-
99-
[data-theme="dark"] svg {
100-
border-color: #334155;
101-
}
77+
}

0 commit comments

Comments
 (0)