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
* add fix for pseudo elements
* only replace classname if it exists
* use correct variable
* run prettier
* fix example
* hide fix behind a flag
* fix typo
As stated by [`react-sketchapp`](https://github.com/airbnb/react-sketchapp), it's complicated to manage assets in a design system. Many teams building design systems or component libraries already produce Sketch files for distributing designs and use [Storybook](https://storybook.js.org) to prototype and present the developed components. It can become difficult to keep designs up to date with the latest components, with designers ever playing catchup. `story2sketch` generates a Sketch file from your components via Storybook, so your Sketch designs always stay up to date.
68
68
69
69
<aname="configuration"><a/>
70
+
70
71
## Configuration
71
72
72
73
You can configure `story2sketch` using [the API](#api) via the CLI, configuring your `package.json` or adding a `story2sketch.config.js` file.
@@ -90,7 +91,6 @@ Add the following to your package.json:
90
91
"output": "dist/great-ui.asketch.json"
91
92
}
92
93
}
93
-
94
94
```
95
95
96
96
### story2sketch.config.js
@@ -101,24 +101,26 @@ Create a file called `story2sketch.config.js` on the root of your project:
101
101
module.exports= {
102
102
output:"dist/great-ui.asketch.json",
103
103
stories:"all"
104
-
}
104
+
};
105
105
```
106
106
107
107
<aname="api"><a/>
108
+
108
109
## API
109
110
110
-
| Parameter | Explanation | Input Type | Default |
| output | Specifies the filename for the generated asketch.json file. | string |`"dist/stories.asketch.json"`|
113
-
| input | The location of Storybook's generated iframe.html. Use this over `url` if possible for performance. | string |`"dist/iframe.html"`|
114
-
| url | Storybook iframe URL. Will end in `iframe.html`. Prefer `input` for performance if possible. | string |`"http://localhost:9001/iframe.html"`|
115
-
| stories | Stories to extract from Storybook. You should probably override the default. | object/string |`"all"`|
116
-
| concurrency | Number of headless Chrome tabs to run in parallel. Drastically impacts performance. | integer |`4`|
117
-
| symbolGutter | Gutter to place between symbols in Sketch. | integer |`100`|
118
-
| viewports | Viewport configuration. Will be arranged left-to-right by width. Try to avoid changing the key, as this is used to identify the symbol. | object | Mobile viewport (320px wide) and desktop viewport (1920px wide). See example below. |
119
-
| querySelector | Query selector to select your node on each page. Uses `document.querySelectorAll`. | string |`"#root"`|
| puppeteerOptions | Options to be passed directly to `puppeteer.launch`. See [puppeteer docs](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions) for usage. | object |`{}`|
111
+
| Parameter | Explanation | Input Type | Default |
| output | Specifies the filename for the generated asketch.json file. | string |`"dist/stories.asketch.json"`|
114
+
| input | The location of Storybook's generated iframe.html. Use this over `url` if possible for performance. | string |`"dist/iframe.html"`|
115
+
| url | Storybook iframe URL. Will end in `iframe.html`. Prefer `input` for performance if possible. | string |`"http://localhost:9001/iframe.html"`|
116
+
| stories | Stories to extract from Storybook. You should probably override the default. | object/string |`"all"`|
117
+
| concurrency | Number of headless Chrome tabs to run in parallel. Drastically impacts performance. | integer |`4`|
118
+
| symbolGutter | Gutter to place between symbols in Sketch. | integer |`100`|
119
+
| viewports | Viewport configuration. Will be arranged left-to-right by width. Try to avoid changing the key, as this is used to identify the symbol. | object | Mobile viewport (320px wide) and desktop viewport (1920px wide). See example below. |
120
+
| querySelector | Query selector to select your node on each page. Uses `document.querySelectorAll`. | string |`"#root"`|
| fixPseudo | Attempt to insert real elements in place of pseudo-elements | boolean |`false`|
123
+
| puppeteerOptions | Options to be passed directly to `puppeteer.launch`. See [puppeteer docs](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions) for usage. | object |`{}`|
0 commit comments