Skip to content

Commit

Permalink
🐛 Fix admonition sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Sep 27, 2023
1 parent a256779 commit 5697b1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/theme-nonepress/src/theme/Admonition/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export default function Admonition(props: Props): JSX.Element {
return (
<div
className={clsx(
"alert admonition",
"admonition",
typeConfig.className && `admonition-${typeConfig.className}`,
ThemeClassNames.common.admonition,
ThemeClassNames.common.admonitionType(props.type),
Expand Down
31 changes: 9 additions & 22 deletions packages/theme-nonepress/src/theme/Admonition/styles.css
Original file line number Diff line number Diff line change
@@ -1,40 +1,27 @@
.admonition {
@apply mb-4 gap-0 justify-items-start text-left;
@apply grid-flow-col grid-cols-[auto_minmax(auto,1fr)];
@apply block w-full mb-4 p-4 text-left;
@apply rounded-box bg-base-200 text-base-content;
@apply border border-base-200;
@apply transition-[color,background-color,border-color] duration-500;

&-note {
--alert-bg: hsl(var(--bc) / 10%);
--alert-bg-mix: hsl(var(--b1));

@apply border-base-content/20;
@apply bg-base-content/10 border-base-content/20;
}

&-success {
--alert-bg: hsl(var(--su) / 40%);
--alert-bg-mix: hsl(var(--b1));

@apply border-success/20;
@apply bg-success/40 border-success/20;
}

&-error {
--alert-bg: hsl(var(--er) / 40%);
--alert-bg-mix: hsl(var(--b1));

@apply border-error/20;
@apply bg-error/40 border-error/20;
}

&-info {
--alert-bg: hsl(var(--in) / 40%);
--alert-bg-mix: hsl(var(--b1));

@apply border-info/20;
@apply bg-info/40 border-info/20;
}

&-warning {
--alert-bg: hsl(var(--wa) / 40%);
--alert-bg-mix: hsl(var(--b1));

@apply border-warning/20;
@apply bg-warning/40 border-warning/20;
}

&-title {
Expand Down

0 comments on commit 5697b1d

Please sign in to comment.