fix: accent buttons and allow selection of back

fixes #398
fixes #397
This commit is contained in:
Paul
2021-11-14 18:29:46 +00:00
parent d1a15ec158
commit 9ffacc07ca
2 changed files with 17 additions and 9 deletions

View File

@@ -5,13 +5,13 @@ import { Text } from "preact-i18n";
import { Children } from "../../types/Preact";
type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "as"> & {
hoverEnabled?: boolean;
error?: string;
hover?: boolean;
block?: boolean;
spaced?: boolean;
noMargin?: boolean;
children?: Children;
type?: "default" | "subtle" | "error";
type?: "default" | "subtle" | "error" | "accent";
};
const OverlineBase = styled.div<Omit<Props, "children" | "error">>`
@@ -19,13 +19,13 @@ const OverlineBase = styled.div<Omit<Props, "children" | "error">>`
transition: 0.2s ease filter;
${(props) =>
props.hoverEnabled &&
props.hover &&
css`
cursor: pointer;
transition: 0.2s ease filter;
&:hover {
filter: brightness(1.2);
cursor: pointer;
transition: 0.2s ease filter;
}
`}
@@ -61,6 +61,14 @@ const OverlineBase = styled.div<Omit<Props, "children" | "error">>`
color: var(--error);
`}
${(props) =>
props.type === "accent" &&
css`
font-size: 12px;
font-weight: 400;
color: var(--accent);
`}
${(props) =>
props.block &&
css`