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

chore: chromatic changes #3685

Draft
wants to merge 17 commits into
base: chore-chromatic
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion chromatic.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"$schema": "https://www.chromatic.com/config-file.schema.json",
"autoAcceptChanges": "v4-dev",
"exitOnceUploaded": true,
"onlyChanged": true
"onlyStoryNames": ["Components/**", "Compositions/**", "Page examples/**"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import bannerDataImage from '@ecl/specs-component-banner/demo/data--image';
import banner from './banner.html.twig';

export default {
title: 'Components/Banner',
parameters: { layout: 'fullscreen' },
};

export const States = (_, { loaded: { component } }) => component;

States.render = async () => {
const renderedBannerStates = `<h4>Without title</h4>
${await banner({ ...bannerDataImage, title: '', link: {} })}
<h4>Without description</h4>
${await banner({ ...bannerDataImage, description: '', link: {} })}
<h4>With a CTA button</h4>
${await banner(bannerDataImage)}
<h4>Without credits</h4>
${await banner({ ...bannerDataImage, credit: '', link: {} })}
`;
return renderedBannerStates;
};
States.tags = ['!dev'];
States.parameters = {
chromatic: {
viewports: [480, 768, 1024, 1200],
},
};

export const Sizes = (_, { loaded: { component } }) => component;

Sizes.render = async () => {
const renderedBannerSizes = `<h4>Large size</h4>
${await banner({ ...bannerDataImage, size: 'l', link: {} })}
<h4>Medium size</h4>
${await banner({ ...bannerDataImage, size: 'm', link: {} })}
<h4>Small size</h4>
${await banner({ ...bannerDataImage, description: '', size: 's', link: {} })}
<h4>Extra small size</h4>
${await banner({ ...bannerDataImage, description: '', size: 'xs', link: {} })}
`;
return renderedBannerSizes;
};
Sizes.tags = ['!dev'];
Sizes.parameters = {
chromatic: {
viewports: [480, 768, 1024, 1200],
},
};

export const Displays = (_, { loaded: { component } }) => component;

Displays.render = async () => {
const renderedBannerDisplays = `<h4>Large font size</h4>
${await banner({ ...bannerDataImage, font_size: 'l', link: {} })}
<h4>Dark box background</h4>
${await banner({ ...bannerDataImage, box_background: 'dark', link: {} })}
<h4>Transparent box</h4>
${await banner({ ...bannerDataImage, box_background: 'none', font_color: 'light', link: {} })}
<h4>Centered alignment</h4>
${await banner({ ...bannerDataImage, horizontal: 'center', link: {} })}
<h4>Right alignment</h4>
${await banner({ ...bannerDataImage, horizontal: 'right', link: {} })}
<h4>Top alignment</h4>
${await banner({ ...bannerDataImage, size: 'l', vertical: 'top', link: {} })}
<h4>Bottom alignment</h4>
${await banner({ ...bannerDataImage, size: 'l', vertical: 'bottom', link: {} })}
`;
return renderedBannerDisplays;
};
Displays.tags = ['!dev'];
Displays.parameters = {
chromatic: {
viewports: [480, 768, 1024, 1200],
},
};
1 change: 1 addition & 0 deletions src/playground/ec/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module.exports = {
addons,
webpackFinal,
staticDirs,
webpackStatsJson: true,
features: {
postcss: false,
},
Expand Down
1 change: 1 addition & 0 deletions src/playground/eu/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module.exports = {
addons,
staticDirs,
webpackFinal,
webpackStatsJson: true,
features: {
postcss: false,
},
Expand Down
2 changes: 1 addition & 1 deletion src/themes/ec/variables/_blockquote.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@use '../index' as *;

$blockquote: (
border-width: 4px,
border-width: 8px,
border-color: var(--c-p),
border-radius: 2px,
shadow: var(--sh-1),
Expand Down
2 changes: 1 addition & 1 deletion src/themes/eu/variables/_blockquote.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@use '../index' as *;

$blockquote: (
border-width: 8px,
border-width: 4px,
border-color: var(--c-p),
border-radius: 4px,
shadow: var(--sh-1),
Expand Down
Loading