Skip to content

Commit

Permalink
Add global colors to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davydepauw committed Jun 5, 2024
1 parent 609013a commit c1f2e37
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import '../dist/storybook/css/main.css';

const preview: Preview = {
parameters: {
storySort: {
order: ['Global', 'Atoms', 'Molecules', 'Organisms'],
},
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "frontend-boilerplate",
"version": "0.0.1",
"scripts": {
"build:css": "./node_modules/.bin/postcss src/styles/main.scss -o dist/css/main.css --verbose",
"build:css": "./node_modules/.bin/postcss src/styles/main.scss -o dist/storybook/css/main.css --verbose",
"copy:assets": "cp -Rf ./src/assets/* ./dist/assets/",
"watch:css": "chokidar 'src/styles/**/*.scss' --command 'npm run build:css'",
"storybook": "npm run build-storybook && storybook dev -p 6006",
Expand Down
22 changes: 22 additions & 0 deletions src/stories/global/colors/colors.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Meta, ColorPalette, ColorItem } from '@storybook/blocks';

<Meta title="Global/Colors" />

<ColorPalette>
<ColorItem
title="Neutral"
subtitle="--color-neutral"
colors={{
'000': '#fff',
'100': '#f2f2f2',
'200': '#d2d2d2',
'300': '#b4b4b4',
'400': '#969696',
'500': '#787878',
'600': '#5a5a5a',
'700': '#3c3c3c',
'800': '#1e1e1e',
'900': '#000',
}}
/>
</ColorPalette>
2 changes: 1 addition & 1 deletion src/styles/atoms/_container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
.container {
--container-gap: clamp(var(--spacing-4), 6vw, var(--spacing-8));
--container-max-width: minmax(var(--container-gap), 1fr);
--content-max-width: min(120ch, 100% - var(--container-gap) * 2);
--content-max-width: min(140ch, 100% - var(--container-gap) * 2);
--breakout: minmax(0, var(--spacing-9));

display: grid;
Expand Down

0 comments on commit c1f2e37

Please sign in to comment.