Styling React Components with CSS Modules

Поделиться
HTML-код
  • Опубликовано: 14 янв 2021
  • ★☆★ My Courses: telmoacademy.com/
    ★☆★ 1-on-1 Mentorship: calendly.com/telmosampaio
    ★☆★ SkillShare 2 Months FREE : skl.sh/2Q2LsTi
    ★☆★UDEMY COURSES:
    *The Complete JavaScript Course 2018: bit.ly/2Ci2Fzk
    *Modern JavaScript From The Beginning: bit.ly/2Br13BM
    *JavaScript: Understanding the Weird Parts: bit.ly/2Epdgu2
    *React 16.6 - The Complete Guide (incl. React Router & Redux): bit.ly/2Br2ikq
    *The Complete React Web Developer Course (with Redux): bit.ly/2zXq9IH
    * React Front To Back: bit.ly/2STDUPo
    ★☆★Best laptops for Coding:
    Acer Aspire: amzn.to/2FJrOVh
    Macbook Pro 2013: amzn.to/2NbYIUp
    Asus VivoBook Pro: amzn.to/2YgrCUG
    Macbook Pro 2019: amzn.to/2Xzi4qG
    ★☆★Best JavaScript Books
    John Duckett JavaScript: amzn.to/2EAEvkj
    JavaScript Easy Steps: amzn.to/2VRM4sN
    JavaScript Good Parts: amzn.to/2EFul1V
    Eloquent JavaScript: amzn.to/2Quq5qH
    You dont know JavaScript: amzn.to/2K9I9VX
    My Social Media:
    Twitter: / devtelmo
    Instagram: / sampaiotravels

Комментарии • 127

  • @bkatsevych
    @bkatsevych Год назад +27

    Probably the best explanation of CSS Modules you can find on RUclips. Thanks a lot, Telmo!

  • @Webtricker
    @Webtricker 2 года назад +11

    Thank you so much for explaining React components with CSS modules in such a simple and beautiful way. That was very helpful

  • @redefamatv
    @redefamatv 2 года назад +2

    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.

  • @cesarcortes5063
    @cesarcortes5063 6 месяцев назад

    i was looking everywhere because i had very problems with the css styles , and you have resolved it, thanks a lot Telmo

  • @danieltkach2330
    @danieltkach2330 3 года назад +2

    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...

  • @daftkiwi
    @daftkiwi Год назад +1

    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!

  • @SofiaBelchiorinho
    @SofiaBelchiorinho 2 года назад +1

    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!

  • @omotehinseelvis9845
    @omotehinseelvis9845 Год назад

    So simple and straight forward....I love it. Thank you

  • @rakhmatillorakhmonberdiev231
    @rakhmatillorakhmonberdiev231 2 года назад

    Thanks bro, that is what I expected to understand this topic, very clear explanation!

  • @jiharedconteh4530
    @jiharedconteh4530 6 месяцев назад

    This video is very useful for styling individual components. Thank you for such a simplified explanation.

  • @pumdu
    @pumdu 2 года назад

    Thanks a lot. I wondered why I need to use CSS module and this video made it clear to me. :)

  • @lingolearner27
    @lingolearner27 3 месяца назад

    you solved my problem. was stuck with this for couple of hours. thank you bro.

  • @yinkagiwa8659
    @yinkagiwa8659 3 года назад

    I love how clear the video is

  • @siaxiong333
    @siaxiong333 2 года назад

    Very usefull and great video! I like that you're straight to the point. Thank you so much!

  • @AYUSHSHARMAblogs
    @AYUSHSHARMAblogs 2 года назад

    Lots of thanks for such a wonderful video on css modules

  • @anaisrevellat5692
    @anaisrevellat5692 2 года назад

    Thank you this tutorial is crystal clear , perfect.

  • @Lemon.8
    @Lemon.8 2 года назад

    Thanks for the tutorial, very well explained.

  • @qanswered319
    @qanswered319 2 года назад

    Great video.understood module clearly. No time wasted

  • @kunaljethva9623
    @kunaljethva9623 3 года назад

    Thanks for making this video was searching for it since 😊😊

  • @Viktorres1
    @Viktorres1 Год назад

    Thanks for your video. I fastly reminded how to connect css (scss) modules.

  • @troubledtom5250
    @troubledtom5250 5 месяцев назад

    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

  • @ghofranedarragi5601
    @ghofranedarragi5601 2 года назад

    thank u .simple and clear explanation .it's useful

  • @nishantsinha4336
    @nishantsinha4336 6 месяцев назад

    Made it look simple.Well explained!

  • @Viralvlogvideos
    @Viralvlogvideos Год назад

    RUclipsrs like you deserves lot of subs. I subbed you. Please do make React tutorials in depth with building projects like TODO and ecommerce etc.

  • @patcodingcodester9781
    @patcodingcodester9781 3 года назад

    Haha thank you!. This is exactly what I was looking for but it was hard to find..

  • @muzammil6651
    @muzammil6651 11 месяцев назад

    What a fantastic explanation, thank you so much

  • @Orevitalizador
    @Orevitalizador 10 месяцев назад

    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.

  • @pravinchoudhary5105
    @pravinchoudhary5105 2 года назад

    Thanks Man, Helped a lot

  • @nathanvsplayer
    @nathanvsplayer Год назад +1

    Great video helped me understand css modules

  • @mendibhut4855
    @mendibhut4855 Год назад

    Thank you, man. It really helps me a lot.

  • @electricindro2236
    @electricindro2236 Год назад

    Thank you for explaining the importance of React css module

  • @mathiasmatanda8848
    @mathiasmatanda8848 2 года назад

    You saved me from a big headache thank you man!

  • @irorochadere9207
    @irorochadere9207 3 года назад

    Thanks, buddy.
    It worked well for me.

  • @milkdrom3da
    @milkdrom3da Год назад

    Very useful! Thanks for sharing!

  • @ramon4756
    @ramon4756 7 месяцев назад

    Thanks you! Explained my issue

  • @rohil3023
    @rohil3023 2 года назад

    Very useful. Thanks for the tutorial :)

  • @user-gy6pm2zb3y
    @user-gy6pm2zb3y Месяц назад

    thank u, I was so frustrated and this video helped a lot

  • @sergiogarcia-di5nj
    @sergiogarcia-di5nj Год назад

    really really helpful, thank you very much !

  • @thisaraharshana2168
    @thisaraharshana2168 2 года назад

    Thank you sir. well explained!!.

  • @oscorpion4045
    @oscorpion4045 2 года назад

    thank you so much for this!

  • @mehmetcelmeli9918
    @mehmetcelmeli9918 Год назад

    Thank you for simple explantion TELMO✌✌✌✌we are looking forward to the others videos😊😊😊

  • @raunakkumar6144
    @raunakkumar6144 6 месяцев назад

    Thanks man , I was having exact same problem

  • @mubashirwaheed474
    @mubashirwaheed474 2 года назад

    Thanks you so much for this video.

  • @user-qi9hk4cz4v
    @user-qi9hk4cz4v 4 месяца назад

    Prefect. Chatgpt failed to give me this option.
    Amazing for no css conflict

  • @davidlafontant2185
    @davidlafontant2185 2 года назад

    Very useful. Thank you.

  • @slipstream01
    @slipstream01 Год назад

    excellent explanation. shukran

  • @goncalosantos3604
    @goncalosantos3604 3 года назад

    Excellent as always! Abraço

  • @SatishKumar-qi4hb
    @SatishKumar-qi4hb 2 года назад

    nice and helpful video. thx so much.

  • @coding_stuff_uz
    @coding_stuff_uz 3 месяца назад +1

    Tankyou bro for this tutorial

  • @yuvarajg3855
    @yuvarajg3855 Год назад

    Thank you so much🤝

  • @faustovii1085
    @faustovii1085 Год назад

    man you are a god of teaching for sure

  • @angelmgl8137
    @angelmgl8137 3 года назад

    Nice video bro, thanks a lot

  • @ibrahimkhurshid4339
    @ibrahimkhurshid4339 Год назад

    Thanks buddy!! Jazakallah

  • @phuongla4512
    @phuongla4512 3 года назад

    Thanks bro. This is useful

  • @jatinahuja6840
    @jatinahuja6840 3 года назад +1

    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 👍

  • @janardanpethani5755
    @janardanpethani5755 3 года назад

    Thanks you for sharing 😀😀

  • @davidgrig4608
    @davidgrig4608 2 года назад

    very helpful tutorual ty very much

  • @matiascstudios
    @matiascstudios 2 года назад

    Thanks a lot!

  • @manasjoshi7037
    @manasjoshi7037 3 года назад

    Thank you for this,

  • @amershboul9107
    @amershboul9107 2 года назад

    really helpful, thanks

  • @woolygan1529
    @woolygan1529 Год назад

    Helpful thanks

  • @digvijayyamagekar4300
    @digvijayyamagekar4300 Год назад +1

    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 ?

  • @heikkiladau6872
    @heikkiladau6872 2 месяца назад

    Can you add css styles inside of the script tag in react application?

  • @hemantjadhav7833
    @hemantjadhav7833 2 года назад

    great video sir

  • @teeyiheng4697
    @teeyiheng4697 Год назад

    I understand why use css module now thank😆

  • @codelightsparkles2403
    @codelightsparkles2403 3 года назад +2

    You’re awesome Telmo

  • @sane4959
    @sane4959 Год назад

    Thanks alot

  • @Trafficfromsky
    @Trafficfromsky 3 года назад +2

    how do you target/change the tag without a class name?

    • @itouchgrass869
      @itouchgrass869 Год назад

      Just use “body” selector without a class

  • @carlafaes9282
    @carlafaes9282 2 года назад

    buen video!muchas gracias :D

  • @LakshmikanthAyyadevara
    @LakshmikanthAyyadevara 2 года назад

    Thank you

  • @CodewithAby
    @CodewithAby 3 года назад

    Good tutorial...it is timely

  • @dashpindersingh9062
    @dashpindersingh9062 9 месяцев назад

    Thanks dude:)

  • @gregduke8193
    @gregduke8193 5 месяцев назад

    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.

  • @vigneshwarvenugopal922
    @vigneshwarvenugopal922 4 месяца назад

    Thank you so much dude.,
    problem solving .,
    i score you 100 of 100...🌟🌟🌟

  • @sketchychillandchill
    @sketchychillandchill Год назад

    It's cool when there is like 2 styles to scope but when you want it scoped for each components just switch to vuejs

  • @axe.anonym
    @axe.anonym Год назад

    thank you

  • @mahdouirami2776
    @mahdouirami2776 3 года назад

    When i did it with a complicated name like form-control , it made me an error have u any solution ?

  • @radepetrovic9182
    @radepetrovic9182 Год назад

    Tnx

  • @Whisperme2sleep
    @Whisperme2sleep Год назад

    How do you do conditional classes with this technique?

  • @ahmadcodes
    @ahmadcodes Год назад

    tnx

  • @gihanrangana6248
    @gihanrangana6248 3 года назад +1

    how can i create global variables for scss modules?

  • @arshadahamed988
    @arshadahamed988 2 месяца назад

    In module.css file can we create more than one class or Id in the file??

  • @ranati2000
    @ranati2000 2 года назад

    Can i use bootstrap classes in it ?

  • @webdevvideos2744
    @webdevvideos2744 2 года назад

    will using css module impact performance?

  • @iamwright
    @iamwright 2 года назад

    Very good.

  • @arashvincent8519
    @arashvincent8519 Год назад

    dose it work with sass ?

  • @victoradodo8377
    @victoradodo8377 2 года назад

    Special thanks YOU deserved NATIONAL AWARD

  • @shubhamkaushal2125
    @shubhamkaushal2125 4 месяца назад

    really like your accent very good way of teaching

  • @shrishri8453
    @shrishri8453 Год назад

    Tnq sm

  • @herlandertavares7573
    @herlandertavares7573 Год назад

    Great video. I didnt even have to see your name, I knew by your accent you were Portuguese lol. Obrigado pelo video

  • @srikantaprasadrajeurs5069
    @srikantaprasadrajeurs5069 7 месяцев назад

    tq

  • @davidorevic6651
    @davidorevic6651 11 месяцев назад

    Should we do it for every single class?

  • @OneBrokeBloke
    @OneBrokeBloke Год назад +1

    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?

  • @Don_Verissimo
    @Don_Verissimo Год назад

    GREAT

  • @abhishekprasad6317
    @abhishekprasad6317 3 года назад

    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} ??

    • @abhishekprasad6317
      @abhishekprasad6317 3 года назад +2

      got the solution stackoverflow.com/questions/33949469/using-css-modules-how-do-i-define-more-than-one-style-name

  • @atom3572
    @atom3572 Год назад

    i subscribed

  • @markokoth5609
    @markokoth5609 3 года назад

    Hey Telmo how are you. What's the theme you are using on the vs code?

    • @Telmosampaio
      @Telmosampaio  3 года назад

      Hi Mark, I'm using the Cobalt2 theme

    • @markokoth5609
      @markokoth5609 3 года назад

      @@Telmosampaio alright thanks

  • @felipebatista7469
    @felipebatista7469 3 года назад

    thanks brow!!!
    by brazil

  • @roronoa_d_law1075
    @roronoa_d_law1075 2 года назад

    this is not working for me, the style is still applied globally

  • @lyndonraya7769
    @lyndonraya7769 Год назад

    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
    }
    }
    ]
    }
    ]
    }
    };