Merge pull request #29199 from backstage/canon-single-css

Canon: Build a single css output
This commit is contained in:
Charles de Dreuille
2025-03-13 09:32:59 +00:00
committed by GitHub
5 changed files with 22 additions and 7 deletions
+1 -2
View File
@@ -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 ✨
+1 -1
View File
@@ -2,4 +2,4 @@
storybook-static
# CSS output
css
/css
+1 -4
View File
@@ -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: {
+1
View File
@@ -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
+18
View File
@@ -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';