Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate unique class name in css file if it referenced in JSX #284

Open
yudium opened this issue Jan 20, 2020 · 0 comments
Open

Generate unique class name in css file if it referenced in JSX #284

yudium opened this issue Jan 20, 2020 · 0 comments

Comments

@yudium
Copy link

yudium commented Jan 20, 2020

I want to request a feature. Rather than having to use styleName on every element we can put it only on parent element and use existing global class. So JSX syntax will more simpler to look.

For example when I use bootstrap:

<div styleName="container">
    <div className="card" styleName="card">
        <div className="card-header" styleName="card-header">Title Here</div>
        <div className="card-body" styleName="card-body">Body Here</div>
    </div>
</div>

Will much simpler to look if we put styleName only on parent element:

<div styleName="container">
    <div className="card">
        <div className="card-header">Title Here</div>
        <div className="card-body">Body Here</div>
    </div>
</div>

so SCSS:

.container {  <-- generate only this to be a unique class Name
    margin: 0;
    .card {
        font-size: 14px;
        .card-header {
             background: #ddd;
        }
        .card-body {
             background: #f8f8f8;
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant