@repobuddy/storybook 2.10.0 → 2.11.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repobuddy/storybook",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "Storybook repo buddy",
5
5
  "keywords": [
6
6
  "storybook",
@@ -42,6 +42,9 @@
42
42
  "./tailwind": {
43
43
  "style": "./tailwind.css"
44
44
  },
45
+ "./tailwind.css": {
46
+ "style": "./tailwind.css"
47
+ },
45
48
  "./styles.css": "./styles.css"
46
49
  },
47
50
  "files": [
package/readme.md CHANGED
@@ -135,21 +135,54 @@ export const preview: Preview = {
135
135
  }
136
136
  ```
137
137
 
138
- ## Styles
138
+ ## Styling
139
139
 
140
- [`@repobuddy/storybook`][`@repobuddy/storybook`] uses Tailwind CSS 4 and the prefix `rbsb:` to avoid conflicts with user styles.
140
+ [`@repobuddy/storybook`][`@repobuddy/storybook`] uses Tailwind CSS 4 with the prefix `rbsb:` and support `dark` variant.
141
141
 
142
- To use the styles, import `@repobuddy/storybook/tailwind` in your Tailwind config:
142
+ Since how to control the dark variant is different in different projects,
143
+ the pre-built `@repobuddy/storybook/styles.css` might not work for you.
144
+
145
+ Instead, you can use the `@repobuddy/storybook/tailwind.css` to build the stylesheet for your project.
146
+
147
+ Let's say you are using it in your storybook (obviously),
148
+ you need to separate your tailwind config and import them in your storybook.
149
+
150
+ ```tsx
151
+ // .storybook/preview.tsx
152
+ import './tailwind.css'
153
+ import './tailwind.repobuddy-storybook.css'
154
+ import '../tailwind.css'
155
+ ```
156
+
157
+ ```css
158
+ /* .storybook/tailwind.css */
159
+
160
+ /* adding the layer "rbsb" is optional */
161
+ @layer theme, base, components, rbsb, utilities;
162
+ @import "tailwindcss/preflight.css" layer(base);
163
+ ```
164
+
165
+ ```css
166
+ /* .storybook/tailwind.repobuddy-storybook.css */
167
+ /* adding the layer "rbsb" is optional */
168
+ @import "@repobuddy/storybook/tailwind.css" layer(rbsb);
169
+
170
+ @source "../node_modules/@repobuddy/storybook/src/**";
171
+
172
+ @custom-variant dark (&:where(.dark, .dark *));
173
+ ```
143
174
 
144
175
  ```css
145
176
  /* tailwind.css */
146
- @import "tailwindcss";
147
- @import "@repobuddy/storybook/tailwind";
177
+ @import "tailwindcss/theme.css" layer(theme) prefix(app);
178
+ @import "tailwindcss/utilities.css" layer(utilities) prefix(app);
148
179
 
149
- /* specify your dark variant mechanism */
150
180
  @custom-variant dark (&:where(.dark, .dark *));
151
181
  ```
152
182
 
183
+ Note that `@repobuddy/storybook/tailwind` is deprecated in favor of `@repobuddy/storybook/tailwind.css`.
184
+ That convention better aligns with the Tailwind CSS 4 convention.
185
+
153
186
  [`@repobuddy/storybook`]: https://github.com/repobuddy/storybook
154
187
  [`storybook-addon-tag-badges`]: https://github.com/Sidnioulz/storybook-addon-tag-badges
155
188
  [`@storybook-community/storybook-dark-mode`]: https://github.com/repobuddy/@storybook-community/storybook-dark-mode
package/tailwind.css CHANGED
@@ -1,4 +1,2 @@
1
1
  @import "tailwindcss/theme.css" layer(theme) prefix(rbsb);
2
- @import "tailwindcss/utilities.css" layer(utilities);
3
-
4
- @source "src/**";
2
+ @import "tailwindcss/utilities.css" layer(utilities) prefix(rbsb);