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
Copy file name to clipboardExpand all lines: docs/content/guides/7.multistore/3.patterns/5.subpath/1.subpath.md
-104
Original file line number
Diff line number
Diff line change
@@ -105,110 +105,6 @@ export const config = {
105
105
} satisfiesIntegration<Config>;
106
106
```
107
107
108
-
## Customizing Store Appearance with CSS Variables
109
-
110
-
To create distinct visual identities for each store, you can define CSS variables that change based on the store config ID. This is a powerful way to maintain a consistent component library while applying different themes.
111
-
112
-
::tabs{:titles='["Next.js", "Nuxt"]'}
113
-
114
-
#tab-1
115
-
In your Next.js app, add custom CSS variables in your global styles:
In your Nuxt app, add custom CSS variables in your style.scss:
156
-
157
-
```scss
158
-
// apps/storefront-unified-nuxt/assets/style.scss
159
-
@tailwind base;
160
-
@tailwind components;
161
-
@tailwind utilities;
162
-
163
-
// Base styles...
164
-
165
-
// Electronics store theme
166
-
.electronics {
167
-
--colors-primary-50: 45249255;
168
-
--colors-primary-100: 233243255;
169
-
--colors-primary-200: 200224255;
170
-
--colors-primary-300: 166204255;
171
-
--colors-primary-400: 110161255;
172
-
--colors-primary-500: 51117255;
173
-
--colors-primary-600: 46106230;
174
-
--colors-primary-700: 3878191;
175
-
--colors-primary-800: 2963153;
176
-
--colors-primary-900: 176196244;
177
-
}
178
-
179
-
// Apparel store theme (different color scheme)
180
-
.apparel {
181
-
--colors-primary-50: 243254249;
182
-
--colors-primary-100: 224247235;
183
-
--colors-primary-200: 187235210;
184
-
--colors-primary-300: 135216177;
185
-
--colors-primary-400: 77192140;
186
-
--colors-primary-500: 45165116;
187
-
--colors-primary-600: 3413495;
188
-
--colors-primary-700: 3111080;
189
-
--colors-primary-800: 308665;
190
-
--colors-primary-900: 236449;
191
-
}
192
-
```
193
-
::
194
-
195
-
::tip Using CSS Variables with Tailwind
196
-
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).
197
-
::
198
-
199
-
::tip Understanding Generated CSS
200
-
When using store-specific variants like `electronics:!bg-primary-600`, Tailwind generates scoped CSS rules. For example:
This ensures the styles only apply when two conditions are met: the parent element must have the `.electronics` class and the target element must have the `electronics:!bg-primary-600` class.
210
-
::
211
-
212
108
## Setting Up the Storefront
213
109
214
110
Now you need to configure your Storefront to send the appropriate config ID to the Middleware based on the current URL path.
0 commit comments