CSS Modules are a relatively new concept (you can dive super-deep into them here: https://github.com/css-modules/css-modules). With CSS modules, you can write normal CSS code and make sure, that it only applies to a given component.
Example:
In Post.css File
.Post {
color: red;
}
In Post Component File
import classes from './Post.css';
const post = () => (
<div className={classes.Post}>...</div>
);
By the way, if you somehow also want to define a global (i.e. un-transformed) CSS class in such a .css
file, you can prefix the selector with :global
.
Example:
:global .Post { ... }
Now you can use className="Post"
anywhere in your app and receive that styling.