Skip to content

Commit

Permalink
add chromatic.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
takanorip committed Sep 20, 2024
1 parent 9faec0e commit a3b99aa
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 37 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Chromatic"

on: push

jobs:
chromatic:
name: Run Chromatic
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Run Chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
onlyChanged: true
3 changes: 0 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,3 @@ jobs:
run: npx playwright install --with-deps
- name: Test
run: npm run test

- name: Chromatic
run: npm run chromatic
16 changes: 11 additions & 5 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<link type="text/css" rel="stylesheet" href="" id="reset-css"/>
<link type="text/css" rel="stylesheet" href="" id="reset-css" />

<script>
document.documentElement.setAttribute('lang', 'ja');
</script>

<style>
html {
font-family: Helvetica Neue, Arial, Hiragino Kaku Gothic ProN, Hiragino Sans, Meiryo, sans-serif;
}
</style>
html {
font-family:
Helvetica Neue,
Arial,
Hiragino Kaku Gothic ProN,
Hiragino Sans,
Meiryo,
sans-serif;
}
</style>
50 changes: 25 additions & 25 deletions .storybook/public/styles/modern-css-reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*,
*::before,
*::after {
box-sizing: border-box;
box-sizing: border-box;
}

/* Remove default margin */
Expand All @@ -18,59 +18,59 @@ figure,
blockquote,
dl,
dd {
margin: 0;
margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
list-style: none;
ul[role='list'],
ol[role='list'] {
list-style: none;
}

/* Set core root defaults */
html:focus-within {
scroll-behavior: smooth;
scroll-behavior: smooth;
}

/* Set core body defaults */
body {
min-height: 100vh;
text-rendering: optimizespeed;
line-height: 1.5;
min-height: 100vh;
text-rendering: optimizespeed;
line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
text-decoration-skip-ink: auto;
text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
display: block;
max-width: 100%;
display: block;
max-width: 100%;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
font: inherit;
font: inherit;
}

/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
html:focus-within {
scroll-behavior: auto;
}
html:focus-within {
scroll-behavior: auto;
}

*,
*::before,
*::after {
transition-duration: 0.01ms !important;
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
scroll-behavior: auto !important;
}
}
*,
*::before,
*::after {
transition-duration: 0.01ms !important;
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
scroll-behavior: auto !important;
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
"prestorybook": "npm run build",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"prepublishOnly": "npm run build",
"chromatic": "npx chromatic --project-token=chpt_37d0a81ccfe372f"
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit a3b99aa

Please sign in to comment.