In my attempt to style a nested <Input />
component using styled-components, I find myself facing a challenge. The nested input is being utilized within a different component that displays a dropdown when typing. My goal is to apply padding-left: 3rem
to this input, but unfortunately, I am unable to access it directly from the parent component <Dropdown />
.
<Dropdown
options={options}
/>
I have imported the above code where it is needed. Now, I am seeking a way to modify the padding of the following input inside the <Dropdown />
.
<div>
<Input {...props}/> // It is necessary to adjust the padding here
// Here will be the rendered unique input for this new component
</div>
The aforementioned <Input />
is imported from another component which serves as the standard input in various scenarios.
export const Dropdown = styled(DropDown)`
padding-left: 3rem !important;
`;
Despite the overall functionality working smoothly, the desired padding adjustment on the inner Input does not take effect.
What steps should I take next?