Tried a very different style with this video and I'd love to know what you think of it! (and yes, the mask-image would have been a lot easier and is probably the best approach 😅)
There's nothing better than taking a design that most people would think requires photoshop/illustrator/masks/whatever and making it purely with CSS :) -- love this one!
This is next level and why I love your work so much. You not only show the 'what' and the 'how' but the 'why'. So important to understand when troubleshooting. At least it is for me. Thank you, and my vote is for more vids in this format.
I used to not be very interested in CSS, and would learn how to brute force certain things, but as I've recently become the staff (read: only) frontend engineer at a startup, I've had to do more and more elegant implementations from our design team, and your videos have been instrumental in teaching me all the levers and switches and tools at my disposal to get things done easily and scalably, and I really appreciate that.
you can do this with clip-path: polygon and sass functions by approximating a radius. Maybe impractical, but kinda cool, cause you can approximate any kinda shape, even squircles (like the shape of an ios app icon), which look very nice. You can even animate clip path point by point.
Thanks for this video, Kevin. Seeing you use psuedo classes is always pretty impressive to me. Looking forward to the next one. I also really like that you pull suggestions like these off twitter. Little design challenges like these that I haven't seen before are inspiring.
Love the ingenuity of this. It is not always about the easier way, but knowing the ways you can achieve the same thing, though manipulatable means is the true pursuit of wisdom, as it can be applied in many different, and even unrelated scenarios. Great work, Kevin, as always!
Bravo 👏 👏 👏, I did the same using an svg as the corner that I rotated for each corner and had a variable for width, height, and fill to control its size and color. Your solution is so awesome and simple, and the best part is that it's all css, amazing!
Excellent, recently in the company we had the same challenge, I solved it using the after and before pseudo elements, in addition to the use of the clip-path function with an internal svg vector to do the drawing.
I love this shorter format! It's a good pace, quick and to the point, but still very easy to follow along if you know the basics (pseudo elements, grid, variables)
Maybe not centric to the video, but that bit of "moving on to solving something else to make progress when you get stuck with a problem" is something that really helps me in my day-to-day web-dev tasks
I came across a scenario like this the other day at work, I really wanted some kind of magical inverted border radius property at the time! 😅 I love your solution and I also enjoyed this content form, reminds me of the pace of a Short but with time for more detail. 👍
Honestly, the firs thought was, he got Kevin, will Kevin pull this off, but then again - he is the CSS man so, yeah, you nailed, thanks for the video.....whoooooooohhhh
Mission accomplished! It's handy, it did the job, but I have to admit I really don't like all these, say, workarounds with pseudo elements. I think it isn't quite maintenable, specially when you cover that responsive behavior, even using CSS vars IMHO. But, well, you did it! Thanks for sharing!
Brilliant as usual Kevin, thanks. In case I want to try the mask way. Is it that I would do it in Photoshop for instance and save it and use it in html? Is that what you mean? I have never tried such thing before.
I'll be honest that was a bit Janky or I should say Hacky, But I definitely learned some new things, That's always a Plus. Thanks for everything Kevin. Definately liked this new style, would love to see more like this here and there.
My solution (OJBZmra) which was picked by CodePen 😉 follows this closely. While CSS method looks sketchier with CSS it's easier to make it responsive and adaptive, all of the SVG solutions can't handle responsive layouts (however I think you could split the image in 2 or 3 which would allow for a responsive layout but it's now added a lot more complexity and it's more complex than the CSS solution. However I did the internal corners differently. Rather than having a square with a circular gradient to cut the corner, I used a transparent circle with the drop shadow 50% left 50% down and with this there were no aliased curves, all smooth and a lot simpler to set up.
*Respected Sir,* I would like to ask you, What topics, in what order should I follow to master CSS ? Its a bit confusing cause I know basic CSS but face problems in positioning components, making responsive designs, not able to make shapes etc. - Thank you
Please make video on this challenge. I want to make a layout where there are header and main and main has multiple dynamic items of 150/150 px each. while making responsive screen, items should wraps in smaller size. header should always occupy width according to the items. for example if it has 1 item then header width should have 150px if 2 items then 300px and so on so forth.
This reminds me of those is rounded corner days. When you would put 4 rounded cornered images at the four sides of the box - positioning absolute. CSS Grid should be ashamed of. And why the grid gap did not work? Any idea? This is totally strange!!
I've had to do something similar before. Before vector masks were as flexible as they are today. My case was somewhat simpler though. So I can't help but wonder if rendering the image on two boxes would have made it simpler to do.
You could switch it to whatever color you want... If you need it to be transparent so gradients or anything whatever can go under it, then use the mask-image that I mentioned off the top ☺️
@@KevinPowell I like the mask image much better as a solution. come are the days when with the flash player you would code this almost effortlessly, stii, this was a very intriguing css solution!
This looks great for post-edits but a nightmare for the initial edit. I love native approaches and avoiding raw images, but in this case I would stick to an image.
Can someone tell me exactly what he means by opening a vector software to create a mask, I do use Adobe Illustrator and I want to know the process, thanks in advance ☺️
This is a great video format, and I really enjoyed your explanation. Thanks. But on another issue, I think this challenge illustrates just how crazy CSS is as a language. The CSS solution is often more complex than the problem it is trying to solve. HTTP, HTML, CSS and Javascript were probably all reasonable ideas when they began, but they aren't good at describing the web we are building today. They never had good Separation of Concerns, and the concerns of the modern web are not those of the past. Instead of useful tools they are akin to mystic spells and incantations, adding their own complexity to the original task. We have answered these complexities with the rise of Frameworks and new languages, multiplying the complexity and adding dependency issues on top. All this results in a web that looks great, but has uncertain security, confused UX flow, intermittent bugs and even superstitious advice. We should stop adding to these languages and instead work together to figure out a new paradigm which fits the modern web. $0.02
I’m not happy with the border-radius on the white price box. You did _size / 2. But it should’ve been _size - 0.75rem. The 0.75 rem comes from the padding on that element, since it’s not set to _size but rather hardcoded 0.75
Interesting. My first thought would have been abusing outlines, pseudo-elements, and/or z-index, but it would probably be even harder than this method.
Tried a very different style with this video and I'd love to know what you think of it! (and yes, the mask-image would have been a lot easier and is probably the best approach 😅)
Loved this new approach. It's interesting to watch your thought process
it was quite fun and entertaining to watch! i hope you do more like these!
Really enjoyed the style of this video!
I like this video style👍
love it and this seems also useful to create a css-only LCARS interface.....
I had no idea you could position pseudo elements on the grid that’s so useful
There's nothing better than taking a design that most people would think requires photoshop/illustrator/masks/whatever and making it purely with CSS :) -- love this one!
Immediately I saw this video I remembered your critique of my website 😂
Is there something that this guy can't do?!
Amazing stuff Kevin!
Yes. I once asked him to make a poor CSS card and he tried his best but failed. It looked too good to pass my criteria
This is next level and why I love your work so much. You not only show the 'what' and the 'how' but the 'why'. So important to understand when troubleshooting. At least it is for me. Thank you, and my vote is for more vids in this format.
I used to not be very interested in CSS, and would learn how to brute force certain things, but as I've recently become the staff (read: only) frontend engineer at a startup, I've had to do more and more elegant implementations from our design team, and your videos have been instrumental in teaching me all the levers and switches and tools at my disposal to get things done easily and scalably, and I really appreciate that.
That’s why you are the CSS GOAT! 🙇♂️
you can do this with clip-path: polygon and sass functions by approximating a radius. Maybe impractical, but kinda cool, cause you can approximate any kinda shape, even squircles (like the shape of an ios app icon), which look very nice. You can even animate clip path point by point.
Thanks for this video, Kevin. Seeing you use psuedo classes is always pretty impressive to me. Looking forward to the next one. I also really like that you pull suggestions like these off twitter. Little design challenges like these that I haven't seen before are inspiring.
Love the ingenuity of this. It is not always about the easier way, but knowing the ways you can achieve the same thing, though manipulatable means is the true pursuit of wisdom, as it can be applied in many different, and even unrelated scenarios. Great work, Kevin, as always!
Bravo 👏 👏 👏, I did the same using an svg as the corner that I rotated for each corner and had a variable for width, height, and fill to control its size and color. Your solution is so awesome and simple, and the best part is that it's all css, amazing!
Had this problem 8 years ago or so. Added circles in size of the radius and in color of the background to get this shape. Very simple solution.
Excellent, recently in the company we had the same challenge, I solved it using the after and before pseudo elements, in addition to the use of the clip-path function with an internal svg vector to do the drawing.
I saw someone do it in Webflow, although without using the grid. That's some valuable knowledge right here.
Holy Jesus Kevin, mid-watch I was ready to comment "neat, now make it responsive" AND YOU GO AND MAKE IT RESPONSIVE! Amazing. Thanks for sharing
I love this shorter format! It's a good pace, quick and to the point, but still very easy to follow along if you know the basics (pseudo elements, grid, variables)
Maybe not centric to the video, but that bit of "moving on to solving something else to make progress when you get stuck with a problem" is something that really helps me in my day-to-day web-dev tasks
Thanks for going the hard way, in cases like this proving a point is progress for everyone.
Also the sped-up live work was interesting to watch!
I really like hearing your thought process.
This is why you are the King of CSS. I enjoy watching your videos you make CSS digestible and fun.
Amazing, but for the amount of work needed, I do believe that making it without SVG mask is the overkill.
100% the mask-image would be easier, plus it would work on non-solid backgrounds as well
@@KevinPowell please do this mask-image as well to compare responsiveness. Also do you any tutorial on mask-image?
Amazing work 👍kevin...
I would also like to complete this challenge.
Would love to see your approach! So many ways to do this, many probably better than what I did here 🤣
I came across a scenario like this the other day at work, I really wanted some kind of magical inverted border radius property at the time! 😅 I love your solution and I also enjoyed this content form, reminds me of the pace of a Short but with time for more detail. 👍
Kevin when watching your videos, my soul just relaxes ... .. I am big fan from Nepal 🙂😊
What a beautiful little design! Thanks for sharing, Kevin!
Honestly, the firs thought was, he got Kevin, will Kevin pull this off, but then again - he is the CSS man so, yeah, you nailed, thanks for the video.....whoooooooohhhh
Really impressive stuff! Thank you for sharing ❤
Mission accomplished! It's handy, it did the job, but I have to admit I really don't like all these, say, workarounds with pseudo elements. I think it isn't quite maintenable, specially when you cover that responsive behavior, even using CSS vars IMHO. But, well, you did it! Thanks for sharing!
Beautiful!! Thanks Kevin!
That was a fast-paced video... mercy for non-English speakers! Anyway, great video, thanks for this one, and for so much!
I can see you tried the same style as hyperplexed. Not quit his quality but keep it up, you’re getting there !
Kevin when watching your videos, my soul just relaxes ☺
You Kevin really are the CSS KING.
didn't know you can place absolute elements relative to grid areas . Thanks for sharing.
That's amazing. I think I like the different approach. But I found I was having to force myself to breathe. Smooth edits on that.
idk why but I really like the editing and overall the video.
Did you change anything?
Normally I talk as I write the code. This time I recorded the work, then went back over and made a voice over for it. Glad you liked it
@@KevinPowell Keep it going!
The King of CSS at it again
The dev was flexing unnecessarily on this one! Nice effect though. Nice one Kevin. 👊🏼
Thanks It worked way better then box shadow method. thank you :)
Ahh I remember this one. Great video Kevin!
Amazing work Kevin, thank you for the video!
I think I'd try doing it with an overlaid hand-coded SVG.
So absolute position in grid is relative la grid area that grid item takes not all grid container rectangle?. Is this correct? Thank you!
Hello. Congratulations! Challenge completed!
Brilliant as usual Kevin, thanks.
In case I want to try the mask way. Is it that I would do it in Photoshop for instance and save it and use it in html? Is that what you mean? I have never tried such thing before.
split keyboard? wow, i'm interested to know how good that is
Crazy well done
About to be enlightened by the content but first - which monitor do you use Kevin?
Samsung Odyssey Neo G9 🙂
@@KevinPowell Wow, that is _not_ cheap!
If 1440p is good enough for Kevin then might have to purchase 😅
That monitor grabbed my attention too.
This was a great video Kevin. This is the type of info we only get here. We appreciate you 🙏🏾
@@jezmck definitely a bit of a splurge, lol. I really like it, but a good 2 monitor set up is just fine as well
Intresting......Surely I will find a good use for this knowledge
That's some next level shit , he always seems to send me to the beginner mode
Kevin, you should be working on the actual CSS spec... You're mind blowingly good at this.
I'll be honest that was a bit Janky or I should say Hacky, But I definitely learned some new things, That's always a Plus. Thanks for everything Kevin.
Definately liked this new style, would love to see more like this here and there.
Wow awesome Kevin, tricky design, ;)
Both "radii" and "radiuses" are used in the UK and the US. "Radii" is far more common in published writing and academic papers.
REally Amazing The CSS King
Great video, I haven’t used CSS in a few weeks so this has helped me get a bit of a refresher as well as a cool tip to maybe try.
My solution (OJBZmra) which was picked by CodePen 😉 follows this closely. While CSS method looks sketchier with CSS it's easier to make it responsive and adaptive, all of the SVG solutions can't handle responsive layouts (however I think you could split the image in 2 or 3 which would allow for a responsive layout but it's now added a lot more complexity and it's more complex than the CSS solution.
However I did the internal corners differently. Rather than having a square with a circular gradient to cut the corner, I used a transparent circle with the drop shadow 50% left 50% down and with this there were no aliased curves, all smooth and a lot simpler to set up.
@Kevin Powell can you make a complete series videos on responsiveness with scss, i love you explanation.
WoW Kevin nice work station, how big is it? do you enjoy it?
It's the samsung odessy neo g9, 49". I love it, but I know some people who hate the curve and much prefer using multiple monitors instead
@@KevinPowell the curve seems massive indeed
Good work thank you Kevin
*Respected Sir,*
I would like to ask you,
What topics, in what order should I follow to master CSS ?
Its a bit confusing cause I know basic CSS but face problems in positioning components, making responsive designs, not able to make shapes etc.
- Thank you
That was brilliant
Looks great. 👍🏻
Congratulations! This one is really tricky, having tried it some time ago, and failed
Sometimes the best solution is not really the best solution. Doing this let you push the limits and find new ways to do stuff.
You are my favourite teacher ❤
Please make video on this challenge.
I want to make a layout where there are header and main and main has multiple dynamic items of 150/150 px each. while making responsive screen, items should wraps in smaller size. header should always occupy width according to the items. for example if it has 1 item then header width should have 150px if 2 items then 300px and so on so forth.
Wished you showed more regarding the stacking in grid. Havent seen a video regarding this..
Explicitly set the same grid column and row on both the elements that you want to overlap
Very interesting video! Thanks for sharing. 😉🔥
i need to try this
Awesome just awesome, the css king
This is a nice solution
You are Magic Johnson of the CSS
What monitor do use @kevin
Samsung Odessy Neo G9 - it's a bit of overkill, but I like it :D
You are a true magiccsian!
I tip my hat to you sir. Amazing.
This reminds me of those is rounded corner days. When you would put 4 rounded cornered images at the four sides of the box - positioning absolute. CSS Grid should be ashamed of. And why the grid gap did not work? Any idea? This is totally strange!!
the gap is there, but it doesn't work because the image is spanning multiple cells, so we don't see the gap there.
I've had to do something similar before. Before vector masks were as flexible as they are today. My case was somewhat simpler though. So I can't help but wonder if rendering the image on two boxes would have made it simpler to do.
So if I understand it correctly either you have a white background or this doesn't work?
You could switch it to whatever color you want... If you need it to be transparent so gradients or anything whatever can go under it, then use the mask-image that I mentioned off the top ☺️
@@KevinPowell I like the mask image much better as a solution. come are the days when with the flash player you would code this almost effortlessly, stii, this was a very intriguing css solution!
as allways amazing
This looks great for post-edits but a nightmare for the initial edit. I love native approaches and avoiding raw images, but in this case I would stick to an image.
Oh my GOD, you have a split keyboard. Can you make a video about your macros and about your experience with a split keyboard? It would be nice :)
I had to something like this but with a dynamic background. clip-path() with SCSS variables instead of custom properties was how I got it done.
That was a lot…. Thanks for all your work
GENIUS!
amazing maaan you are the goat ✨✨✨✨✨✨
Wow amazing thank. Now I Know
Can someone tell me exactly what he means by opening a vector software to create a mask, I do use Adobe Illustrator and I want to know the process, thanks in advance ☺️
CSS King 👌
Absolute goat
Greetings from Cyprus. I was trying to do this on a project I'm working on..
Maybe if we can apply
Image-rendering: smooth;
To shapes is possible
This is a great video format, and I really enjoyed your explanation. Thanks.
But on another issue, I think this challenge illustrates just how crazy CSS is as a language. The CSS solution is often more complex than the problem it is trying to solve.
HTTP, HTML, CSS and Javascript were probably all reasonable ideas when they began, but they aren't good at describing the web we are building today.
They never had good Separation of Concerns, and the concerns of the modern web are not those of the past. Instead of useful tools they are akin to mystic spells and incantations, adding their own complexity to the original task. We have answered these complexities with the rise of Frameworks and new languages, multiplying the complexity and adding dependency issues on top. All this results in a web that looks great, but has uncertain security, confused UX flow, intermittent bugs and even superstitious advice.
We should stop adding to these languages and instead work together to figure out a new paradigm which fits the modern web. $0.02
This works on a fixed color plain background... Any ideas for variable color or image/grafient backgrounds?
the mask-image with a svg mask like I first suggested, by far the easiest and most versatile option :)
I’m not happy with the border-radius on the white price box.
You did _size / 2. But it should’ve been _size - 0.75rem.
The 0.75 rem comes from the padding on that element, since it’s not set to _size but rather hardcoded 0.75
Oh, it's border-radii. Just flexing my knowledge of Latin plurals, you know the system where the entire modern language is based upon, no big deal. 😎📚
Interesting. My first thought would have been abusing outlines, pseudo-elements, and/or z-index, but it would probably be even harder than this method.
Hi Kevin,
this is a nice tutorial
But can you do a video using mask-image
You could use gradients for mask-image instead of an svg.
I'd love to know how to do that! Can you share a link?
@@erichepperlewp I don't think TH-cam lets you comment links but its on my Codepen megancweber.
From Egypt u are the best