diff --git a/canon-docs/src/app/(docs)/page.mdx b/canon-docs/src/app/(docs)/page.mdx index b2abdefb12..862127ec7b 100644 --- a/canon-docs/src/app/(docs)/page.mdx +++ b/canon-docs/src/app/(docs)/page.mdx @@ -24,8 +24,7 @@ Install Canon using a package manager. Import the global CSS file at the root of your application. ```tsx -import '@backstage/canon/css/core.css'; -import '@backstage/canon/css/components.css'; +import '@backstage/canon/css/styles.css'; ``` ### 3. Start building ✨ diff --git a/packages/canon/.gitignore b/packages/canon/.gitignore index e7c52ff306..b200b44847 100644 --- a/packages/canon/.gitignore +++ b/packages/canon/.gitignore @@ -2,4 +2,4 @@ storybook-static # CSS output -css +/css diff --git a/packages/canon/.storybook/preview.tsx b/packages/canon/.storybook/preview.tsx index e278bb011f..b1bfa2dc88 100644 --- a/packages/canon/.storybook/preview.tsx +++ b/packages/canon/.storybook/preview.tsx @@ -1,10 +1,7 @@ import React from 'react'; import type { Preview, ReactRenderer } from '@storybook/react'; import { withThemeByDataAttribute } from '@storybook/addon-themes'; - -// Canon specific styles -import '../src/css/core.css'; -import '../src/css/components.css'; +import '../src/css/styles.css'; const preview: Preview = { parameters: { diff --git a/packages/canon/scripts/build-css.mjs b/packages/canon/scripts/build-css.mjs index 4ea38f8085..e0ba8378a9 100644 --- a/packages/canon/scripts/build-css.mjs +++ b/packages/canon/scripts/build-css.mjs @@ -31,6 +31,7 @@ const componentsDir = 'src/components'; const cssFiles = [ { path: `${cssDir}/core.css`, newName: 'core.css' }, { path: `${cssDir}/components.css`, newName: 'components.css' }, + { path: `${cssDir}/styles.css`, newName: 'styles.css' }, ]; // Components files diff --git a/packages/canon/src/css/styles.css b/packages/canon/src/css/styles.css new file mode 100644 index 0000000000..f5d623389f --- /dev/null +++ b/packages/canon/src/css/styles.css @@ -0,0 +1,18 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@import './core.css'; +@import './components.css';