1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/app-desktop/gui/style/StyledInput.tsx

29 lines
1009 B
TypeScript
Raw Normal View History

2020-09-15 15:01:07 +02:00
const styled = require('styled-components').default;
const Color = require('color');
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
type StyleProps = any;
2020-09-15 15:01:07 +02:00
const StyledInput = styled.input`
border: 1px solid ${(props: StyleProps) => Color(props.theme.color3).alpha(0.6)};
2020-09-15 15:01:07 +02:00
border-radius: 3px;
font-size: ${(props: StyleProps) => props.theme.fontSize}px;
color: ${(props: StyleProps) => props.theme.color};
2020-09-15 15:01:07 +02:00
padding: 0 8px;
height: ${(props: StyleProps) => `${props.theme.toolbarHeight}px`};
max-height: ${(props: StyleProps) => `${props.theme.toolbarHeight}px`};
2020-09-15 15:01:07 +02:00
box-sizing: border-box;
background-color: ${(props: StyleProps) => Color(props.theme.backgroundColor4).alpha(0.5)};
2020-09-15 15:01:07 +02:00
&::placeholder {
color: ${(props: StyleProps) => props.theme.colorFaded};
2020-09-15 15:01:07 +02:00
}
&:focus {
background-color: ${(props: StyleProps) => props.theme.backgroundColor4};
border: 1px solid ${(props: StyleProps) => props.theme.color3};
2020-09-15 15:01:07 +02:00
}
`;
export default StyledInput;