Stop using @import with Sass | @use and @forward explained

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ก.ค. 2024
  • Keep up to date with my Sass course: beyondcss.dev/?O...
    The use of @import has been deprecated in Sass for quite a while now, but a lot of people still use it. In this video, I take a quick look at the replacements you should be using instead, @use and @forward. I just scratch the surface in this one, but it should be enough to get you started!
    A quick note, if you are using node-sass, it is out of date and @use and @forward, as well as their entire module system, will not work. If you're using the Watch Sass extension in VS Code, there is no way to update it. If you are using npm or yarn, just switch out the install of node-sass for sass instead.
    Check out this video for the basics of getting Sass set up using the command line: • Sass with auto-refresh...
    Why Sass changed to Dart: sass-lang.com/blog/announcing...
    // Chapters
    00:00 - Introduction
    00:56 - Watching files for changes
    02:00 - @use basics and namespacing
    04:46 - important @import and @use difference
    07:46 - namespacing
    08:38 - @forward with an index file
    12:22 - Outro
    #sass #scss
    --
    Come hang out with other dev's in my Discord Community
    💬 / discord
    ---
    Keep up to date with everything I'm up to
    ✉ www.kevinpowell.co/newsletter
    ---
    Help support my channel
    👨‍🎓 Get a course: www.kevinpowell.co/courses
    👕 Buy a shirt: teespring.com/stores/making-t...
    💖 Support me on Patreon: / kevinpowell
    ---
    My editor: VS Code - code.visualstudio.com/
    ---
    I'm on some other places on the internet too!
    If you'd like a behind the scenes and previews of what's coming up on my TH-cam channel, make sure to follow me on Instagram and Twitter.
    Instagram: / kevinpowell.co
    Twitter: / kevinjpowell
    Codepen: codepen.io/kevinpowell/
    Github: github.com/kevin-powell
    ---
    And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!

ความคิดเห็น • 593

  • @XavierSmithXcellence
    @XavierSmithXcellence 3 ปีที่แล้ว +224

    Yes, please do an advanced video.

    • @luiscolome75
      @luiscolome75 3 ปีที่แล้ว +1

      I'm Xavier, It's just amazing how easy to understand are things like this with your videos. Great Work!

  • @invictuz4803
    @invictuz4803 2 ปีที่แล้ว +60

    Freaking fantastic, I couldn't understand what on earth was going on after reading the official docs and a CSS tricks article, but you managed to explain it like I was 5 years old in 5 minutes. Would definitely take your Sass course after this to stay up to date, when registration opens...

    • @Pavel-wj7gy
      @Pavel-wj7gy ปีที่แล้ว +5

      I agree. SCSS docs are pretty bad as far as explaining things.

  • @katrinaaponte4787
    @katrinaaponte4787 3 ปีที่แล้ว +13

    Kevin, I just wanted to say thank you for all you do. You've really helped me as I learn design and development. I also really appreciate that you don't edit it out if you make a mistake. You fix it and move on. This helps me to not tear myself down if I make a mistake.

  • @mentalmaniac76
    @mentalmaniac76 3 ปีที่แล้ว +2

    Kevin, thank you so much for continuing to keep us up to date on these types of things. I swear without you I would be left behind in the CSS world. I appreciate all that you do

  • @shumit
    @shumit 2 ปีที่แล้ว +18

    Mr. Powell, simply magnificent !! Fantastic explanation !! People like you let us (beginners from not-so-developed economies/countries) move forward in life one step at a time. THANK YOU !!! May you prosper in life !!

  • @ericschmidt6129
    @ericschmidt6129 ปีที่แล้ว

    Kevin, this is just what I needed. I'm coming up to speed with Sass and @use and @forward are some of the first things I needed to learn. Your explanations are very clear and understandable. Thank you for sharing your knowledge.

  • @stillready6405
    @stillready6405 3 ปีที่แล้ว +2

    Finally someone who explains the changes on Sass. I couldn't get it working on my own, knowing the changes, so I just stucked to the @import. Thank you for the video. Time to get used to a new work flow.

  • @TheTonym415
    @TheTonym415 ปีที่แล้ว +4

    Please do more advanced tutorials about @forward and @use. You teaching style is very easy to follow and accessible!

  • @user-mg8lh5vi4j
    @user-mg8lh5vi4j ปีที่แล้ว +2

    Finally understood. Impossible to explain it clearer and shorter 🤓 🚀 Thanks Kevin, you're extremely talented to teach whatever you bring into your videos!

  • @TheLollercaster
    @TheLollercaster 3 ปีที่แล้ว +121

    I don't know it sounds like a pain in the butt to me. Although, I do understand why some people find it important.

    • @aqua123670
      @aqua123670 3 ปีที่แล้ว +12

      yeah it only becomes an overhead for most cases

    • @PaxNot
      @PaxNot 3 ปีที่แล้ว +17

      Totally agree. It seems like just added boilerplate if one isn't suffering from namespace conflicts. Good explanation though, but my team will not see this as a net positive.

    • @matteobagni1235
      @matteobagni1235 3 ปีที่แล้ว +2

      Well the complications start when using a 3rd party or open source, surely you remove the issue of overnaming, but the import is just an overhead...

    • @JeSus-hl6zj
      @JeSus-hl6zj 3 ปีที่แล้ว +1

      It reminds me of ES Modules in JS. I really like it, basically because I'm used to the namespacing and organizing files that go together around an index file and export all of their stuff. I think it makes a lot more sense than globally available variables. It's more verbose, but it's less stuff to keep in mind or guess about

    • @patrick-dev
      @patrick-dev 3 ปีที่แล้ว +1

      I agree that is an overhead functionality, but you'll definitely find it very useful once u have like, more than 30 SASS files in ur project. You're no longer forced to bring all the files into the main SASS file that is compiled to the public CSS file.

  • @zaynalee8910
    @zaynalee8910 3 ปีที่แล้ว +2

    Hi Kavin, I'm also a Frontend UI/UX Developer and I enjoyed watching your videos. these are very helpful. Please make more videos on Advanced SCSS practices.
    Thanks

  • @rahul-thakare
    @rahul-thakare 3 ปีที่แล้ว

    Stumbled many times on @forward, finally got the clarity.
    Thanks. 🙏🏼

  • @MackRichardson
    @MackRichardson 3 ปีที่แล้ว +1

    Great quick intro to @use and @forward. Please do a more advanced video. I would also love to see your strategy for using media queries with SASS. In Vanilla CSS, I used to create multiple stylesheets for each breakpoint. With SASS, my media queries are in my components files and I've found it can get muddled pretty quickly. Thanks for the great videos and keep up the awesome work.

  • @angelliendo583
    @angelliendo583 3 ปีที่แล้ว

    Thank you very much, Kevin! You help us all understand Sass and Css better. Make a video of what's new in Sass, please!

  • @codeSTACKr
    @codeSTACKr 3 ปีที่แล้ว +137

    Great explanation!

    • @KevinPowell
      @KevinPowell  3 ปีที่แล้ว +8

      Thanks :D

    • @samuelcatlow
      @samuelcatlow 3 ปีที่แล้ว +2

      This needs to be included in your weekly round ups. 😁

    • @somerandomchannel382
      @somerandomchannel382 3 ปีที่แล้ว

      Um how do you compile your css file when typing in the scss file? :)

    • @newnam
      @newnam 2 ปีที่แล้ว

      @@somerandomchannel382 You'll have to start with this video: th-cam.com/video/wYWf2m_yzBQ/w-d-xo.html, which explains how to get started with watching your SCSS.

  • @kleberpereira8503
    @kleberpereira8503 ปีที่แล้ว

    Your content is simply incredible.
    I'm a front-end developer here in Brazil and I confess that watching your videos I don't even consider myself a front-end anymore (laughs). I still have a lot to learn.
    Waiting for more videos like this.

  • @stephanpetersen3600
    @stephanpetersen3600 3 ปีที่แล้ว

    We have to invest more into the setup, but for the usability we will get the return. Thanks for your great work!

  • @anaisrevellat5692
    @anaisrevellat5692 ปีที่แล้ว

    Just thank you, all make sense now, I was looking for a clear explanation and guess what, you are the only one to be clear about this topic ! Just perfect

  • @jaredmeyer997
    @jaredmeyer997 3 หลายเดือนก่อน +1

    Before I found this video, I was beginning to panic, unable to get @use and @forward to work for me. This was extremely helpful - thank you!!

  • @TimHerbert509
    @TimHerbert509 ปีที่แล้ว

    Been stuck doing backend for years now and jumping back into front end more prevelantly I realized I'm behind the curve again. Your channel has been invaluable for getting back up to speed on all the updates / changes to CSS/SASS etc... Thanks so much!

    • @aninham
      @aninham ปีที่แล้ว +1

      yesss welcome again to frontend! Hope you're enjoying your ride! Im considering doing the other way around but no idea where to start

    • @TimHerbert509
      @TimHerbert509 ปีที่แล้ว

      @@aninham I've been a WordPress developer for years and it is an easy one to pick up the backend for. Not near as lucritive as so many other backends. PHP has Laravel, python has django, JS has Node, and it goes on and on. Just dive in and build stuff. Best way to learn!

  • @ThienPowChong
    @ThienPowChong 2 ปีที่แล้ว

    your voice and flow of detail is perfect!

  • @samimesopotamia7495
    @samimesopotamia7495 ปีที่แล้ว

    Excellent explanation and I was really hopeless before I got this video, much thanks and appreciation

  • @zariachenshui7386
    @zariachenshui7386 ปีที่แล้ว +1

    Brilliant explanation. Miles better than the official Sass documentation. Grateful and subbed.

  • @craigmillerer
    @craigmillerer 3 ปีที่แล้ว

    This is fantastic timing Kevin! I use the same boilerplate project file for my websites that I continually add to. As it has grown, it has a number of reused SASS files. All of which utilise the @import method. I think this is a good time for me to strip back my SASS files and restructure it is in the fashion. Thank you for this explanation! I look @forward to seeing more @use-s of this 😂

  • @tanglesite4461
    @tanglesite4461 3 ปีที่แล้ว

    Awesome! Finally! I have been using Sass with @use and @forward as a self-taught developer for a while now, and wondered if I had been doing it right!? I am so glad you have done this video. If you could do a video on the "with" keyword, and perhaps how we should architect our projects when using sass like this. Awesome Kevin job. Keep it up!!!!
    The way sass has built this up. I think it opens Sass up for richer architectures and more extensible and robust use cases. Blocks of CSS kind of act like abstract classes now, we can extend them, hide variables, set up entire libraries of components from the macro to the atomic ... as much as we wish! I think this truly gives sass super powers! Awesome Video!

  • @JordanAF808
    @JordanAF808 3 ปีที่แล้ว

    Duuuude, did you read my mind!? I was learning about all this new sass stuff yesterday and here you are!

  • @Furki4_4
    @Furki4_4 ปีที่แล้ว

    I just started learning sass and many thanks to youtube recommendations for recommending me this video :D Thank you as well Kevin

  • @thomasmatthews406
    @thomasmatthews406 2 ปีที่แล้ว

    Oh my God, you have saved me from giving up. You are the best my friend, thankyou.

  • @TusharShukladevx
    @TusharShukladevx 3 ปีที่แล้ว +1

    Great video! I read an article about @use last year and couldn't understand why I should make this switch but your video clarified it nicely. I'd also like to known(even if in brief) what else (or advanced stuff) can we do with @use and @forward.
    Thanks a lot for this video :)

    • @KevinPowell
      @KevinPowell  3 ปีที่แล้ว +2

      Have some things on the way on that :D

    • @TusharShukladevx
      @TusharShukladevx 3 ปีที่แล้ว

      @@KevinPowell Great, looking forward to it :)

  • @helloredwan
    @helloredwan 3 ปีที่แล้ว

    Love you man....Thanks a lot for helping to get up to date....make us a helpful video with a very helpful sass nodules which can be more faster to code. Like some useful mixin some function. Thanks boss. Have a great time ❤

  • @origami_canoe1952
    @origami_canoe1952 ปีที่แล้ว

    thank you for being so clear !!!!!!! your teaching style is very easy to grasp

  • @francescofaccia
    @francescofaccia 2 ปีที่แล้ว

    thanks Kevin, very well explained! How easy hard topics are when you tackle them and explain to us!

  • @GGdevelopment
    @GGdevelopment 2 ปีที่แล้ว

    Dude I love your stuff. I have a long list of videos you make on my to watch list. Haha finally got back into front end after a year of be dev. I'm glad I got you 😊

  • @somnvm37
    @somnvm37 3 ปีที่แล้ว

    I'm getting into scss and all of that file organisation stuff.
    And it is actually significantly improves what had.
    Very cool thing.

  • @ozzyozborne4539
    @ozzyozborne4539 3 ปีที่แล้ว

    dear God! I just implement it on my project and it took me the half of the day! its not easy when you have multiple files.
    thank you Kevin

  • @chandrakant6283
    @chandrakant6283 2 ปีที่แล้ว

    What a time to be learning Sass including me.
    Thanku sir, you're a life saver.

  • @sakshijain6087
    @sakshijain6087 2 ปีที่แล้ว

    This is very knowledgeable video. Thanks Kevin!

  • @piyushpranjal1837
    @piyushpranjal1837 2 ปีที่แล้ว +1

    Looking forward for the complete scss series

  • @novanoskillz4151
    @novanoskillz4151 3 ปีที่แล้ว

    Great explanation, please dive deeper into sass

  • @avneet12284
    @avneet12284 3 ปีที่แล้ว +1

    Amazing clarity. Would be nice to delve deeper into the module system if possible, Kevin. Thank you.

  • @rihardssimanovics
    @rihardssimanovics 2 ปีที่แล้ว

    Hey, thank you soooo much. I am currently trying to get my dev team to move away from old sass to dart sass and have hit this exact issue. for now, I'll use this video to fix the problem and then start reading more on the @use and @forward.

  • @mohan9285
    @mohan9285 3 ปีที่แล้ว

    Awesome, Thank you Kevin.
    It made me to think "why I was not looking about new things in Sass/SCSS" !!!.
    as many stuffs are rapidly changing in this technical world, need to grab those and get benefitted.
    looking forward for more videos related to SCSS from you :) Cheers.

    • @dealloc
      @dealloc 3 ปีที่แล้ว

      Considering Ruby Sass has been around since 2006 (!), Node Sass since 2011 and Dart Sass 1.0 was released in 2018-I'd consider that to be quite a slow process compared to other software.

  • @KarimShalapy
    @KarimShalapy 3 ปีที่แล้ว +1

    Definitely need the advanced use and forward video.

  • @andrejtellenow
    @andrejtellenow 3 ปีที่แล้ว

    definitely interested in more in-depth usage of @use and @forward - that would be awesome. more sass videos in general would be great :)

  • @sikelelankohla1499
    @sikelelankohla1499 ปีที่แล้ว

    This video was fantastic, I stuggled with this and kept on wondering why I cannot use my syle sheets. I almost gave up thank you very much

  • @patricknelson
    @patricknelson 2 ปีที่แล้ว

    Been using SCSS since 214 but on an old project; interested in casually learning some of the new features that have been added over time, for sure.

  • @TravisHi_YT
    @TravisHi_YT 2 ปีที่แล้ว

    Nice clear video with no fluff, I'll now be swapping my projects over. I feel as though learnsass should put a link to this video in the @import warning on their website.

  • @juggysingh1470
    @juggysingh1470 3 ปีที่แล้ว

    great explanation of the new sass fundamentals, you have a new sub

  • @DanielRios549
    @DanielRios549 2 ปีที่แล้ว

    This is amazing, I love CSS, I always yes it with Sass to use nested styles, but I never had heard about @use and @foward, the way it works is very similar to others languages such as Python

  • @deltachidesigns
    @deltachidesigns 3 ปีที่แล้ว

    Thank you very much, just what I needed right now! I would love to see some more advanced features in a future tutorial. :)

  • @LyricLounge7
    @LyricLounge7 3 ปีที่แล้ว

    Thank you very much, Kevin. I've been waiting for a tutorial about this

  • @guillermoandradaFSD
    @guillermoandradaFSD 3 ปีที่แล้ว +1

    Thank you very much...
    Please give me more Sass techniques. You explain it so good. It's so clear now. Thank you again...

  • @md.redwanhossain8822
    @md.redwanhossain8822 2 ปีที่แล้ว +3

    Great. You should make a full playlist on sass. Your explanation level is always top notch.

  • @richarddrawsstuff2728
    @richarddrawsstuff2728 2 ปีที่แล้ว

    Thank you for making this video. Was considering using sass again.

  • @kareNbud
    @kareNbud 2 ปีที่แล้ว

    Very helpful and very nicely compact explanation!

  • @user-se6ct5zu2f
    @user-se6ct5zu2f 2 ปีที่แล้ว +1

    Thanks for the explanation! You're the only who helped me understand it. But the downside of this system is that you can't use your functions withing mixins as if it would be in a single file i.e. _vars.scss. So I'd like to see more videos on sass file structure, how to organize your project sass files with this new modular system. Thanks a lot for understatnding!!!

  • @ropurifiedwater
    @ropurifiedwater 2 ปีที่แล้ว

    Thank you sir for the video, would love to see another sass video for the more advanced stuff. Thank you once again, you helped me understand a lot :)

  • @andressa1163
    @andressa1163 11 หลายเดือนก่อน

    what an explanation!!! super clear, thanks!!

  • @lighty262
    @lighty262 3 ปีที่แล้ว

    Thank you for the news, greatly appreciated.

  • @nathanwatts76
    @nathanwatts76 3 ปีที่แล้ว

    Great explanation, yes please continue with more advanced topics.

  • @meijiOrO
    @meijiOrO 10 หลายเดือนก่อน

    Thank you for explaining how to use @forward! Since I'm learning react I found myself having to change to npm sass instead of node-sass. Finding out I had to convert to @use in the first half of the video was making me PISSED cause I don't want to keep typing over and over again for global things like variables and mixins. Thankfully you showed us @forward cause I was going to riot.

  • @oussemabrini6237
    @oussemabrini6237 3 ปีที่แล้ว

    Thanks dude ,great explanation,i'm waiting for more advanced video.

  • @staffel0232
    @staffel0232 2 ปีที่แล้ว

    Muchas gracias!, Saludos desde Colombia. Justo estoy iniciando con Sass y estas clases me vienen muy bien.

  • @rkd-me
    @rkd-me 3 ปีที่แล้ว

    Okay, found you by accident, watched three videos and decided to sub, great explanations.

  • @allie-ontheweb
    @allie-ontheweb 3 ปีที่แล้ว

    I'd definitely love to see more SASS videos!

  • @lornecyr849
    @lornecyr849 3 ปีที่แล้ว

    Awesome explanation, I would love to see a more in depth video/series of videos on Dart Sass :)

  • @lali0050
    @lali0050 2 ปีที่แล้ว

    Ohhh Jesus! you really save me. thanks for the clarity.

  • @bjgjuiuguoojpoo
    @bjgjuiuguoojpoo 3 ปีที่แล้ว

    As usually MORE THAN AWESOME! Thank YOu veeerrryyyy MUCH!

  • @israelmedinagalicia
    @israelmedinagalicia 3 ปีที่แล้ว

    wow !!!. Your explanation let me see a whole new approach

  • @frostyy3683
    @frostyy3683 2 ปีที่แล้ว

    Thank you Kevin, this helped me out big time

  • @georgesaitdev
    @georgesaitdev 2 ปีที่แล้ว

    So nice! That was 13 minutes well spent! Good stuff, you got yourself a subscriber :-). Thanks!

  • @stephen1569
    @stephen1569 2 ปีที่แล้ว

    I’m very interested in this. Please make some in-depth videos on this stuff. Many thanks !!

  • @Jamiered18
    @Jamiered18 3 ปีที่แล้ว +1

    I didn't like it at first, it seemed like a lot of extra work. Then you explained the additional features and now I do like it, they actually thought about how to make it simpler without killing the benefits of namespacing.

  • @Phobo55
    @Phobo55 2 ปีที่แล้ว

    Looking forward for the most advanced

  • @qodesmith520
    @qodesmith520 3 ปีที่แล้ว

    You always have fantastic content 💯

  • @danielahermosillo8991
    @danielahermosillo8991 2 ปีที่แล้ว

    High quality explanation! Thank you very much for your video, helped me a lot! New subscriber :)!

  • @maciejmyslinski7820
    @maciejmyslinski7820 3 ปีที่แล้ว

    I've to try it. Thanks for video!

  • @ultimathei
    @ultimathei 3 ปีที่แล้ว

    Yess, yass, sass! Bring on the advanced video :)

  • @ShaunLevett
    @ShaunLevett 3 ปีที่แล้ว

    I was banging my head against the wall getting @forward to work. Cheers Kevin.

  • @jagjeetsingh4597
    @jagjeetsingh4597 3 ปีที่แล้ว

    Great Video Kevin! 🖒waiting for more new SASS Videos

  • @abhishekshukla2745
    @abhishekshukla2745 3 ปีที่แล้ว

    Awesome Explanation!
    Please dive into advanced usage.

  • @janelleschuh8424
    @janelleschuh8424 3 ปีที่แล้ว

    Thanks so much for the great video! When I first learned sass a few months ago I was reading the docs and noticed that @import was deprecated. I tried using @use but it wasn't working. And I thought it was me being a new dev and all! Guess not...it was Live Sass Compiler! Haha! Guess I'll trust my instincts next time...

  • @Pareshbpatel
    @Pareshbpatel 3 ปีที่แล้ว

    Great Lesson. Thanks, Kevin.

  • @JamesWelbes
    @JamesWelbes 3 ปีที่แล้ว

    Yay I've been waiting for this video

  • @erikkisko3194
    @erikkisko3194 3 ปีที่แล้ว

    I would be happy to watch more advanced video!!! Please make it.

  • @cintron3d
    @cintron3d 3 ปีที่แล้ว +1

    Nice! This feels a lot closer to the import export workflow in javascript.

    • @KevinPowell
      @KevinPowell  3 ปีที่แล้ว +2

      Yes, definitely! I'm surprised at the pushback people are giving, I was thinking the same thing and figured people would like that about it.

  • @ZyncInteractive
    @ZyncInteractive 3 ปีที่แล้ว

    This is actually good for code readability too and knowing where the variables come from as well. Not too shabby.

  • @WIBEDRILLMusic
    @WIBEDRILLMusic 2 ปีที่แล้ว

    Yes, please do advanced video 🤩!

  • @yourix2
    @yourix2 2 ปีที่แล้ว

    Hahah you had that typical classroom teacher face when you said. "Take a guess". That classroom student feeling came rushing to my brain hahah xD

  • @imtheaman
    @imtheaman 3 ปีที่แล้ว

    Thanks very much for making this tutorial. my extensions were getting crashed each time when i was using import while the server running.

  • @Kay_Drechsler
    @Kay_Drechsler 5 หลายเดือนก่อน

    Awesome video. Thanks for that!

  • @sumukhakb2701
    @sumukhakb2701 3 ปีที่แล้ว

    Great explanation. Do more videos on showing new sass features

  • @itsWooody
    @itsWooody 2 ปีที่แล้ว

    Didnt know ../ was what i missing to access nested scss files thanks for the video helped a ton!

  • @squ34ky
    @squ34ky 3 ปีที่แล้ว +6

    I've been using @import for ages... I didn't know about @use

    • @KevinPowell
      @KevinPowell  3 ปีที่แล้ว +1

      You're far from the only one :)

  • @luisalbertovillarortiz7424
    @luisalbertovillarortiz7424 ปีที่แล้ว

    Dunno If you are "the king of CSS", However, there is no way, there is no doubt, You are the best "CSS-SASS Instructor" outside there!!! Thank so much Kevin!!!!

  • @avinashmurmu9070
    @avinashmurmu9070 2 ปีที่แล้ว

    crystal clear explaination 🔥👌

    • @avinashmurmu9070
      @avinashmurmu9070 ปีที่แล้ว

      coming back again after 10 months. 😂

  • @sudhamajayanthi
    @sudhamajayanthi 3 ปีที่แล้ว

    Obsessed with your videos!

  • @alexkiiru1283
    @alexkiiru1283 10 หลายเดือนก่อน

    Thank you.This was immensly helpful👃

  • @ridl27
    @ridl27 3 ปีที่แล้ว +6

    I didnt even know that @import has been deprecated lol. Ty

  • @felipecabreira4321
    @felipecabreira4321 3 ปีที่แล้ว

    Great video Kevin :DDD , helped a lot !!