Before watching this tutorial, I used to find css modules and its import and reference styles using JavaScript syntax quite complex for its benefits. That's why I avoided modules like the plague. Thank you Telmo, this was very helpful!
You rock. Thanks for the instruction. Why everyone says we have to either eject or install some script modules from start? What you describe works just fine...
Thanks for sharing Telmo, Im still learning the basics of react but it was a really helpful tutorial to strengthen my basic knowledge in order to going forward to more advanced tips very soon...hugs from Brazil...just keep it up.
Very useful vídeo :) I was using this technique already (because it comes with Nx workspaces) but I ddin't know it was called CSS Modules. Keep up the good work!
I had one question. let's say there are two components, A and B and two CSS files A.css and B.css, and compo A and B have several in them now let's say I want to color all buttons in A red and all buttons in B blue. can I solve this problem without giving the class name to ?
Great video, very well explained. I don't really see the point in using modules though... you have to type a lot more code for it to just add a unique classname in the end anyway so why not use id for individual styling and then you can use classnames for universal styling? Like if I wanted all the buttons to have 20px padding I could give them the classname of btn and give them all 20px padding and then I could use an id for each button also to, for example, change the background color if I wanted them to have different background colors.
I get the problem it solves, just not why the problem is there in the first place. Like, we have a component called Example.js In that, we import example.css So since this is the only place that this CSS is imported and therefore used, why can it conflict with other components? They havent linked/imported the stylesheet?
What if i have to apply two classname will I do :- className={stylesCSS.firstclass} className={stylesCSS.secondclass} ? or i have any option similar to: className={stylesCSS.firstclass, stylesCSS.secondclass} ??
Thank you for helping man! 🙌 Please keep making such videos 🥇🎖 Can you also tell how to use css modules concept with bootstrap or I will say if I want to use bootstrap different version. Thanks in advance 👍
you did not include on your tutorial that we need to do this , module.exports = { module: { rules: [ { test: /\.css$/, use: [ 'style-loader', { loader: 'css-loader', options: { modules: true } } ] } ] } };
Probably the best explanation of CSS Modules you can find on TH-cam. Thanks a lot, Telmo!
Before watching this tutorial, I used to find css modules and its import and reference styles using JavaScript syntax quite complex for its benefits. That's why I avoided modules like the plague. Thank you Telmo, this was very helpful!
honestly as someone who just came here to learn about css in react... you taught me a new concept i didn't knew about thanks
Thank you so much for explaining React components with CSS modules in such a simple and beautiful way. That was very helpful
i was looking everywhere because i had very problems with the css styles , and you have resolved it, thanks a lot Telmo
This video is very useful for styling individual components. Thank you for such a simplified explanation.
You rock. Thanks for the instruction. Why everyone says we have to either eject or install some script modules from start? What you describe works just fine...
you solved my problem. was stuck with this for couple of hours. thank you bro.
Thanks for sharing Telmo, Im still learning the basics of react but it was a really helpful tutorial to strengthen my basic knowledge in order to going forward to more advanced tips very soon...hugs from Brazil...just keep it up.
Tankyou bro for this tutorial
Very useful vídeo :) I was using this technique already (because it comes with Nx workspaces) but I ddin't know it was called CSS Modules. Keep up the good work!
TH-camrs like you deserves lot of subs. I subbed you. Please do make React tutorials in depth with building projects like TODO and ecommerce etc.
Special thanks YOU deserved NATIONAL AWARD
man you are a god of teaching for sure
I love how clear the video is
It's cool when there is like 2 styles to scope but when you want it scoped for each components just switch to vuejs
Prefect. Chatgpt failed to give me this option.
Amazing for no css conflict
Great video helped me understand css modules
Thank you for explaining the importance of React css module
Made it look simple.Well explained!
I had one question. let's say there are two components, A and B
and two CSS files A.css and B.css, and compo A and B have several in them now
let's say I want to color all buttons in A red and all buttons in B blue.
can I solve this problem without giving the class name to ?
thank u, I was so frustrated and this video helped a lot
Thanks you. Was wondering why I was having issues sizing my page
Thanks a lot. I wondered why I need to use CSS module and this video made it clear to me. :)
You saved me from a big headache thank you man!
Thanks for making this video was searching for it since 😊😊
So simple and straight forward....I love it. Thank you
thank u sr, this tutorial was very usefull for me , and im glad, the way u used to explain , gave me some Brainstorming thanks guy.
how do you target/change the tag without a class name?
Just use “body” selector without a class
Thanks bro, that is what I expected to understand this topic, very clear explanation!
Thanks for your video. I fastly reminded how to connect css (scss) modules.
Great video.understood module clearly. No time wasted
Thank you for simple explantion TELMO✌✌✌✌we are looking forward to the others videos😊😊😊
Lots of thanks for such a wonderful video on css modules
You’re awesome Telmo
Thanks Code Light 😊
Can you add css styles inside of the script tag in react application?
Thank you this tutorial is crystal clear , perfect.
What a fantastic explanation, thank you so much
Thanks Man, Helped a lot
Thanks man , I was having exact same problem
Thank you, man. It really helps me a lot.
really like your accent very good way of teaching
Thanks you! Explained my issue
Great video. I didnt even have to see your name, I knew by your accent you were Portuguese lol. Obrigado pelo video
I understand why use css module now thank😆
Great video, very well explained. I don't really see the point in using modules though... you have to type a lot more code for it to just add a unique classname in the end anyway so why not use id for individual styling and then you can use classnames for universal styling?
Like if I wanted all the buttons to have 20px padding I could give them the classname of btn and give them all 20px padding and then I could use an id for each button also to, for example, change the background color if I wanted them to have different background colors.
In module.css file can we create more than one class or Id in the file??
Thank you so much dude.,
problem solving .,
i score you 100 of 100...🌟🌟🌟
I get the problem it solves, just not why the problem is there in the first place.
Like, we have a component called Example.js
In that, we import example.css
So since this is the only place that this CSS is imported and therefore used, why can it conflict with other components? They havent linked/imported the stylesheet?
how can i create global variables for scss modules?
will using css module impact performance?
excellent explanation. shukran
Very useful! Thanks for sharing!
Haha thank you!. This is exactly what I was looking for but it was hard to find..
How do you do conditional classes with this technique?
thank u .simple and clear explanation .it's useful
Thanks you so much for this video.
Can i use bootstrap classes in it ?
Thanks, buddy.
It worked well for me.
Thanks buddy!! Jazakallah
really really helpful, thank you very much !
Thanks bro. This is useful
Thanks for the tutorial, very well explained.
Very usefull and great video! I like that you're straight to the point. Thank you so much!
Thank you sir. well explained!!.
nice and helpful video. thx so much.
dose it work with sass ?
great video sir
Thanks you for sharing 😀😀
Very useful. Thank you.
When i did it with a complicated name like form-control , it made me an error have u any solution ?
Nice video bro, thanks a lot
Thanks dude:)
really helpful, thanks
Thanks a lot!
very helpful tutorual ty very much
What if i have to apply two classname will I do :- className={stylesCSS.firstclass} className={stylesCSS.secondclass} ? or i have any option similar to: className={stylesCSS.firstclass, stylesCSS.secondclass} ??
got the solution stackoverflow.com/questions/33949469/using-css-modules-how-do-i-define-more-than-one-style-name
Very useful. Thanks for the tutorial :)
Should we do it for every single class?
thank you so much for this!
Excellent as always! Abraço
Thankyou for this man @Telmo Sampaio
buen video!muchas gracias :D
Helpful thanks
This seems more complex than to just use a different css class name. What's the benefits? I'm new so I'm probably missing something
Good tutorial...it is timely
And how do you add multiple class names?
Styles.classname(‘${myclass1} ${myclass2}’)
Hey Telmo how are you. What's the theme you are using on the vs code?
Hi Mark, I'm using the Cobalt2 theme
@@Telmosampaio alright thanks
Very good.
Thank you for this,
Thanks alot
Tnq sm
this is not working for me, the style is still applied globally
thank you
Thank you for helping man! 🙌
Please keep making such videos 🥇🎖
Can you also tell how to use css modules concept with bootstrap or I will say if I want to use bootstrap different version. Thanks in advance 👍
04:06 sounded American for just a second there!
thanks brow!!!
by brazil
className takes in a string but you're passing in a class, how is that possible. sorry if I missed the answer to this
you did not include on your tutorial that we need to do this , module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: true
}
}
]
}
]
}
};
tnx