Skip to content

引入less, className={"header"}有效果, className={styles.header}没有效果 #114

Open
@scxslsh

Description

@scxslsh

import styles from './home.less';

// 有效果
<h2 className={"header"}>Home</h2>

// 没有效果
<h2 className={styles.header}>Home</h2>

// home.less
.header {
padding: 0 12px;
color: #666666;
cursor: move;
}

Activity

sidkalluri

sidkalluri commented on Apr 16, 2020

@sidkalluri

I'm noticing the same. Not sure if this is the new way of styling.

scxslsh

scxslsh commented on Apr 17, 2020

@scxslsh
Author

I'm noticing the same. Not sure if this is the new way of styling.
I currently use sass because I don't want to use eject

FlexibleHha

FlexibleHha commented on Jan 15, 2021

@FlexibleHha

you need css module 。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      引入less, className={"header"}有效果, className={styles.header}没有效果 · Issue #114 · ant-design/create-react-app-antd