styled components语法

1.继承
const Background = styled.div`
    background-color: red;
`

const LoginWrapper = styled(Background)`
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    .login {
        padding: 20px;
        width: 400px;
        height: 250px;
        .login-form-forgot {
            color: #1890ff;
            &:hover {
                opacity: 0.8;
                cursor: pointer;
            }
        }
    }
`

2.传参
使用props接收

你可能感兴趣的:(styled components语法)