@repobuddy/storybook 2.9.1 → 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 +8 -1
- package/readme.md +43 -5
- package/styles.css +0 -1
- package/tailwind.css +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repobuddy/storybook",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "Storybook repo buddy",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -39,6 +39,12 @@
|
|
|
39
39
|
"types": "./esm/storybook-dark-mode/index.d.ts",
|
|
40
40
|
"default": "./esm/storybook-dark-mode/index.js"
|
|
41
41
|
},
|
|
42
|
+
"./tailwind": {
|
|
43
|
+
"style": "./tailwind.css"
|
|
44
|
+
},
|
|
45
|
+
"./tailwind.css": {
|
|
46
|
+
"style": "./tailwind.css"
|
|
47
|
+
},
|
|
42
48
|
"./styles.css": "./styles.css"
|
|
43
49
|
},
|
|
44
50
|
"files": [
|
|
@@ -46,6 +52,7 @@
|
|
|
46
52
|
"esm",
|
|
47
53
|
"src",
|
|
48
54
|
"styles.css",
|
|
55
|
+
"tailwind.css",
|
|
49
56
|
"!**/*.{spec,test,unit,accept,integrate,system,perf,stress,study,stories}.*",
|
|
50
57
|
"!**/*.mdx"
|
|
51
58
|
],
|
package/readme.md
CHANGED
|
@@ -135,16 +135,54 @@ export const preview: Preview = {
|
|
|
135
135
|
}
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
##
|
|
138
|
+
## Styling
|
|
139
139
|
|
|
140
|
-
[`@repobuddy/storybook`][`@repobuddy/storybook`] uses Tailwind CSS 4
|
|
140
|
+
[`@repobuddy/storybook`][`@repobuddy/storybook`] uses Tailwind CSS 4 with the prefix `rbsb:` and support `dark` variant.
|
|
141
141
|
|
|
142
|
-
|
|
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.
|
|
143
144
|
|
|
144
|
-
|
|
145
|
-
|
|
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'
|
|
146
155
|
```
|
|
147
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
|
+
```
|
|
174
|
+
|
|
175
|
+
```css
|
|
176
|
+
/* tailwind.css */
|
|
177
|
+
@import "tailwindcss/theme.css" layer(theme) prefix(app);
|
|
178
|
+
@import "tailwindcss/utilities.css" layer(utilities) prefix(app);
|
|
179
|
+
|
|
180
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
181
|
+
```
|
|
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
|
+
|
|
148
186
|
[`@repobuddy/storybook`]: https://github.com/repobuddy/storybook
|
|
149
187
|
[`storybook-addon-tag-badges`]: https://github.com/Sidnioulz/storybook-addon-tag-badges
|
|
150
188
|
[`@storybook-community/storybook-dark-mode`]: https://github.com/repobuddy/@storybook-community/storybook-dark-mode
|
package/styles.css
CHANGED
package/tailwind.css
ADDED