Skip to content

Commit

Permalink
refactor(storybook): use STORYBOOK_* env variables (#10546)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
joshblack and kodiakhq[bot] committed Jan 28, 2022
1 parent e791900 commit c3771b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/react/.storybook/addon-theme/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
CARBON_TYPE_PANEL_ID,
} from './shared';

if (process.env.CARBON_REACT_STORYBOOK_USE_CUSTOM_PROPERTIES === 'true') {
if (process.env.STORYBOOK_USE_CUSTOM_PROPERTIES === 'true') {
// Disabling because storybook addons doesn't provide proptypes or display names for these panels
/* eslint-disable react/display-name, react/prop-types */
addons.register(CARBON_THEMES_ADDON_ID, (api) => {
Expand Down
14 changes: 7 additions & 7 deletions packages/react/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ const customProperties = require('postcss-custom-properties');
const rtlcss = require('rtlcss');

const {
CARBON_REACT_STORYBOOK_USE_CUSTOM_PROPERTIES = 'false',
CARBON_REACT_STORYBOOK_USE_RTL,
CARBON_REACT_STORYBOOK_USE_SASS_LOADER,
STORYBOOK_USE_CUSTOM_PROPERTIES = 'false',
STORYBOOK_USE_RTL,
STORYBOOK_USE_SASS_LOADER,
NODE_ENV = 'development',
} = process.env;

const useSassLoader = CARBON_REACT_STORYBOOK_USE_SASS_LOADER === 'true';
const useSassLoader = STORYBOOK_USE_SASS_LOADER === 'true';
const useExternalCss = NODE_ENV === 'production';
const useRtl = CARBON_REACT_STORYBOOK_USE_RTL === 'true';
const useRtl = STORYBOOK_USE_RTL === 'true';

module.exports = {
addons: [
Expand Down Expand Up @@ -89,7 +89,7 @@ module.exports = {
return `
$feature-flags: (
ui-shell: true,
enable-css-custom-properties: ${CARBON_REACT_STORYBOOK_USE_CUSTOM_PROPERTIES},
enable-css-custom-properties: ${STORYBOOK_USE_CUSTOM_PROPERTIES},
);
${content}
`;
Expand All @@ -108,7 +108,7 @@ module.exports = {
data: `
$feature-flags: (
ui-shell: true,
enable-css-custom-properties: ${CARBON_REACT_STORYBOOK_USE_CUSTOM_PROPERTIES},
enable-css-custom-properties: ${STORYBOOK_USE_CUSTOM_PROPERTIES},
);
`,
implementation: require('sass'),
Expand Down

0 comments on commit c3771b2

Please sign in to comment.