Skip to content

Commit

Permalink
Reverting again.
Browse files Browse the repository at this point in the history
  • Loading branch information
bspeare committed Jan 22, 2024
1 parent 345aef7 commit 77e7982
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
7 changes: 2 additions & 5 deletions src/components/Introduction.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@ HTML markup for each component can be found in the HTML tab on each component st

## Base CSS


- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/src/fonts.css`}>Fonts</a>
- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/src/base.css`}>Base</a>


- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/dist/css/base/fonts.css`}>Fonts</a>
- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/dist/css/base/base.css`}>Base</a>
9 changes: 4 additions & 5 deletions src/components/brand-bar/BrandBarDocs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ HTML markup can be found in the HTML tab on each component story.</p>
## Base CSS


- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/src/fonts.css`}>Fonts</a>
- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/src/base.css`}>Base</a>
- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/dist/css/base/fonts.css`}>Fonts</a>
- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/dist/css/base/base.css`}>Base</a>

## Component CSS

- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/src/components/logo/logo.css`}>Logo</a>
- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/src/components/brand-bar/brand-bar.css`}>Brand Bar</a>

- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/dist/css/components/logo/logo.css`}>Logo</a>
- <a href={`https://github.com/uiowa/uids/tree/gh-pages/docs/v${version}/dist/css/components/brand-bar/brand-bar.css`}>Brand Bar</a>

<Primary withSource="none" />

Expand Down
14 changes: 8 additions & 6 deletions vite-css-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ export function cssPerComponentPlugin() {
const isBaseFile = files_to_compile.some(file => id.endsWith(file));

if (isBaseFile) {
// Extract the base file name
const baseFileName = path.basename(id, '.scss');

// Define the output CSS path for base files
let relativePath = path.relative(process.cwd(), id);
relativePath = relativePath.replace('/assets/scss/', '/');
const outputCssPath = relativePath.replace('.scss', '.css');
const outputCssPath = `dist/css/base/${baseFileName}.css`;

// Compile SCSS to CSS
const result = sass.renderSync({
Expand All @@ -39,9 +40,11 @@ export function cssPerComponentPlugin() {
// Extract the component name and path
const matches = id.match(/\/components\/([^/]+)\/([^/]+)\.scss/);
if (matches) {
const componentName = matches[2];
const componentPath = matches[1];

// Define the output CSS path based on the component structure
const relativePath = path.relative(process.cwd(), id);
const outputCssPath = relativePath.replace('.scss', '.css');
const outputCssPath = `dist/css/components/${componentPath}/${componentName}.css`;

// Compile SCSS to CSS
const result = sass.renderSync({
Expand All @@ -63,4 +66,3 @@ export function cssPerComponentPlugin() {
},
};
}

0 comments on commit 77e7982

Please sign in to comment.