CSS Modules Next (Intro)

Deam
Deam
Feb 9, 2018 · 2 min read
// styles.scss
.foo {
height: 200px;
width: 100px;
background-color: red;
}
.bar {
height: 200px;
width: 50px;
background-color: red;
}
// Final output (styles.css):
.a { height: 200px; }
.b { width: 100px; }
.c { background-color: red; }
.d { width: 50px; }
// Before transpilation:
<div styleName="foo">
<div styleName="bar"></div>
</div>
// After transpilation:
<div className="a b c">
<div className="a c d"></div>
</div>

Conclusion

Deam

Written by

Deam

Making Open Source contributions ⚡️

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade