Skip to content

Commit

Permalink
Merge branch 'fix/style-cascading'
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Nov 28, 2024
2 parents 28b1eff + a5c7756 commit 8b1ce58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/layouts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { html } from 'hono/html';

type LayoutProps = {
title: string;
style?: any; // TODO: Find HTMLEscapedString
cssUrls?: string[];
jsUrls?: string[];
};
Expand All @@ -20,6 +21,7 @@ export const Layout: FC<PropsWithChildren<LayoutProps>> = (props) => {
{props.jsUrls?.map((js) => (
<script src={js} key={js} />
))}
{props.style || null}
</head>
<body>{props.children}</body>
</html>
Expand Down
6 changes: 6 additions & 0 deletions src/routes/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ app.get('/:slug', async (c) => {
'https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css',
'https://cdn.jsdelivr.net/npm/[email protected]/lib/index.min.css',
];
const style = `
.tag {
all: revert;
}
`;
return c.html(
<Layout
title={`[PREVIRE]: ${content.frontMatter?.title}`}
cssUrls={cssUrls}
style={<style dangerouslySetInnerHTML={{ __html: style }} />}
>
<section class="section">
<h1 class="title">
Expand Down

0 comments on commit 8b1ce58

Please sign in to comment.