Skip to content

Commit

Permalink
fix style block for docs generator
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 committed Dec 19, 2023
1 parent 76b6fde commit 029b7b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import { storePreview } from './stores';
import type { ColorSettings, FormTheme, ContrastReport } from './types';
import { inputSettings, fontSettings } from './settings';
import { type Palette, generatePalette, generateA11yOnColor, hexValueIsValid, getPassReport } from './colors';
import { type Palette, generatePalette, generateA11yOnColor, hexValueIsValid, getPassReport, createStyleBlock } from './colors';
import type { PopupSettings } from '@skeletonlabs/skeleton';
// Stores
Expand Down Expand Up @@ -197,7 +197,7 @@ export const myCustomTheme: CustomThemeConfig = {
}`;
}
$: livePreviewStylesheet = $storePreview ? `\<style\>${cssOutput}\</style\>` : '';
$: livePreviewStylesheet = $storePreview ? createStyleBlock(cssOutput) : '';
</script>

<!-- Live Preview of Generated Theme -->
Expand Down
4 changes: 4 additions & 0 deletions sites/skeleton.dev/src/lib/layouts/DocsThemer/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,7 @@ export function getPassReport(textColor: string, backgroundColor: string): PassR
fails
};
}

export function createStyleBlock(cssOutput: string) {
return `<style>${cssOutput}</style>`;
}

0 comments on commit 029b7b4

Please sign in to comment.