Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Styled Component Semantic kit ( Form . Input )

Hello I would like to know how I could change css with the styled component of the form. semantic input

I need something like this on hoover:

enter image description here

But I can't change the background color of the input and also the border color in both default

and hover:
export const FormCustom = styled(Form)`
&&& {
    background: #000;
}
`
export const FormInput = styled(Form.Input)`
&&& {
    color: red;
    background: transparent;
}
`

tried but to no avail

export const FormInput = styled(Form.Input)`
&&& {
    color: red;
    background: transparent;
}
`

my form:

<FormCustom size='large'>
        <Segment basic>
          <FormInput fluid icon='user' iconPosition='left' placeholder='E-mail address' />
          <FormInput
            fluid
            icon='lock'
            iconPosition='left'
            placeholder='Password'
            type='password'
          />

          <Button color='teal' fluid size='large'>
            Login
          </Button>
        </Segment>
      </FormCustom>

code: https://codesandbox.io/s/fast-morning-hq5zq


1 Answers

You can use &:hover to define hover.

   export const FormInput = styled(Form.Input)`
      border: 1px solid transparent;
      &:hover {
        border:1px solid #ff0000;
        border-radius:5px;
      }
    `;

temporary sample sandbox

like image 55
Alex Avatar answered Dec 08 '25 08:12

Alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!