CSS ".module" files

Apparently, it’s really simple to export basically anything in CSS with the .module rather than .css extension.

However, this is all I know. I’ve seen an example which had pretty confusing syntax, but it had a simple export > import structure and could apparently export more than only “--” variables, so I’m pretty interested in using it rather than classic exports.

Could someone please explain what these files are, or clear up my misunderstanding if I’m thinking of something else? :fearful:

Hello!

Sounds like you saw some React file. React is a JavaScript framework you will learn about down the web development path.

With .module you can style a single React component locally and overwrite global.css files that style the entire app.

This is advanced knowledge you don’t have to worry about yet when you have just started.

2 Likes

Oh, so .module files are an extension of react?
That would make sense, and if CSS isn’t being fully used to compile .module files.

Sorry for the late reply, I don’t really use this forum

Whatever React build system you are using can just have support for them (Vite, CRA, etc.). You do not have to use React to use CSS modules.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.