Skip to content

Commit

Permalink
Merge pull request #852 from tblivet/feat/storybook_themes
Browse files Browse the repository at this point in the history
Update Storybook theme and add v9 preview
  • Loading branch information
Quetzacoalt91 authored Aug 27, 2024
2 parents 961e3c8 + 5a02471 commit 52399ce
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 8 deletions.
2 changes: 2 additions & 0 deletions storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ const config: StorybookConfig = {
managerHead: (head) => `
${head}
<link rel="stylesheet" type="text/css" href="/ibm-plex-sans.css" />
<link rel="stylesheet" type="text/css" href="/theme.css" />
`,
previewBody: (body) => `
<link rel="stylesheet" type="text/css" href="styles.css" />
<link rel="stylesheet" type="text/css" href="/theme.css" />
${body}
`,
staticDirs: [
Expand Down
2 changes: 2 additions & 0 deletions storybook/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import { Preview, twig } from "@sensiolabs/storybook-symfony-webpack5";

const cssEntrypoints = {
"9.0.0": ["/9.0.0/default/theme.css"],
"1.7.8.0": ["/1.7.8.0/default/theme.css"],
"1.7.3.0": ["/1.7.3.0/default/theme.css"],
};
Expand All @@ -44,6 +45,7 @@ const preview: Preview = {
toolbar: {
icon: "paintbrush",
default: defaultBoTheme,
dynamicTitle: true,
items: availableBoThemes.map((prestashopVersion) => ({
value: prestashopVersion,
title: `PrestaShop ${prestashopVersion}`,
Expand Down
41 changes: 35 additions & 6 deletions storybook/.storybook/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,43 @@ import { create } from "@storybook/theming/create";
import logo from "../public/logo.png";

export default create({
// Base
base: "light",

colorPrimary: "#000000",
colorSecondary: "#000000",
appBg: "#FFF",
appBorderRadius: 0,
fontBase: '"IBM Plex Sans", "Open Sans", Helvetica, Verdana, sans-serif',

// Branding
brandTitle: "Update assistant UI",
brandImage: logo,
brandUrl: "https://github.com/PrestaShop/autoupgrade",
brandTarget: "_blank",

// Color
colorPrimary: "#1d1d1b",
colorSecondary: "#1d1d1b",

// UI
appBg: "#ffffff",
appContentBg: "#ffffff",
appPreviewBg: "#ffffff",
appBorderColor: "#dddddd",
appBorderRadius: 0,

// Typography
fontBase: "IBM Plex Sans, Open Sans, Helvetica, Verdana, sans-serif",

// Text
textColor: "#1d1d1b",
textInverseColor: "#ffffff",
textMutedColor: "#5e5e5e",

// Toolbar
barBg: "#ffffff",
barTextColor: "#1d1d1b",
barHoverColor: "#3f3f3d",
barSelectedColor: "#1d1d1b",

// Input
inputBg: "#ffffff",
inputBorder: "#dddddd",
inputBorderRadius: 0,
inputTextColor: "#1d1d1b",
});
5 changes: 3 additions & 2 deletions storybook/package-lock.json

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

Binary file modified storybook/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions storybook/public/theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**************************************************
Update assistant theme
**************************************************/

/***** Storybook *****/

#root {
/* Logo size */
.css-1rb1jn6 {
max-width: 100%;
max-height: 80px;
}

/* Search bar */
.css-wxp9lh {
height: 36px;
box-shadow: none;
border-radius: 0;
border: 1px solid #dddddd;
}
.css-1gaziuq {
top: 0;
height: 100%;
}
}

/***** Preview layout *****/
#storybook-root {
#main {
padding: 0;
}

#content {
&.bootstrap {
padding: 0;
}
}
}

0 comments on commit 52399ce

Please sign in to comment.