CSS is getting better, but Sass is still relevant

Sdílet
Vložit
  • čas přidán 1. 06. 2024
  • 🎓 Learn Sass, how we can use it with other tools like PostCSS, and how we can use it for things like theming, design systems, and general project architecture in my course BeyondCSS beyondcss.dev? (use coupon code earlybird for 20% off, valid until the 4th at midnight EDT)
    🔗 Links
    ✅ Nesting and Mixin example: codepen.io/kevinpowell/pen/ab...
    ✅ Loop example: codepen.io/kevinpowell/pen/eY...
    ✅ If/else example: codepen.io/kevinpowell/detail...
    ✅ CSS-only particle animations: • CSS-only particle anim...
    ⌚ Timestamps
    00:00 - Introduction
    00:36 - Why I prefer Sass nesting over CSS nesting
    03:23 - Mixins
    06:23 - Loops
    13:10 - If/Else
    #css
    --
    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
    Come hang out with me live every Monday on Twitch!
    📺 / kevinpowellcss
    ---
    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 CZcams channel, make sure to follow me on Instagram and Twitter.
    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!

Komentáře • 114

  • @Raphael-jo1rp
    @Raphael-jo1rp Před 10 měsíci +16

    Use sass on a daily basis.
    The day css will implement mixins and fonctions beside nesting, we'll consider going back to css.
    Beside scss Tailwind is pretty solid. Love it too.

    • @hongquannguyen5532
      @hongquannguyen5532 Před měsícem

      true, since i learnt about sass, tailwind and typescript, i use them on every practicing projects

  • @iamtharunraj
    @iamtharunraj Před 10 měsíci +9

    Sass/SCSS is my favourite CSS preprocessor. I use it with parcel for both practicing and building websites. I really love the flexibility it provides over vanilla CSS.

    • @WadieGamer
      @WadieGamer Před 10 měsíci +1

      I use Parcel Bundler, it's pretty awesome

  • @LePhenixGD
    @LePhenixGD Před 10 měsíci

    12:46 Fancy way to add hue rotation! I'll definitely steal that one

  • @arkson888
    @arkson888 Před 10 měsíci +1

    Always brilliant. Concise explanation about Sass usage 👌

  • @topindamien
    @topindamien Před 3 měsíci

    That loop thing is cool! I chose SASS (not SCSS) for: nesting, clean looking, variables and the fact that I can cut my files into small digestible pieces. I feel mixins complexify the maintainabiliy.
    Other than that, I've learned a lot of stuff since I discovered your channel recently. Keep it up Kevin!

  • @JasonJA88
    @JasonJA88 Před 10 měsíci +1

    Super Awesome Style Sheet👍

  • @kelindrawn
    @kelindrawn Před 10 měsíci +2

    For the If/Else example you could also just use em for line-height, no? Thanks for the video!

  • @Knards
    @Knards Před 10 měsíci +1

    I love SASS. True, I am used to it, but I still delight in using it

  • @Atractiondj
    @Atractiondj Před 10 měsíci +8

    For me, if in CSS will be added mixin like in Sass this will be better. For example, we use display: flex; flex-direction …. Many times, with 1 mixin we can make code smaller.

    • @drakZes
      @drakZes Před 10 měsíci +1

      You know you can just make a css class that does display: flex; flex-direction and use it everywhere needed. No needed for that?

    • @Atractiondj
      @Atractiondj Před 10 měsíci +2

      @@drakZes i know and i use separate CSS clasa for this, but with mixin is easyer in another custumization. You can use a padding, background, border-radious for cards. This property You can use for another element and with shadow, not be easyer to add mixin to element?

  • @VivekYadav-up7uu
    @VivekYadav-up7uu Před 10 měsíci +1

    please keep making videos on the latest css properties

  • @syn8485
    @syn8485 Před 10 měsíci +21

    The BEM-style nesting is usually something I avoid as it means that seeing a class in the browser doesn't mean I can search for it in the code, that's a big drawback for me, especially as a codebase gets larger!

    • @EricFressange
      @EricFressange Před 10 měsíci

      You can map your compile file to find the good place of the nested element.
      Every browser has the option.

    • @jarnalyrkar
      @jarnalyrkar Před 10 měsíci +1

      Sourcemaps helps the dev tools in your browser point out the exact line the rule is written on, and which scss-partial.

    • @AlexMercadoGo
      @AlexMercadoGo Před 10 měsíci +2

      Maybe we need a video on sourcemaps

    • @syn8485
      @syn8485 Před 10 měsíci +2

      I know source maps are a thing, but it's not really something I can use in my terminal/editor to edit said code.

    • @StarOnCheek
      @StarOnCheek Před 10 měsíci +1

      You can probably improve your workflow a lot if this is something you ever need to do

  • @donmorris4506
    @donmorris4506 Před 10 měsíci +5

    Scss is my default too. I typically use scss version of bootstrap because it has so much built in for me. The responsive breakpoint system in bootstrap is one of my favorite features.

    • @donmorris4506
      @donmorris4506 Před 10 měsíci

      I think a lot of people that used bootstrap say, 5 years ago, don’t realize how much it has improved and been modernized, so they diss it.

    • @donmorris4506
      @donmorris4506 Před 10 měsíci

      I would encourage you to become skilled at css no matter which framework you choose, or don’t choose. It’s one of the reasons I follow Kevin, even though I use bootstrap a lot. Bootstrap can help you build a nice site but you really need to know css too.
      Scss has it’s own learning curve but the payoff is worth it.

  • @blokche_dev
    @blokche_dev Před 10 měsíci

    Still relevant for the organisation of your styles across multiple files/folders too.

  • @Cahnisama
    @Cahnisama Před 9 měsíci

    does the earlybird cupom combo with the purchase parity cupom?

  • @gangasaikumarg7393
    @gangasaikumarg7393 Před 10 měsíci

    hi sir, can you make video on creating a vscode like scroll bar,
    in vscode right side have a zoom scrollbar., can you re-create that with css

  • @AgentZeroNine1
    @AgentZeroNine1 Před 10 měsíci

    Shadow DOM + Custom Properties + CSS Module Scripts + other new CSS features alongside whats been around for a while = perfection

  • @omegapirat8623
    @omegapirat8623 Před 9 měsíci

    what is your take on css in javascript like styled components in frameworks like react? To me it sounds quite appealing but I also hear tons of critics

  • @EvanEdwards
    @EvanEdwards Před 10 měsíci

    Is there a focused (i.e., doesn't do lots of other stuff) transpiler for modern CSS spec to an older spec? Sort of like what Babel does for JS?

    • @jarnalyrkar
      @jarnalyrkar Před 10 měsíci +1

      autoprefixer is the closest I can think of. But something like transpiling grid-layout to floats would probably be quite complicated to accomplish. Never say never, though :)

    • @EvanEdwards
      @EvanEdwards Před 10 měsíci +1

      @@jarnalyrkar PostCSS was what I was thinking of when I said "doesn't do lots of other stuff," but I figured it was worth a shot. There's a neat polyfill project that I've seen that was tracking future CSS features that were on the cusp of approval (enough to be reasonably stable in syntax). I am not a huge fan of CSS polyfills in general, however. It may be a best solution if you want to try to keep generally to standards.

  • @muhammadilhamrobani7042
    @muhammadilhamrobani7042 Před 9 měsíci +1

    My favorite channel for learning css

  • @daleryanaldover6545
    @daleryanaldover6545 Před 9 měsíci

    I get why Sass/Scss is loved by many but learning a new syntax back then was a deal breaker for my newbie brain (10 years ago). I decided to write in plain css, All you need to understand to write maintainable css is to keep in mind that styles cascade and with a bit of knowledge with how specifity works. I managed to never reach for Sass/Scss.
    With tailwind's release, I understand from the get go what they are trying to accomplish, it's what I've been doing for the last decade (prototyping styled components, FAST). Now I never need to manage the css file since I can do everything on the mark-up instead. And if you've been using css frameworks for the past decade as well, you know how hard fighting opinionated css frameworks are. You can keep a general config for the usual styles you need but not every project will be using the same everytime so we end up overwriting the god damn bootstrap and the like for every new prooject.

  • @evasokolovsky166
    @evasokolovsky166 Před 10 měsíci

    Thanks!

  • @oliver139
    @oliver139 Před 9 měsíci

    How about PostCSS vs Sass?
    Recently I think that Sass is still my favorite against PostCSS..

  • @gangasaikumarg7393
    @gangasaikumarg7393 Před 10 měsíci

    Hi sir, can you make a video for visual studio like scroll bar wider preview. Visual studio have a right side wider scroll bar with active code line preview position, can you make that it is possible in css with js
    Can you please give me a solution for that , it's my humble request,
    Thank you sir.

  • @4115steve
    @4115steve Před 4 měsíci

    whats the difference between sass and tailwind

  • @BigBlueRabbit
    @BigBlueRabbit Před 3 měsíci

    That UPPERCASE mixin just looked like the creation of a maintenance nightmare.

  • @ciroseijas8529
    @ciroseijas8529 Před 8 měsíci

    Question should I master css vanilla to try learn scss?

    • @Cyrus_G
      @Cyrus_G Před 8 měsíci

      you don't need to master css to learn sass/scss, you just need enough knowledge in css like knowing its syntax and how variables work in css (variable works differently with scss afterall).
      You are gonna have a lot of trouble with setting it up first though so I suggest learning a bit about how npm works (installing nodejs, installing scss with npm, and how to set-up and use scss with terminal) It doesn't have to be npm though since there are other options.
      Lastly.
      Learning javascript makes it easier to understand if you want ever want to dip into features of scss like mixins.

  • @programmingjobesch7291
    @programmingjobesch7291 Před 10 měsíci

    Building a CSS framework/library atm and would be at a complete loss without SCSS. It'd be nearly impossible just based on how much longer it'd take.

  • @drakZes
    @drakZes Před 10 měsíci +1

    Is CSS nesting actually available now?

  • @ashawesomeone
    @ashawesomeone Před 10 měsíci

    does it have all browsers support

    • @chrisp129341
      @chrisp129341 Před 10 měsíci +1

      It compiles down to vanilla CSS, so yes. (Note that you do need to have a SASS preprocessor to handle the conversion.)

  • @beinyourguard
    @beinyourguard Před 10 měsíci

    for me, SASS is still way easier and more organized to use. it's my favorite preprocessor and I love to use it.

  • @stevecrabtree9141
    @stevecrabtree9141 Před 10 měsíci

    Fun video

  • @ivan8661
    @ivan8661 Před 10 měsíci

    Sorry but the language you are showing is actualy scss not sass, which has a different syntax? Other than that nice video

    • @jarnalyrkar
      @jarnalyrkar Před 10 měsíci

      scss = sassy css. It's just easier to say sass than scss. You are tecnically correct, though; sass doesn't use semicolons or curly braces, but line breaks and indentation instead.

    • @ivan8661
      @ivan8661 Před 10 měsíci

      @@jarnalyrkar thats what i thought, thx for clarification tho 👍🏻

  • @toddfisher8248
    @toddfisher8248 Před 10 měsíci +1

    I just can't handle debugging sass - it's so annoying because line numbers from web inspector never line up.

    • @jarnalyrkar
      @jarnalyrkar Před 10 měsíci

      The solution to this problem is source maps :)

    • @BigBlueRabbit
      @BigBlueRabbit Před 3 měsíci

      @@jarnalyrkaror just use pure CSS and drop the overhead

    • @jarnalyrkar
      @jarnalyrkar Před 2 měsíci

      @@BigBlueRabbit Sure, but how about organizing the stylesheets? They should be minified to one file anyway, so some overhead is probably unavoidable

    • @BigBlueRabbit
      @BigBlueRabbit Před 2 měsíci

      @@jarnalyrkar Not necessarily if you have full, manual control - “it depends” of course. There are much more lightweight solutions if you really need that though.

    • @jarnalyrkar
      @jarnalyrkar Před 2 měsíci +1

      I do have full manual control, but I dont really feel like going back to one single css-file with all styles in it. It just gets so messy so fast.
      I do like the idea of keeping things as vanilla as possible, though!

  • @anmolsharma4049
    @anmolsharma4049 Před 10 měsíci +1

    I used native css nesting in production app, got complaints for users, had to recompile using sass and replace it bad experience

    • @rossclutterbuck1060
      @rossclutterbuck1060 Před 10 měsíci +2

      eh? Why would users give two shits about how you wrote you styles? Unless their browsers don't support native CSS nesting, which then becomes a you problem.

    • @anmolsharma4049
      @anmolsharma4049 Před 10 měsíci +1

      @@rossclutterbuck1060 yes, support is not great, i basically used it for designing cards, turned out to be a mistake

  • @DuK-2102
    @DuK-2102 Před 10 měsíci

    Sass is awesome

  • @kaicooper9421
    @kaicooper9421 Před 9 měsíci

    I won't stop using sass until css is as good or better than scss

  • @kal.leroux
    @kal.leroux Před 9 měsíci

    yeah but tailwind make it easy to maintain code

    • @seeker3794
      @seeker3794 Před 6 měsíci

      Yes it really makes code a lot more messier....

  • @BigBlueRabbit
    @BigBlueRabbit Před 3 měsíci +1

    Must admit I wasn’t convinced - SASS at this point just looks like unnecessary overhead. Just my opinion 😊

  • @User-404
    @User-404 Před 4 měsíci

    ill consider sass whed ill doo very good with css

  • @codewithdave
    @codewithdave Před 10 měsíci

    Native css still has a lot to do to stop me using SCSS.

  • @TheMetalMag
    @TheMetalMag Před 9 měsíci +2

    Sass is ok for big projects but at the end is a big mess

    • @daleryanaldover6545
      @daleryanaldover6545 Před 9 měsíci +1

      I maintained a legacy code written using bootstrap and sass before, it was a nightmare.

  • @gosnooky
    @gosnooky Před 10 měsíci

    I don't do front-end anymore myself, but we still require SASS for the front-end, and will for the foreseeable future. Native CSS may be progressing nicely, but that's the operative word - "native". Although most people are browsing with modern browsers that update with new features frequently, and new JS and CSS features are implemented all the time, we still consider these progressive features as if there were still a significant percentage of users using browsers who don't support it. Perhaps it's a vestige of being around long enough to remember the days before rapid release, but we always ensure that our front-ends are compatible with browsers up to 5 years old. Maybe it seems silly these days, but we don't adopt new native features until at least a couple years after release. Are we just that old?

  • @GiorgiKavtaradze-cy1ye
    @GiorgiKavtaradze-cy1ye Před 10 měsíci

    🔥❤👍👏

  • @GabrielSouza-sz5ju
    @GabrielSouza-sz5ju Před 10 měsíci

    Mixin look like small components.

  • @HarryPujols
    @HarryPujols Před 10 měsíci

    Concatenating classes is bad practice, that's not a feature of Sass, it's a problem.

    • @jarnalyrkar
      @jarnalyrkar Před 10 měsíci

      How so?

    • @daleryanaldover6545
      @daleryanaldover6545 Před 9 měsíci

      ​@@jarnalyrkarIt introduces complexity that couldn't have dealt with if plain css is used. When writing plain css all you need to think is cascading styles and specificity, sass adds another layer called nesting which is nice if learned properly. But oftentimes people reach out for sass because everyone in the neighborhood uses it and never bothered learning proper css.

    • @jarnalyrkar
      @jarnalyrkar Před 9 měsíci

      @@daleryanaldover6545 I thought that was Bootstrap 😁

  • @PicSta
    @PicSta Před 10 měsíci

    For me, SASS is still like CSS on steroids. Of course, over time we got new things to CSS, or when custom properties (CSS variables) came out, it changed a lot. Before that, we never had the chance of using any kind of variable in CSS. SASS still offers much more, not only the better nesting, it's the whole thing which makes CSS more like a programming language. For minimal projects, Sass is maybe too much, but this depends on so many subjective things.

  • @alexpanteli3651
    @alexpanteli3651 Před 10 měsíci +2

    Use tailwind

  • @ambroseliew
    @ambroseliew Před 10 měsíci +3

    Naww, with nesting being supported in CSS, there is almost no practical usecase for SASS.
    Tailwind > CSS > SASS

    • @daleryanaldover6545
      @daleryanaldover6545 Před 9 měsíci

      Tailwind == CSS
      But I agree since I never reach for sass, and been writing plain css for a long time until tailwind came out.

  • @notarealperson9709
    @notarealperson9709 Před 10 měsíci +4

    and tailwind is better than all

  • @MizManFryingP
    @MizManFryingP Před 4 dny

    SASS is great but unfortunately it is maintained by nutjobs

  • @rossclutterbuck1060
    @rossclutterbuck1060 Před 10 měsíci +6

    I'm sorry, but Sass was never relevant. It's a band-aid put over issues that don't exist if you're even vaguely competent with CSS, and one of many elitist propaganda tools deployed to make web development seem more complicated than it actually is to force emerging markets out of the picture and stop them undercutting overpriced design houses.
    Sass et al were only ever useful for vendor prefixing, and now that's largely a thing of the past Sass has zero relevance.

    • @turolretar
      @turolretar Před 10 měsíci

      Maybe you’re right. It was all just a big misunderstanding

    • @maerosss
      @maerosss Před 10 měsíci

      What about all the examples he mentioned? Anyway, even without those, it still makes for a more readable and quickly-written css.
      Also, sayng it's just an irrelevant band-aid is like saying vaccination is a band-aid for our failing immune system. No matter what's the reason for using it, it is damn useful and a good thing.

    • @daleryanaldover6545
      @daleryanaldover6545 Před 9 měsíci

      ​@@maerosssI've written in plain css and never bothered learning sass, at first I was eager to learn sass but as I got into it, it made things more complex for my little brain. I've seen countless design systems that are written in sass that are just literally hard to maintain and hard to overwrite.

  • @user-de8ev2bn2d
    @user-de8ev2bn2d Před 10 měsíci +26

    tailwindcss is the best

    • @jaydeep-p
      @jaydeep-p Před 10 měsíci +14

      It is sufficient, not best

    • @WadieGamer
      @WadieGamer Před 10 měsíci +19

      You mean cluttered HTML

    • @GabrielSouza-sz5ju
      @GabrielSouza-sz5ju Před 10 měsíci +4

      @@WadieGamer What's the problem with that? Most of the time you are looking at both the HTML and CSS so it's convenient to have both at the same place, specially since you don't have to look at multiple sections in different files to know which styles apply to that specific element.
      When you have a style mess in the CSS hidden away from the HTML, that just makes the HTML artificially simpler. It's still just as complex when you have to make modifications

    • @nicolashervy7544
      @nicolashervy7544 Před 10 měsíci +1

      Tailwind is better than html3.2 😀

    • @WadieGamer
      @WadieGamer Před 10 měsíci

      @@nicolashervy7544 what do you mean, HTML's current version is HTML5

  • @NicholasShanks
    @NicholasShanks Před 10 měsíci +1

    1) BEM is the worst scourge on the world ever to have been invented.
    2) People don't say "1 through 10" they say "1 to 10".
    3) Maths has an "s" at the end.
    4) A "pound" sign looks like this: £. The sign that looks like # is called "hash".
    I'm sick of listening to your accent, so that's as far into the video as I got.

  • @zyruks4386
    @zyruks4386 Před 9 měsíci

    I'm trying to get us to use Sass at work.
    We use Tailwind, but in the end we have the globa.css full of classes because tailwind doesn't cover everything.
    The truth is tailwind has its place, but when it comes to large projects it becomes difficult to manage it.

  • @noseprogramar
    @noseprogramar Před 10 měsíci

    thanks 🩷

  • @gangasaikumarg7393
    @gangasaikumarg7393 Před 10 měsíci

    hi sir, can you make video on creating a vscode like scroll bar,
    in vscode right side have a zoom scrollbar., can you re-create that with css

  • @gangasaikumarg7393
    @gangasaikumarg7393 Před 10 měsíci

    hi sir, can you make video on creating a vscode like scroll bar,
    in vscode right side have a zoom scrollbar., can you re-create that with css