Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop fjern colored bg #2291

Merged
merged 4 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .storybook/main.less

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const config: StorybookConfig = {
name: getAbsolutePath('@storybook/react-vite'),
options: {},
},
staticDirs: ['../public'],
staticDirs: ['./public'],
managerHead: head =>
`${head}<link rel="icon" type="image/x-icon" href="/favicon.ico">`,
};
Expand Down
5 changes: 1 addition & 4 deletions .storybook/preview.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '@sb1/ffe-core/css/spacing.css';
@import '@sb1/ffe-core/css/colors.css';

.ffe-docs-content-container--colored {
.ffe-docs-content-container {
padding: var(--ffe-spacing-sm);
}

Expand All @@ -10,7 +10,4 @@
&--dark-mode {
background: var(--ffe-farge-svart);
}
&--colored {
background: var(--ffe-farge-fjell);
}
}
16 changes: 4 additions & 12 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,19 @@ const preview: Preview = {
decorators: [
(Story, context) => {
const { scheme } = context.globals;
if (scheme === 'all') {
if (scheme === 'both') {
return (
<>
<div className="ffe-docs-content-container">
<Story />
</div>
<div className="ffe-docs-content-container ffe-docs-content-container--colored">
<Story onColoredBg={true} />
</div>
<div className="ffe-docs-content-container ffe-docs-content-container--dark-mode regard-color-scheme-preference">
<Story />
</div>
</>
);
} else if (scheme === 'colored') {
return (
<div className="ffe-docs-content-container ffe-docs-content-container--colored">
<Story onColoredBg={true} />
</div>
);
} else if (scheme === 'dark') {
}
if (scheme === 'dark') {
return (
<div className="ffe-docs-content-container ffe-docs-content-container--dark-mode regard-color-scheme-preference">
<Story />
Expand All @@ -62,7 +54,7 @@ const preview: Preview = {
},
toolbar: {
icon: 'mirror',
items: ['light', 'dark', 'colored', 'all'],
items: ['light', 'dark', 'both'],
dynamicTitle: true,
},
},
Expand Down
File renamed without changes
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
2,
'always',
[
'.storybook',
'release',
'component-overview',
'eslint-config-ffe',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
"build-storybook": "storybook build"
},
"lint-staged": {
"{packages,buildtool,component-overview,linting,test}/**/*.{js,jsx,ts,tsx,json,css,less,md}": [
"{packages,buildtool,component-overview,linting,test,.storybook}/**/*.{js,jsx,ts,tsx,json,css,less,md}": [
"prettier --write"
]
},
"workspaces": [
".storybook/*",
"packages/*",
"linting/*",
"buildtool",
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading