as always so useful, but I have a question not entirely related. How could one get around having to get the back-end done yourself, and instead just have e.g. an email submission form made with an API? Could that be possible? If so how? Because I actually built a sort of fully-blown html and css project with different urls but my goal for this website is for it to get people submit their email to apply and stuff, but that would require some kind of back-end. Would it not? Hope I explained myself clear enough, sorry if not. Thanks again!
@juraev00564 жыл бұрын
@@lucianoramirez6525 Yes it does require some backend if you want people to sign up to apply for something. If you just want a contact form that sends you a user message from your website, its very easy to do.
@xrishi204 жыл бұрын
It's live sass compiler, not compilation i guess 🤭
@Saaztube4 жыл бұрын
Had to subscribe. Thanks.
@yvonniie3 жыл бұрын
I want a Part 2 where you go more in depth with a bigger project!
@BenRangel4 жыл бұрын
One piece of advice is: don’t forget utility-classes just cause you use BEM! A ”hidden” class makes more senese than having a ton of modifier classes that do the same thing, like ”card-hidden” and ”article-hidden” Only use BEM for unique styles and not common ones. You can combine BEM and utility classes, no need to go 100% in a single direction. doing ”card card-large hidden” is fine
@akashbond8624 жыл бұрын
Came here after watching Kevin Powell's video on BEM. There he had said "specificicity", and here Gary says "specifity". Guess Kevin stole Gary's "ci".
@RainOnline3 жыл бұрын
lolol
@gabrielsequeira-bacher90493 жыл бұрын
😂
@AverageCho3 жыл бұрын
me reading your comment: specifi-kitty...dammit
@UnknownUser-ts1sw3 жыл бұрын
wtf😂
@BenRangel Жыл бұрын
I've used BEM for many years. Modifiers are great and truly provides a nice way of stating a clear intention that this element has a shared base style and a variant that overrides or adds a few things. But the block__element concept is less useful. It's fine in tiny flat components that you don't change a lot. But in larger things the double underscore often has to be moved deeper down and feels useless. You begin with footer__menu but as that menu gets more and more children you rename it to footer-menu so can have children like footer-menu__user and footer-menu__faq If this renaming happens multiple times, or the dom tree for the footer is quite deep then you end up just forgetting which nodes have the block__element thing and which just use dashes. At which point I usually go "screw it, let's use single dashes all the way" and I never end up regretting it. I still use BEM on small isolated components though.
@georgemallard41204 жыл бұрын
I am a CSS newbie. The way he showed BEM using the $ helped me understand the cascade in CSS. Thanks!
@CODINGVENTURE4 жыл бұрын
I'm mad he never noticed that he added a class to the end of the list item tag
@1997matthew4 жыл бұрын
It's the Auto Rename Tag plugin that's doing that
@CODINGVENTURE4 жыл бұрын
@@1997matthew I know I'm just mad he didn't notice lol
@local94 жыл бұрын
You got mad at that... I got mad at calling Underscores (_) as Hyphens (-) and Hyphens as Dashes >.
@physx_naraka4 жыл бұрын
I was about to raise my hand and tell him that, thought it was a real-life lecture .
@estoriassurreais34344 жыл бұрын
@@1997matthew thanks
@crooker24 жыл бұрын
Specificity... Pronounced: spes-ih-FISS-city (5 syllables) :) Good video. I don't use BEM currently, but I'm going to play with it.
@rafaellerescapone4 жыл бұрын
if i wasnt already using React+Styled Components to deal with such issues, this looks like an amazing system to solve such problems in a practical and DX friendly way
@rosstee3 жыл бұрын
Thanks for a great intro to BEM. I used to do HTML/CSS years ago and need to pick it back up at work. These days my company uses BEM and SASS so this was perfect and very easy to follow.
@EvaLasta3 жыл бұрын
Man you got such a unique vocabulary haha 1:02 "specifity" 3:14 "complexitness" I think you mean specificity and complexity lol I love your videos btw Im just playing around.
@rand0mtv6603 жыл бұрын
The second was was him saying "a little bit more complex than this".
@truvc4 жыл бұрын
Styled components are the bomb. Svelte and react have completely made BEM obsolete from my life and I love it
@aspected4 жыл бұрын
I've actually been really enjoying your videos and I've watched quite a few since I found your channel the other day. A lot of stuff I've watched has been beginner-intermediate level but it doesn't feel like I'm missing anything I _must_ already know because you don't speak down to your viewer, which is really nice! Some channels kind of act like they're the best and everyone else sucks, so it's nice to watch videos where I can actually learn and feel like I'm getting somewhere with this.
@alex_chugaev4 жыл бұрын
I'm so happy Angular has styles isolation mechanism and I don't need to use BEM anymore :D
@Zach28254 жыл бұрын
Vue has that too. It is so convenient
@diablo.the.cheater4 жыл бұрын
@Angelo Stevens overkill is a feature not a bug
@ShadiMuhammad4 жыл бұрын
@@diablo.the.cheater 😂😂
@etmargallo3 жыл бұрын
Do you guys mean “scoped”?
@jenninexus4 жыл бұрын
This is my new favorite channel :-D Thanks for all the great knowledge
@briankgarland4 жыл бұрын
Thanks! I got put onto a project late in development and found all these classes written like this and didn’t know what the heck was going on.
@jennisonb3710 ай бұрын
Thank you for explaining BEM so clearly and succinctly. You got a new sub and I'm looking forward to watching some of the other videos you have.
@n4botz4 жыл бұрын
I personal use BEM together with OOCSS any projects and it's for me a game changer. Simply clean structured and easy to read CSS. Keep up the good work! Regards from germany!
@chrisandrew_tv4 жыл бұрын
BEMs weakness, if there’s one to be extracted from these comments, is its name. Blocks, elements; most of these people know what those are and that can make it confusing when there are more than 2 nest levels. What I take away from this is that it’s definitely useful if used thoughtfully, when considering the first slides: What blocks on are project are similar in HTML structure but unique in content nature or styling? Card, content, list, these terms are general but if I imagine a blog post preview, album preview, news article preview or rental listing, I can see how BEM would be beneficial. Thank you.
@nikolozmacharashvili1212 Жыл бұрын
great job with the slides... best slides I have ever seen
@Vittokm10 ай бұрын
Very very good! was trying to understand this before but only now I understand :)
@flowerofash44392 жыл бұрын
nice method on writing css, scss + bem probably the best way to go for large project
@riiad4 жыл бұрын
Here's the only reason I liked this video : He directly, simply, clearly explains what is BEM. That it's a methodology and what's its purpose. It seems all the other guys just start talking and talking as if it's gonna be a philosophical talk. And you don't even have a clue of what BEM is.
@devKazuto4 жыл бұрын
I'm not a fan of BEM. I prefer using utility classes instead of --modifier. Most IDE don't have a problem selecting "card-header" on double click, but will struggle with "card__header". Having an arbitrary long class name will also increase file size. We're removing line breaks and spaces on minification, but 30 letters long classes are fine.
@BenRangel4 жыл бұрын
Kazu: which IDE? i thought most had a hotkey to select by free text search. I use vscode and I use cmd+d to select any string by free text search
@BenRangel4 жыл бұрын
What do you mean by arbitrarily long? In BEM the idea is you can only have a single level: card__header is ok but card__header__title or card__header__title__icon is banned
@devKazuto4 жыл бұрын
@@BenRangel I'm talking about double click text selecting, not hotkey. Some don't see cohesion of a string like "abc--xyz". Having class="button button--state-success" creates a larger filesize in HTML than class="button success". In CSS it's the same. .button-state-success are more characters than .button.success and therefor results in a larger filesize.
@kootahaitoo4 жыл бұрын
@Angelo Stevens yeah file size is like the last reason i would worry when dealing with BEM and CSS
@alexsmith-rs6zq3 жыл бұрын
Why not both? I’ve recently started using a combination of utility classes for shared styles and BEM for unique styling. It seams to be working well so far.
@JPierro4 жыл бұрын
You are really good at explaining these things. You rock.
@rogaldorn70164 жыл бұрын
Wow, one of the best practices! I love to use it with SASS or LESS! It makes writing your code much easier. Hovewer, BEM classes can be really long sometimes (class="card__heading card__heading--available main__card")
@ead55904 жыл бұрын
So true about it being long.. Sometimes I myself would forget what was the modifier I used.. 🤣 Then I'd have to browse through the entire HTML file looking for what I need to work on..
@rogaldorn70164 жыл бұрын
@@ead5590 or sometimes you can have similar classes 🤣 Especially, when your project as big as f...
@ead55904 жыл бұрын
@@rogaldorn7016 Definitely. That's very possible. And that is probably one of the reasons why we use stuff like BEM so that we don't have such issues. Then again, it's a matter of preference. If someone would like to use methodologies such as BEM or not, it's clearly up to the Developer.
@BenRangel4 жыл бұрын
Why would you have one element be both "main__card" and "card__heading"? That doesn't make sense. Either it's a card or a heading for a card. Not both at the same time.
@rogaldorn70164 жыл бұрын
@@BenRangel yah, my bad. It should sound like "card main__card main__card--active"
@doggycat4 жыл бұрын
Why are the elements considered as elements of the card rather than elements of the "card__list"? Are they not elements immediately tied to the list?
@thmscz77074 жыл бұрын
When using the bem metodology properly, you shoul always refer to the one main block element and go only one level deep.. I personally would rather use here a class like card__list-element. Hope it makes sense
@doggycat4 жыл бұрын
@@thmscz7707 Ah that makes sense. Thanks for explaining!
@ufufu0013 жыл бұрын
This is *perfect* ! I'm gonna be using it even if the project is small. My CSS naming is a mess and this makes it super organized and coherent. THANK YOU
@howiewang42383 жыл бұрын
Thank you for this tutorial. In the beginning, why do we need two underscores for Class name instead of one underscore, which is simpler and more efficient?
@souravsinha53303 жыл бұрын
Thanks a lot sir. Really helped me a lot to understand it from scratch. I'm very much new to this SCSS and BEM concept
@lennart58454 жыл бұрын
I’ve been using it just because I saw that JetBrains has it on the webpage. Now I see why I’m doing it
@notkamui97494 жыл бұрын
I like the fact that you follow JetBrains :)
@AndiRadyKurniawan4 жыл бұрын
Why is that? What's the benefit?
@lennart58454 жыл бұрын
Andi Rady Kurniawan if you’re using scss, which will definitely help you a lot, this Bem makes it easier. You can type .menu and in scss the „&“ character selects it again but you can add something. So for example if you have a list in your menu which has the class „menu__list“ you can just type in the menu css: &__list (.menu__list). And that with several items. It just helps you a lot and organizes everything
@parthkumarchaudhary4 жыл бұрын
Tutorial on time. Thank you Gery Teacher. :)
@Gigusx4 жыл бұрын
I got into TailwindCSS before getting interested in BEM, so I never really ended up needing it. A useful video nonetheless for a quick overview!
@Gigusx4 жыл бұрын
@Library Content Yeah, me as well! The nesting of SASS makes it all look very clean and easy to modify.
@Arttyor4 жыл бұрын
Tailwind is framework tho, this is just methology
@Gigusx4 жыл бұрын
@@Arttyor That's right, but it removes the necessity for using a naming methodology, at least when you follow the similar process that Adam Wathan (Tailwind's author) does.
@ihajo4 жыл бұрын
Great video as usual.. I love these fast short and on point.. keepem coming
@USONOFAV4 жыл бұрын
Been like doing this, but without those double underscores and double dash for modifiers. However, thank you for showing this.
@danteelegante46013 жыл бұрын
Omg you get a thumbs up on this video my friend especially after you said "You better not leave". 😂 That moment definitely made me laugh so hard but also made me want to stick around to the end. Thanks for having an awesome sense of humor while teaching. 💜
@techtipsuk4 жыл бұрын
It’s not so much semantics, it’s modularity of it that’s important.
@andreppg2 жыл бұрын
Great tutorial ! Good speed, clean and straightforward to the point. Thanks.
@GamingTSH2 жыл бұрын
🙏❤️kzfaq.info/get/bejne/otN5qrx9q7--aYk.html❤️🙏
@JohnVenters4 жыл бұрын
Sorry to be that guy, but it's "specificity"
@DesignCourse4 жыл бұрын
I can't even say that. And I want to punch whoever came up with the term.
@JohnVenters4 жыл бұрын
@@DesignCourse Haha, no worries, mate! Great tutorial regardless. Thanks for taking the time to make it for us!
@dertuman4 жыл бұрын
Haha was just about to post this
@svendbentjensen55124 жыл бұрын
Actually it's speficitify, everyone knows that
@harrypehkonen4 жыл бұрын
@@DesignCourse "Specificness" -- much easier to say. It's even in the dictionary! Apparently it has a slightly different meaning, though... although *I* think it's more accurate (i.e. more specific to what we are using it for) ;D
@mrsingh53514 жыл бұрын
So much style in your videos, it's actually delicious!
@karldtrumpeter3 жыл бұрын
Couldn't be more explicit. Thank you!
@mirza44773 жыл бұрын
Awesome, simple explanation in less than 20 minutes!
@sahilgarg19243 жыл бұрын
It was great! Improved my method of coding CSS!
@garethBarry_dev4 жыл бұрын
Great video, enjoyed the insight. Will try this out on our next project, cheers!
@leonbenjamin78913 жыл бұрын
Excellent video to understand BEM methodology. Thanks!
@AstroSirrus3 жыл бұрын
Bem Bem... What a Bem Bem! 💎 Thanks for this great tutorial! 🤗🤗🤗
@andresfrr1003 жыл бұрын
Thanks! A really good example of using BEM.
@acidspark4 жыл бұрын
11:40 "__" is underscore underscore, double underscore or dunder, not hyphen hyphen you did it repeatedly, at some point everything just became hyphen hyphen.
@local94 жыл бұрын
It ground my gears to much.
@mariodakhil78054 жыл бұрын
this is so helpful , i understand them here better than my teacher
@ujjawalchatterjee4 жыл бұрын
Why can't we consider the list as an individual block and the items as it's element?
@sashabeep4 жыл бұрын
You can put the block into another block - it's allowed by convention
@ujjawalchatterjee4 жыл бұрын
But, in this case, what is it? Block or element?
@fuzzypumpkin77434 жыл бұрын
BEM in SASS + React components. The organization flows beautifully.
@zentekvideogames35893 жыл бұрын
12:03 Was it necessary to add class="card__item" inside the closing tags as well? Or was it a typo?
@xentric3133 жыл бұрын
Just a typo ^^
@narudesigns3 жыл бұрын
Definitely an error
@dasunanushka87744 жыл бұрын
Best explanation with an example. Thanks.
@AdyB20082 жыл бұрын
Great easy to understand video. Thank you!
@sunflair-wa2 жыл бұрын
Thank you so much. I feel like I have been given the secret handshake to the club :)
@GamingTSH2 жыл бұрын
🙏❤️kzfaq.info/get/bejne/otN5qrx9q7--aYk.html❤️🙏
@ead55904 жыл бұрын
Yesssss! Finally somebody who I trust covering a topic that seemed to me like a mystery.. I mean seriously.. When I was learning CSS, all that mattered in naming classes was something that was easy for me as a developer.. And then came along BEM, SMACSS, OOCSS and who knows what.. Like wtf.. 😵 Thanks for talking about BEM Gary.. Now how about SMACSS, OOCSS.. 😁
@sugiono28014 жыл бұрын
how do you know that name? SMACSS, OOCSS or maybe something thats never exists but actually exists?
@ead55904 жыл бұрын
@@sugiono2801 Sup man! Well I'd taken a Udemy course by Jonas Schmedtmann named 'Advanced CSS and SASS' course. Within that he mentions of these methodologies for naming the various classes. But he uses the BEM method during the course. It would be worth noting these methods because recently when I was browsing through job postings on LinkedIn, there are postings where they ask you to have a fair amount of knowledge about a specific method such as BEM.
@user-gs3pt1uf1g2 жыл бұрын
Coming from a big project, one important lesson learnt: don't abuse Sass/SCSS, keep it to bare minimum. Reason? Trying to resolve a high priority production defect with a huge SPA codebase, it doesn't help to have .block { ...; &__element{... &--modifier{...}} rulsets: it very hard to find the original rule definition in source code, since in the browser you'll see generated version. The lesson learned, in order to be able to quickly find a rule, write entire selector by hand, don't leave it up to SCSS preprocessor. One thing is to write confusing Sass code to impress junior female developers on your team, and another thing to debug prod issue under pressure and a lot of stress. KISS.
@GamingTSH2 жыл бұрын
🙏❤️kzfaq.info/get/bejne/otN5qrx9q7--aYk.html❤️🙏
@vito-mohagheghian Жыл бұрын
the best BEM tutorial
@0neonited4634 жыл бұрын
Been using BEM method for over 2 month now... But thanks for reminding how it is..
@babayaga58484 жыл бұрын
great stuff simon, can you please make a video that explain how to configure php for vsCode, so it can auto complete and other things like the atom built-in feature
@klingonac794 жыл бұрын
Best BEM explanation so far
@sojibhasan13803 жыл бұрын
This video is very helpful especially for me.
@deniskazakov45844 жыл бұрын
Card__content accidentally is not a block?
@nurullokhuvaidullaev96844 жыл бұрын
Awesome job! Thanks, Gary🙌🏿
@alamesawikanningkaton50282 жыл бұрын
That was clear... but a little bit confusing if we want to use isolated component or block to another block. We can not override style from unrelated block. for example, we want to use .btn block inside .card block. Let say that the button inside .card block have different style. So how we deal with it?
@JensAndersenGuitarist2 жыл бұрын
It is Spe-ci-fi-ci-ty ;-) And why arent you using semantic elements in HTML? Like a section or an article for the card? It is supposed to be an element that can stand alone and therefore it should be an article or a section for each card? I know that there is not a title/heading in this example, but anyways? And why is the picture/img not a part of the content element?
@TineruHarlem2 жыл бұрын
Thank you for a good explanation! This video helped a lot!
@dilinirajapaksha2 жыл бұрын
Very helpful, great tutorial. Thank you!!!
@coolworx Жыл бұрын
What's the point of doubling up on the underscores and the hyphens? Wouldn't card_button-active tell you the same information (what it's for) as card__button--active?
@gajendra19873 жыл бұрын
Good content, liked and subscribed. All the best!!
@afique89324 жыл бұрын
Very good explanation. Thank you!
@DavidJonathan103 жыл бұрын
Thanks for all your great content always.
@TsunaSawada264 жыл бұрын
I once used it but never again. The problem is that you class names become longer and longer and can be simplified with .card.button.active for example.
@edwingarcia50434 жыл бұрын
specificity graph becomes crazy with that
@olasoderlind56854 жыл бұрын
Why not .card ,, .card > img ,, .card > h2 ,, .card > p ,, .card > a .. ? i anser my own Q --> becose, card__* is unic for sepcial but the "card > img" is for overall styling
@sashabeep4 жыл бұрын
When you will need additional style for particular image .card>img will not allow you to do that due to specifity codepen.io/sashabeep/pen/JjdGWJw
@simpleprogramming46714 жыл бұрын
Design Course thank you so much for your amazing tutorials. Your Videos are really unique. I have a question, when a block gets very big(when I start a big project it gets really confusing for me how to break it to smaller blocks and elements. does anybody have any suggestions? Thank you all in advance :)
@ChrisAthanas3 жыл бұрын
Solid clear explanation
@PoetikSage2 жыл бұрын
I don't care if I'm doing large project or small, I always use BEM. (that's different thing I don't get large projects)
@amirfayazi5626 ай бұрын
Thanks for such a helpful video
@sanketmane58382 жыл бұрын
Thank you so much for this tutorial...
@adventure-0074 жыл бұрын
Done that loooong ago. Best decision!
@kory37624 жыл бұрын
Great Tutorial DesignCourse!!!
@DavidOtto823 жыл бұрын
If you dont know how to use the C in CSS, BEM really shines ;D No, srsly: Dont use BEM, unless you are writing plugins
@craigdanielmaceacher4 жыл бұрын
@10:30 isn't the semantically tied to the card__content div just above it? It's nested inside that div so shouldn't it be card__content__ul? This is confusing
@CabbageYe4 жыл бұрын
It's very confusing, I don't like BEM personally
@danielmancera98673 жыл бұрын
but the UL could not be considered as a block itself? card-list and the the items, card-list__item?
@IcedCupcakes8 ай бұрын
"specifity. I can never say it right. SPECIFITY! there we go!" DEAD xD great video though!!
@yashkadam2784 жыл бұрын
Thanks for making a video on this topic.....
@ilyasseisov72043 жыл бұрын
Thank you Gary!
@zayarlyn2 жыл бұрын
gonna follow that convention
@eritert4 жыл бұрын
Why not just nest in sass and leave out the duplicate text in classes?
@soldadopreciso3 жыл бұрын
Thanks pal, what about general approach.
@BenRangel4 жыл бұрын
I dislike classname concatenation like "&__item". I would write the full classname; "card__item". Many new Sass-users fall in love with the idea of concatenating all classnames. My team used to do that but we decided it makes your code messier in the long run. A) You can't copy-paste a full classname from your html and search for it in your codebase. You always have to remember that only one part of the classname is searchable. B) You create a lot of nesting in your code. So when you find "&__item" you always have to look up to see what the full classname actually is. People will argue that "the advantage is that if you rename 'card' to something else, you just have to change it in one place in your sass file" But I'd argue this is NOT a major concern. I don't rename stuff that often, and when I do - search-and-replace only takes seconds. I do however search through and read my code all the time. So anything that increases readability is a more worthwhile investment.
@Arttyor4 жыл бұрын
I agree, plus they still need to replace class name in HTML, so will end up using searc-and-replace anyway. Which css methology do you prefer?
@BenRangel4 жыл бұрын
narkar: I like BEM as long as you’re not being needlessly strict about it and try to shoehorn it into every situation. We use utility-classes (like ”hidden”) in instances where the same behavior is reused often. I think it’s insane to use BEM classes for common features like that (for example using card-hidden and article-hidden if they both just set display:none) mostly use BEM mostly elements with many children. If an elem just has 1-2 children and no deep nesting I avoid BEM. ”article p” is fine. We use css preprocessor features where we think its most necessary. We avoid class name concatenation. But We use variables in cases where it make it more obvious how stuff relates to each other, especially for things like z-indexes. I hate seeing ”z-index: 95” , cause writing ”z:index: $popup-z-index + 1” is so much more understandable. We use variables to make sure we use standard measurements as often as possible like $padding-mobile and $padding-desktop but if something needs tweaking because of the font used we’re fine with doing an excepting and hard coding a pixel distance. We don’t use a grid-system for stuff like columns as we do a lot of different layouts for different pages and I think it’s much faster to write custom css for a rare case where we need 5 columns than to use bootstrap’s grid and hack some kind of 5-column-class. (But if we were building a more simple/cheap site that didn’t have time to do custom layouts we’d probably use more gris-systems)
@Arttyor4 жыл бұрын
@@BenRangel That is neat tip for z-index. Thanks. I like using display: grid for it's autoplacement. I dont use bootstrap's grid at all.
@EpicphoneGamer2 жыл бұрын
Important question. What is that green guitar in the background? Are these EMG pickups?
@grapes6394 жыл бұрын
I use BEM, but one of the things I find the most annoying with it is how absurdly long some class names can get. Especially if you want to toggle a class. Like in your instance if you had a "card__button" and then you wanted to add the "active" class, the two classes alone would be long "card__button card__button--active" now imagine that and pairing it with more classes like for example col-12 col-lg-4 etc. I think the classes just end up looking hella messy after a while.
@cswithabdullah26383 жыл бұрын
My underscore is not displaying. When I type underscore it is not displayed instead multiple items get selected. Anyone has solution?
@piorun13164 жыл бұрын
I heard a lot about BEM and then I discovered TailwindCSS which is mega cool. Worth checking out :)
@firespittnkitten4 жыл бұрын
I don't see why this is necessary. In your card example, you could use the class name "picture" and target that via CSS with .card > .picture. BEM is just a solution in search of a problem.
@simonkalu4 жыл бұрын
Awesome! Thanks for your time
@davidnagy10464 жыл бұрын
thank you for the video! will you cover CSS-in-JS sometime soon?
@sumitwadhwa88234 жыл бұрын
shouldn't card__item be card__list__item..? it's little confusing when it nested
@BenRangel4 жыл бұрын
One minor annoyance I have with BEM is that you often get into refactoring discussions in your team as your DOM depth grows. You start out with "card" and "card__header". Later you might need to add a title and an image to the header. But BEM (wisely) forbids nested element-classes like "card__header__title". So then you get into the refactoring debate. Do we do ".card__header .title" or ".card header__title"? And then you might get into asking yourself why you're even using BEM. You could just do ".card .header .title"