I want to have consistent styles for both a styled input
element and a styled select
element.
Currently, I accomplish this using string interpolation:
const styles = `
background-color: white;
width: 100%;
border: 0 solid transparent;
border-radius: 10px;
margin-bottom: 20px;
padding-top: 5px;
padding-bottom: 5px;
font-size: 1.2rem;
`
const Select = styled.select`${styles}`
const Input = styled.input`${styles}`
Is there a more efficient way to achieve this without relying on a 'raw' string? One drawback of using the raw styles
string is that Visual Studio Code doesn't provide syntax highlighting for it: