Skip to content

Commit

Permalink
chore: ignore story elements
Browse files Browse the repository at this point in the history
  • Loading branch information
DSil authored and oreqizer committed Oct 16, 2023
1 parent 481f189 commit f61da8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Expand Up @@ -47,7 +47,7 @@ module.exports = {
"jsx-a11y/label-has-associated-control": "off",
"no-await-in-loop": "off",
"tailwindcss/classnames-order": "off",
"tailwindcss/no-custom-classname": [1, { whitelist: ["(orbit\\-).*"] }],
"tailwindcss/no-custom-classname": [1, { whitelist: ["(orbit\\-).*", "chromatic-ignore"] }],
...(!process.env.CI
? {
"import/no-named-as-default": "off",
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/chromatic.yml
Expand Up @@ -31,6 +31,8 @@ jobs:
- name: Publish to Chromatic
uses: chromaui/action@v1
env:
NODE_ENV: chromatic
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: packages/orbit-components
Expand Down
8 changes: 4 additions & 4 deletions packages/orbit-components/.storybook/orbitDecorator.tsx
Expand Up @@ -30,7 +30,7 @@ const OrbitDecorator = (storyFn, context) => {
return (
<OrbitProvider useId={React.useId} theme={{ ...defaultTheme }}>
<div style={{ padding: "20px" }}>
<div data-chromatic="ignore">
<div className="chromatic-ignore">
<Heading spaceAfter="medium" inverted={inverted}>
{context.kind}
</Heading>
Expand All @@ -39,11 +39,11 @@ const OrbitDecorator = (storyFn, context) => {
</Text>
</div>
{children}
{process.env.NODE_ENV !== "loki" ? (
<div data-chromatic="ignore" style={{ marginTop: 20 }}>
{process.env.NODE_ENV === "loki" || process.env.NODE_ENV === "chromatic" ? null : (
<div className="chromatic-ignore" style={{ marginTop: 20 }}>
<Source code={jsxToString(children, options)} language="jsx" format={false} />
</div>
) : null}
)}
</div>
</OrbitProvider>
);
Expand Down

0 comments on commit f61da8a

Please sign in to comment.