You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Works **between different stores**| Works **within a single store**|
56
55
| Creates separate deployable instances | Uses a single deployable instance |
57
56
| Full codebase customization | Only middleware configuration changes, Storefront code is shared |
58
57
| Requires separate builds for each store | Single build supports multiple configurations |
@@ -340,9 +339,13 @@ Make sure that all your internal links and navigation components preserve the st
340
339
341
340
Without this, users might unexpectedly switch between stores while browsing your site.
342
341
343
-
## Applying Store-Specific Styling
342
+
## Store-Specific Styling
344
343
345
-
Now that you have CSS variables defined for each store, you need to apply the store identifier as a CSS class to enable the different styles.
344
+
There are two key steps to implement store-specific styling:
345
+
346
+
### 1. Applying Store Identifier Class
347
+
348
+
First, you need to apply the store identifier as a CSS class to enable different styles for each store:
346
349
347
350
::tabs{:titles='["Next.js", "Nuxt"]'}
348
351
@@ -386,9 +389,96 @@ const route = useRoute();
386
389
```
387
390
::
388
391
389
-
##Styling Components for Different Stores
392
+
### 2. Defining Store-Specific CSS Variables
390
393
391
-
With the store identifier applied as a class, you can now customize components with store-specific styles. You'll need to update your Tailwind configuration to support this.
394
+
Once the store identifier class is applied, you can define CSS variables that change based on the store:
395
+
396
+
::tabs{:titles='["Next.js", "Nuxt"]'}
397
+
398
+
#tab-1
399
+
In your Next.js app, add custom CSS variables in your global styles:
The CSS variables we defined can be used with Tailwind's color system. For example, `bg-primary-500` will use the store-specific primary color defined in the CSS variables. For more information, see the [Tailwind CSS documentation](https://v3.tailwindcss.com/docs/customizing-colors#using-css-variables).
576
+
::
577
+
481
578
## Conditional Components
482
579
483
580
There are two main approaches to handling store-specific components:
0 commit comments