Skip to content

Commit 1ffe675

Browse files
committed
fix: content duplication
1 parent cad6c5f commit 1ffe675

File tree

1 file changed

+0
-104
lines changed
  • docs/content/guides/7.multistore/3.patterns/5.subpath

1 file changed

+0
-104
lines changed

Diff for: docs/content/guides/7.multistore/3.patterns/5.subpath/1.subpath.md

-104
Original file line numberDiff line numberDiff line change
@@ -105,110 +105,6 @@ export const config = {
105105
} satisfies Integration<Config>;
106106
```
107107

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:
116-
117-
```scss
118-
// apps/storefront-unified-nextjs/app/[locale]/globals.scss
119-
@tailwind base;
120-
@tailwind components;
121-
@tailwind utilities;
122-
123-
// Base styles...
124-
125-
// Electronics store theme
126-
.electronics {
127-
--colors-primary-50: 45 249 255;
128-
--colors-primary-100: 233 243 255;
129-
--colors-primary-200: 200 224 255;
130-
--colors-primary-300: 166 204 255;
131-
--colors-primary-400: 110 161 255;
132-
--colors-primary-500: 51 117 255;
133-
--colors-primary-600: 46 106 230;
134-
--colors-primary-700: 38 78 191;
135-
--colors-primary-800: 29 63 153;
136-
--colors-primary-900: 176 196 244;
137-
}
138-
139-
// Apparel store theme (different color scheme)
140-
.apparel {
141-
--colors-primary-50: 243 254 249;
142-
--colors-primary-100: 224 247 235;
143-
--colors-primary-200: 187 235 210;
144-
--colors-primary-300: 135 216 177;
145-
--colors-primary-400: 77 192 140;
146-
--colors-primary-500: 45 165 116;
147-
--colors-primary-600: 34 134 95;
148-
--colors-primary-700: 31 110 80;
149-
--colors-primary-800: 30 86 65;
150-
--colors-primary-900: 23 64 49;
151-
}
152-
```
153-
154-
#tab-2
155-
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: 45 249 255;
168-
--colors-primary-100: 233 243 255;
169-
--colors-primary-200: 200 224 255;
170-
--colors-primary-300: 166 204 255;
171-
--colors-primary-400: 110 161 255;
172-
--colors-primary-500: 51 117 255;
173-
--colors-primary-600: 46 106 230;
174-
--colors-primary-700: 38 78 191;
175-
--colors-primary-800: 29 63 153;
176-
--colors-primary-900: 176 196 244;
177-
}
178-
179-
// Apparel store theme (different color scheme)
180-
.apparel {
181-
--colors-primary-50: 243 254 249;
182-
--colors-primary-100: 224 247 235;
183-
--colors-primary-200: 187 235 210;
184-
--colors-primary-300: 135 216 177;
185-
--colors-primary-400: 77 192 140;
186-
--colors-primary-500: 45 165 116;
187-
--colors-primary-600: 34 134 95;
188-
--colors-primary-700: 31 110 80;
189-
--colors-primary-800: 30 86 65;
190-
--colors-primary-900: 23 64 49;
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:
201-
202-
```css
203-
.electronics .electronics\:\!bg-primary-600 {
204-
--tw-bg-opacity: 1 !important;
205-
background-color: rgb(46 106 230 / 1 !important) !important;
206-
}
207-
```
208-
209-
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-
212108
## Setting Up the Storefront
213109

214110
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

Comments
 (0)