revite/src/components/ui/InputBox.tsx

36 lines
785 B
TypeScript
Raw Normal View History

2021-06-18 07:05:01 -04:00
import styled, { css } from "styled-components";
interface Props {
readonly contrast?: boolean;
2021-06-18 10:46:30 -04:00
}
2021-06-18 07:05:01 -04:00
2021-06-18 10:18:10 -04:00
export default styled.input<Props>`
2021-06-18 07:05:01 -04:00
z-index: 1;
padding: 8px 16px;
border-radius: 6px;
color: var(--foreground);
border: 2px solid transparent;
background: var(--primary-background);
transition: 0.2s ease background-color;
2021-06-18 10:57:08 -04:00
transition: border-color 0.2s ease-in-out;
2021-06-18 07:05:01 -04:00
&:hover {
background: var(--secondary-background);
}
&:focus {
border: 2px solid var(--accent);
}
2021-06-18 10:57:08 -04:00
${(props) =>
props.contrast &&
css`
color: var(--secondary-foreground);
background: var(--secondary-background);
2021-06-18 07:05:01 -04:00
2021-06-18 10:57:08 -04:00
&:hover {
background: var(--hover);
}
`}
2021-06-18 07:05:01 -04:00
`;