medusa-storefront-theme-base 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +45 -3
- package/src/button-css-vars.ts +52 -0
- package/src/button-theme.ts +74 -0
- package/src/button-themes/minimal.ts +19 -0
- package/src/create-site-theme-classes.ts +189 -0
- package/src/create-site-theme.ts +299 -0
- package/src/define-brand.ts +53 -0
- package/src/form-theme.ts +55 -0
- package/src/index.ts +90 -65
- package/src/page-theme-merge.ts +1 -0
- package/src/presets/index.ts +10 -0
- package/src/presets/retail-warm.ts +28 -0
- package/src/storefront-theme.ts +281 -0
- package/src/theme-class-names.ts +293 -0
- package/src/theme-layout.ts +58 -0
- package/src/theme-resolve.ts +17 -0
- package/src/theme-slot-merge.ts +34 -0
- package/src/types/deep-partial.ts +4 -0
- package/styles/storefront-globals.css +165 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "medusa-storefront-theme-base",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Default Tailwind preset and className maps for Medusa storefront UI packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"src",
|
|
12
|
+
"styles",
|
|
12
13
|
"tailwind.preset.cjs"
|
|
13
14
|
],
|
|
14
15
|
"exports": {
|
|
@@ -17,10 +18,41 @@
|
|
|
17
18
|
"import": "./src/index.ts",
|
|
18
19
|
"default": "./src/index.ts"
|
|
19
20
|
},
|
|
21
|
+
"./button-theme": {
|
|
22
|
+
"types": "./src/button-theme.ts",
|
|
23
|
+
"import": "./src/button-theme.ts",
|
|
24
|
+
"default": "./src/button-theme.ts"
|
|
25
|
+
},
|
|
26
|
+
"./button-css-vars": {
|
|
27
|
+
"types": "./src/button-css-vars.ts",
|
|
28
|
+
"import": "./src/button-css-vars.ts",
|
|
29
|
+
"default": "./src/button-css-vars.ts"
|
|
30
|
+
},
|
|
31
|
+
"./storefront-theme": {
|
|
32
|
+
"types": "./src/storefront-theme.ts",
|
|
33
|
+
"import": "./src/storefront-theme.ts",
|
|
34
|
+
"default": "./src/storefront-theme.ts"
|
|
35
|
+
},
|
|
36
|
+
"./create-site-theme": {
|
|
37
|
+
"types": "./src/create-site-theme.ts",
|
|
38
|
+
"import": "./src/create-site-theme.ts",
|
|
39
|
+
"default": "./src/create-site-theme.ts"
|
|
40
|
+
},
|
|
41
|
+
"./form-theme": {
|
|
42
|
+
"types": "./src/form-theme.ts",
|
|
43
|
+
"import": "./src/form-theme.ts",
|
|
44
|
+
"default": "./src/form-theme.ts"
|
|
45
|
+
},
|
|
46
|
+
"./button-themes/*": {
|
|
47
|
+
"types": "./src/button-themes/*",
|
|
48
|
+
"import": "./src/button-themes/*",
|
|
49
|
+
"default": "./src/button-themes/*"
|
|
50
|
+
},
|
|
20
51
|
"./tailwind": {
|
|
21
52
|
"require": "./tailwind.preset.cjs",
|
|
22
53
|
"default": "./tailwind.preset.cjs"
|
|
23
|
-
}
|
|
54
|
+
},
|
|
55
|
+
"./styles/storefront-globals.css": "./styles/storefront-globals.css"
|
|
24
56
|
},
|
|
25
57
|
"scripts": {
|
|
26
58
|
"build": "tsc --noEmit",
|
|
@@ -28,6 +60,16 @@
|
|
|
28
60
|
},
|
|
29
61
|
"peerDependencies": {
|
|
30
62
|
"tailwindcss": "^3.0.0",
|
|
31
|
-
"@medusajs/ui-preset": "*"
|
|
63
|
+
"@medusajs/ui-preset": "*",
|
|
64
|
+
"medusa-ui-home": ">=2.1.0"
|
|
65
|
+
},
|
|
66
|
+
"peerDependenciesMeta": {
|
|
67
|
+
"medusa-ui-home": {
|
|
68
|
+
"optional": false
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"medusa-ui-home": "workspace:*",
|
|
73
|
+
"typescript": "^5.6.0"
|
|
32
74
|
}
|
|
33
75
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** CSS custom property names — set on `:root` via ButtonThemeProvider. */
|
|
2
|
+
export const buttonCssVarNames = {
|
|
3
|
+
primary: "--sf-btn-primary",
|
|
4
|
+
primaryHover: "--sf-btn-primary-hover",
|
|
5
|
+
secondary: "--sf-btn-secondary",
|
|
6
|
+
secondaryHover: "--sf-btn-secondary-hover",
|
|
7
|
+
black: "--sf-btn-black",
|
|
8
|
+
blackHover: "--sf-btn-black-hover",
|
|
9
|
+
onPrimary: "--sf-btn-on-primary",
|
|
10
|
+
onSecondary: "--sf-btn-on-secondary",
|
|
11
|
+
onBlack: "--sf-btn-on-black",
|
|
12
|
+
} as const;
|
|
13
|
+
|
|
14
|
+
export type ButtonCssVarValues = {
|
|
15
|
+
primary: string;
|
|
16
|
+
primaryHover: string;
|
|
17
|
+
secondary: string;
|
|
18
|
+
secondaryHover: string;
|
|
19
|
+
black: string;
|
|
20
|
+
blackHover: string;
|
|
21
|
+
onPrimary?: string;
|
|
22
|
+
onSecondary?: string;
|
|
23
|
+
onBlack?: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function buildButtonCssVars(colors: ButtonCssVarValues): Record<string, string> {
|
|
27
|
+
return {
|
|
28
|
+
[buttonCssVarNames.primary]: colors.primary,
|
|
29
|
+
[buttonCssVarNames.primaryHover]: colors.primaryHover,
|
|
30
|
+
[buttonCssVarNames.secondary]: colors.secondary,
|
|
31
|
+
[buttonCssVarNames.secondaryHover]: colors.secondaryHover,
|
|
32
|
+
[buttonCssVarNames.black]: colors.black,
|
|
33
|
+
[buttonCssVarNames.blackHover]: colors.blackHover,
|
|
34
|
+
[buttonCssVarNames.onPrimary]: colors.onPrimary ?? "#ffffff",
|
|
35
|
+
[buttonCssVarNames.onSecondary]: colors.onSecondary ?? "#111111",
|
|
36
|
+
[buttonCssVarNames.onBlack]: colors.onBlack ?? "#ffffff",
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Tailwind class fragments for legacy buttons (use with ButtonThemeProvider css vars). */
|
|
41
|
+
export const buttonCssClasses = {
|
|
42
|
+
primary:
|
|
43
|
+
"bg-[var(--sf-btn-primary)] text-[var(--sf-btn-on-primary)] hover:bg-[var(--sf-btn-primary-hover)]",
|
|
44
|
+
secondary:
|
|
45
|
+
"bg-[var(--sf-btn-secondary)] text-[var(--sf-btn-on-secondary)] hover:bg-[var(--sf-btn-secondary-hover)]",
|
|
46
|
+
black:
|
|
47
|
+
"bg-[var(--sf-btn-black)] text-[var(--sf-btn-on-black)] hover:bg-[var(--sf-btn-black-hover)]",
|
|
48
|
+
outline:
|
|
49
|
+
"bg-transparent text-[var(--sf-btn-black)] border-2 border-[var(--sf-btn-black)] hover:bg-[var(--sf-btn-black)] hover:text-[var(--sf-btn-on-black)]",
|
|
50
|
+
borderPrimary: "border-[var(--sf-btn-primary)]",
|
|
51
|
+
textPrimary: "text-[var(--sf-btn-primary)]",
|
|
52
|
+
} as const;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** Semantic button variants used across storefront UI packages. */
|
|
2
|
+
export type ButtonVariant =
|
|
3
|
+
| "primary"
|
|
4
|
+
| "secondary"
|
|
5
|
+
| "outline"
|
|
6
|
+
| "ghost"
|
|
7
|
+
| "danger"
|
|
8
|
+
| "link";
|
|
9
|
+
|
|
10
|
+
export type ButtonSize = "sm" | "md" | "lg";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Tailwind class maps for buttons. Define once per site; components resolve via context.
|
|
14
|
+
*/
|
|
15
|
+
export type ButtonTheme = {
|
|
16
|
+
/** Shared classes on every button (layout, font, disabled state). */
|
|
17
|
+
base?: string;
|
|
18
|
+
sizes?: Partial<Record<ButtonSize, string>>;
|
|
19
|
+
variants: Record<ButtonVariant, string>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function mergeButtonTheme(
|
|
23
|
+
base: ButtonTheme,
|
|
24
|
+
overrides: Partial<ButtonTheme> & { variants?: Partial<Record<ButtonVariant, string>> },
|
|
25
|
+
): ButtonTheme {
|
|
26
|
+
return {
|
|
27
|
+
base: [base.base, overrides.base].filter(Boolean).join(" ").trim() || undefined,
|
|
28
|
+
sizes: { ...base.sizes, ...overrides.sizes },
|
|
29
|
+
variants: { ...base.variants, ...overrides.variants } as Record<ButtonVariant, string>,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Neutral defaults — works without brand tokens. */
|
|
34
|
+
export const defaultButtonTheme: ButtonTheme = {
|
|
35
|
+
base: "inline-flex items-center justify-center font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
36
|
+
sizes: {
|
|
37
|
+
sm: "h-9 px-3 text-xs rounded-md",
|
|
38
|
+
md: "h-10 px-4 text-sm rounded-md",
|
|
39
|
+
lg: "h-12 px-6 text-base rounded-md",
|
|
40
|
+
},
|
|
41
|
+
variants: {
|
|
42
|
+
primary: "bg-ui-button-inverted text-ui-fg-on-inverted hover:bg-ui-button-inverted/90",
|
|
43
|
+
secondary:
|
|
44
|
+
"bg-ui-button-neutral text-ui-fg-base border border-ui-border-base hover:bg-ui-bg-subtle",
|
|
45
|
+
outline:
|
|
46
|
+
"bg-transparent text-ui-fg-base border border-ui-border-base hover:bg-ui-bg-subtle",
|
|
47
|
+
ghost: "bg-transparent text-ui-fg-base hover:bg-ui-bg-subtle",
|
|
48
|
+
danger: "bg-red-600 text-white hover:bg-red-700",
|
|
49
|
+
link: "bg-transparent text-ui-fg-interactive underline-offset-4 hover:underline h-auto p-0",
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** Rounded pill style (Chocomelon-style). Import and extend in site theme. */
|
|
54
|
+
export const pillButtonTheme: ButtonTheme = {
|
|
55
|
+
base: "inline-flex items-center justify-center font-bold transition-all disabled:opacity-50 disabled:cursor-not-allowed",
|
|
56
|
+
sizes: {
|
|
57
|
+
sm: "h-9 px-4 text-xs rounded-full",
|
|
58
|
+
md: "h-11 px-6 text-sm rounded-full",
|
|
59
|
+
lg: "h-12 px-8 text-base rounded-full",
|
|
60
|
+
},
|
|
61
|
+
variants: {
|
|
62
|
+
primary:
|
|
63
|
+
"bg-[var(--sf-btn-primary)] text-[var(--sf-btn-on-primary)] hover:bg-[var(--sf-btn-primary-hover)] shadow-md hover:opacity-90",
|
|
64
|
+
secondary:
|
|
65
|
+
"bg-[var(--sf-btn-secondary)] text-[var(--sf-btn-on-secondary)] border-2 border-[var(--sf-btn-secondary)] hover:bg-[var(--sf-btn-secondary-hover)]",
|
|
66
|
+
outline:
|
|
67
|
+
"bg-transparent text-[var(--sf-btn-black)] border-2 border-[var(--sf-btn-black)] hover:bg-[var(--sf-btn-black)] hover:text-[var(--sf-btn-on-black)]",
|
|
68
|
+
ghost:
|
|
69
|
+
"bg-transparent text-[var(--sf-btn-primary)] hover:bg-[var(--sf-btn-primary)]/10",
|
|
70
|
+
danger:
|
|
71
|
+
"bg-[var(--sf-btn-black)] text-[var(--sf-btn-on-black)] hover:bg-[var(--sf-btn-black-hover)]",
|
|
72
|
+
link: "bg-transparent text-[var(--sf-btn-primary)] underline-offset-4 hover:underline h-auto p-0",
|
|
73
|
+
},
|
|
74
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ButtonTheme } from "../button-theme";
|
|
2
|
+
|
|
3
|
+
/** Flat, square-corner buttons for admin-like or dense UIs. */
|
|
4
|
+
export const minimalButtonTheme: ButtonTheme = {
|
|
5
|
+
base: "inline-flex items-center justify-center font-semibold transition-colors disabled:opacity-50",
|
|
6
|
+
sizes: {
|
|
7
|
+
sm: "h-8 px-3 text-xs rounded",
|
|
8
|
+
md: "h-10 px-4 text-sm rounded",
|
|
9
|
+
lg: "h-11 px-5 text-sm rounded",
|
|
10
|
+
},
|
|
11
|
+
variants: {
|
|
12
|
+
primary: "bg-gray-900 text-white hover:bg-gray-800",
|
|
13
|
+
secondary: "bg-gray-100 text-gray-900 hover:bg-gray-200",
|
|
14
|
+
outline: "border border-gray-300 text-gray-900 hover:bg-gray-50",
|
|
15
|
+
ghost: "text-gray-700 hover:bg-gray-100",
|
|
16
|
+
danger: "bg-red-600 text-white hover:bg-red-700",
|
|
17
|
+
link: "text-gray-900 underline hover:no-underline h-auto p-0",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { themeCssClasses as p } from "./storefront-theme";
|
|
2
|
+
import {
|
|
3
|
+
joinClasses,
|
|
4
|
+
layoutSlots,
|
|
5
|
+
responsivePageX,
|
|
6
|
+
} from "./theme-layout";
|
|
7
|
+
import {
|
|
8
|
+
themeClassNames,
|
|
9
|
+
type AccountThemeClassNames,
|
|
10
|
+
type CartThemeClassNames,
|
|
11
|
+
type CheckoutUiThemeClassNames,
|
|
12
|
+
type ContactThemeClassNames,
|
|
13
|
+
type HelpThemeClassNames,
|
|
14
|
+
type HomeThemeClassNames,
|
|
15
|
+
type OrderThemeClassNames,
|
|
16
|
+
type ProductThemeClassNames,
|
|
17
|
+
type StorefrontThemeClasses,
|
|
18
|
+
type StorefrontThemeClassOverrides,
|
|
19
|
+
type StoreThemeClassNames,
|
|
20
|
+
} from "./theme-class-names";
|
|
21
|
+
import { mergeThemeSlots } from "./theme-slot-merge";
|
|
22
|
+
|
|
23
|
+
export function createSiteAccountTheme(): AccountThemeClassNames {
|
|
24
|
+
const a = themeClassNames.account;
|
|
25
|
+
return {
|
|
26
|
+
page: joinClasses(layoutSlots.accountPage, p.pageBackground),
|
|
27
|
+
container: joinClasses(layoutSlots.accountContainer, p.pageBackground),
|
|
28
|
+
title: joinClasses(layoutSlots.accountTitle, p.text),
|
|
29
|
+
contentGrid: layoutSlots.accountContentGrid,
|
|
30
|
+
card: joinClasses(p.surface, "rounded-2xl shadow-sm", p.border),
|
|
31
|
+
buttonPrimary:
|
|
32
|
+
"bg-[var(--sf-btn-primary)] text-[var(--sf-color-text-on-primary)] hover:bg-[var(--sf-btn-primary-hover)]",
|
|
33
|
+
loginShell: joinClasses(layoutSlots.loginShell, p.pageBackground),
|
|
34
|
+
loginCard: joinClasses(layoutSlots.loginCard, p.surface, p.border),
|
|
35
|
+
loginHeading: a.loginHeading,
|
|
36
|
+
loginSubheading: a.loginSubheading,
|
|
37
|
+
oauthButton: a.oauthButton,
|
|
38
|
+
oauthButtonText: a.oauthButtonText,
|
|
39
|
+
dividerText: a.dividerText,
|
|
40
|
+
bodyText: a.bodyText,
|
|
41
|
+
formLabel: a.formLabel,
|
|
42
|
+
link: a.link,
|
|
43
|
+
iconMuted: a.iconMuted,
|
|
44
|
+
hoverSurface: a.hoverSurface,
|
|
45
|
+
nav: { ...a.nav },
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function createSiteOrderTheme(): OrderThemeClassNames {
|
|
50
|
+
return {
|
|
51
|
+
page: `py-6 min-h-[calc(100vh-64px)] ${p.pageBackground} overflow-x-hidden`,
|
|
52
|
+
container: themeClassNames.order.container,
|
|
53
|
+
title: `text-2xl sm:text-3xl font-bold ${p.text} mb-6 sm:mb-8 text-center`,
|
|
54
|
+
innerContainer: themeClassNames.order.innerContainer,
|
|
55
|
+
card: `${p.surface} rounded-2xl shadow-sm ${p.border} p-4 sm:p-6`,
|
|
56
|
+
buttonPrimary:
|
|
57
|
+
"bg-[var(--sf-btn-primary)] text-[var(--sf-color-text-on-primary)] hover:bg-[var(--sf-btn-primary-hover)]",
|
|
58
|
+
buttonOutline: themeClassNames.order.buttonOutline,
|
|
59
|
+
exchangeBadge: themeClassNames.order.exchangeBadge,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function createSiteCartTheme(): CartThemeClassNames {
|
|
64
|
+
return { ...themeClassNames.cart };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function createSiteProductCardTheme() {
|
|
68
|
+
return { ...themeClassNames.productCard };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function createSiteProductTheme(): ProductThemeClassNames {
|
|
72
|
+
const pr = themeClassNames.product;
|
|
73
|
+
return {
|
|
74
|
+
page: joinClasses("min-h-screen w-full", p.pageBackground),
|
|
75
|
+
container: layoutSlots.productInner,
|
|
76
|
+
breadcrumb: p.textMuted,
|
|
77
|
+
title: p.heading,
|
|
78
|
+
price: pr.price,
|
|
79
|
+
heading: pr.heading,
|
|
80
|
+
subheading: pr.subheading,
|
|
81
|
+
label: pr.label,
|
|
82
|
+
surface: pr.surface,
|
|
83
|
+
badgeSale: pr.badgeSale,
|
|
84
|
+
badgeNew: pr.badgeNew,
|
|
85
|
+
badgeHot: pr.badgeHot,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function createSiteStoreTheme(): StoreThemeClassNames {
|
|
90
|
+
return {
|
|
91
|
+
page: joinClasses("min-h-screen w-full", p.pageBackground),
|
|
92
|
+
container: layoutSlots.storeContainer,
|
|
93
|
+
title: themeClassNames.store.title,
|
|
94
|
+
badge: themeClassNames.store.badge,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function createSiteCheckoutUiTheme(): CheckoutUiThemeClassNames {
|
|
99
|
+
return { ...themeClassNames.checkout };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function createSiteContactTheme(): ContactThemeClassNames {
|
|
103
|
+
const c = themeClassNames.contact;
|
|
104
|
+
return {
|
|
105
|
+
page: joinClasses("min-h-screen w-full", p.pageBackground),
|
|
106
|
+
container: layoutSlots.contactContainer,
|
|
107
|
+
card: joinClasses(
|
|
108
|
+
p.surface,
|
|
109
|
+
"rounded-2xl sm:rounded-3xl",
|
|
110
|
+
p.border,
|
|
111
|
+
"shadow-sm",
|
|
112
|
+
),
|
|
113
|
+
heading: c.heading,
|
|
114
|
+
subheading: c.subheading,
|
|
115
|
+
label: c.label,
|
|
116
|
+
infoTitle: c.infoTitle,
|
|
117
|
+
infoBody: c.infoBody,
|
|
118
|
+
infoValue: c.infoValue,
|
|
119
|
+
infoIconBg: c.infoIconBg,
|
|
120
|
+
link: c.link,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function createSiteHelpTheme(): HelpThemeClassNames {
|
|
125
|
+
return {
|
|
126
|
+
page: joinClasses(layoutSlots.helpPage, p.pageBackground),
|
|
127
|
+
container: joinClasses("content-container w-full", responsivePageX),
|
|
128
|
+
card: joinClasses(p.surface, "rounded-2xl", p.border),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function createSiteHomeTheme(): HomeThemeClassNames {
|
|
133
|
+
const h = themeClassNames.home;
|
|
134
|
+
return {
|
|
135
|
+
...h,
|
|
136
|
+
pageRoot: `${p.pageBackground} w-full`,
|
|
137
|
+
section: joinClasses(h.section, p.pageBackground),
|
|
138
|
+
testimonialSection: joinClasses(h.testimonialSection, p.pageBackground),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Default slot themes (CSS vars) — used when no provider is mounted. */
|
|
143
|
+
export function createDefaultStorefrontThemeClasses(): StorefrontThemeClasses {
|
|
144
|
+
return {
|
|
145
|
+
layout: {
|
|
146
|
+
...themeClassNames.layout,
|
|
147
|
+
main: `min-h-screen w-full ${p.pageBackground}`,
|
|
148
|
+
checkoutShell: `w-full relative min-h-screen ${p.pageBackground}`,
|
|
149
|
+
},
|
|
150
|
+
home: createSiteHomeTheme(),
|
|
151
|
+
notFound: {
|
|
152
|
+
root: `flex flex-col gap-4 items-center justify-center min-h-[calc(100vh-64px)] ${p.pageBackground}`,
|
|
153
|
+
title: `text-2xl-semi ${p.text}`,
|
|
154
|
+
description: `text-small-regular ${p.textMuted}`,
|
|
155
|
+
},
|
|
156
|
+
productCard: createSiteProductCardTheme(),
|
|
157
|
+
account: createSiteAccountTheme(),
|
|
158
|
+
order: createSiteOrderTheme(),
|
|
159
|
+
cart: createSiteCartTheme(),
|
|
160
|
+
product: createSiteProductTheme(),
|
|
161
|
+
store: createSiteStoreTheme(),
|
|
162
|
+
checkout: createSiteCheckoutUiTheme(),
|
|
163
|
+
contact: createSiteContactTheme(),
|
|
164
|
+
help: createSiteHelpTheme(),
|
|
165
|
+
pages: themeClassNames.pages,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function createSiteThemeClasses(
|
|
170
|
+
overrides?: StorefrontThemeClassOverrides,
|
|
171
|
+
): StorefrontThemeClasses {
|
|
172
|
+
const base = createDefaultStorefrontThemeClasses();
|
|
173
|
+
if (!overrides) return base;
|
|
174
|
+
return {
|
|
175
|
+
layout: mergeThemeSlots(base.layout, overrides.layout),
|
|
176
|
+
home: mergeThemeSlots(base.home, overrides.home),
|
|
177
|
+
notFound: mergeThemeSlots(base.notFound, overrides.notFound),
|
|
178
|
+
productCard: mergeThemeSlots(base.productCard, overrides.productCard),
|
|
179
|
+
account: mergeThemeSlots(base.account, overrides.account),
|
|
180
|
+
order: mergeThemeSlots(base.order, overrides.order),
|
|
181
|
+
cart: mergeThemeSlots(base.cart, overrides.cart),
|
|
182
|
+
product: mergeThemeSlots(base.product, overrides.product),
|
|
183
|
+
store: mergeThemeSlots(base.store, overrides.store),
|
|
184
|
+
checkout: mergeThemeSlots(base.checkout, overrides.checkout),
|
|
185
|
+
contact: mergeThemeSlots(base.contact, overrides.contact),
|
|
186
|
+
help: mergeThemeSlots(base.help, overrides.help),
|
|
187
|
+
pages: mergeThemeSlots(base.pages, overrides.pages),
|
|
188
|
+
};
|
|
189
|
+
}
|