No video

Creating an inverted border-radius with CSS

  Рет қаралды 135,649

Kevin Powell

Kevin Powell

Күн бұрын

Пікірлер: 207
@KevinPowell
@KevinPowell Жыл бұрын
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 😅)
@enkada69
@enkada69 Жыл бұрын
Loved this new approach. It's interesting to watch your thought process
@ninjacodertech
@ninjacodertech Жыл бұрын
it was quite fun and entertaining to watch! i hope you do more like these!
@hasan_haja
@hasan_haja Жыл бұрын
Really enjoyed the style of this video!
@JasonJA88
@JasonJA88 Жыл бұрын
I like this video style👍
@MichaelErkens
@MichaelErkens Жыл бұрын
love it and this seems also useful to create a css-only LCARS interface.....
@flaringk
@flaringk Жыл бұрын
I had no idea you could position pseudo elements on the grid that’s so useful
@Gearyco
@Gearyco Жыл бұрын
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!
@odinaka_joshua
@odinaka_joshua Жыл бұрын
Immediately I saw this video I remembered your critique of my website 😂
@hwg6986
@hwg6986 Жыл бұрын
Is there something that this guy can't do?! Amazing stuff Kevin!
@appsenence9244
@appsenence9244 Жыл бұрын
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
@D7460N
@D7460N Жыл бұрын
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.
@jm-alan
@jm-alan Жыл бұрын
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.
@turolretar
@turolretar Жыл бұрын
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.
@FlorinPop
@FlorinPop Жыл бұрын
That’s why you are the CSS GOAT! 🙇‍♂️
@michaelm8044
@michaelm8044 Жыл бұрын
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.
@Jason-mk3nn
@Jason-mk3nn Жыл бұрын
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!
@tasleet
@tasleet Жыл бұрын
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!
@NoName-1337
@NoName-1337 Жыл бұрын
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.
@pablowbk
@pablowbk Жыл бұрын
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
@marcosantonioreyesmedina2364
@marcosantonioreyesmedina2364 Жыл бұрын
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.
@nielskersic328
@nielskersic328 Жыл бұрын
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)
@ralacerda12
@ralacerda12 Жыл бұрын
Amazing, but for the amount of work needed, I do believe that making it without SVG mask is the overkill.
@KevinPowell
@KevinPowell Жыл бұрын
100% the mask-image would be easier, plus it would work on non-solid backgrounds as well
@FaizanAnwerAli
@FaizanAnwerAli Жыл бұрын
@@KevinPowell please do this mask-image as well to compare responsiveness. Also do you any tutorial on mask-image?
@YaroLord
@YaroLord Жыл бұрын
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
@pxlskee
@pxlskee Жыл бұрын
I saw someone do it in Webflow, although without using the grid. That's some valuable knowledge right here.
@aenapoeka
@aenapoeka Жыл бұрын
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!
@blackwolf542
@blackwolf542 Жыл бұрын
This is why you are the King of CSS. I enjoy watching your videos you make CSS digestible and fun.
@libbeytds
@libbeytds Жыл бұрын
The King of CSS at it again
@OnlineTutorialsYT
@OnlineTutorialsYT Жыл бұрын
Amazing work 👍kevin... I would also like to complete this challenge.
@KevinPowell
@KevinPowell Жыл бұрын
Would love to see your approach! So many ways to do this, many probably better than what I did here 🤣
@francescomerighi6458
@francescomerighi6458 Жыл бұрын
You Kevin really are the CSS KING.
@vlad_gabor
@vlad_gabor 5 ай бұрын
Really impressive stuff! Thank you for sharing ❤
@maxfalovic
@maxfalovic Жыл бұрын
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. 👍
@KoarisDesign
@KoarisDesign Жыл бұрын
I can see you tried the same style as hyperplexed. Not quit his quality but keep it up, you’re getting there !
@i_am_ergo
@i_am_ergo Жыл бұрын
What a beautiful little design! Thanks for sharing, Kevin!
@pablorey9203
@pablorey9203 Жыл бұрын
That was a fast-paced video... mercy for non-English speakers! Anyway, great video, thanks for this one, and for so much!
@mambans
@mambans Жыл бұрын
I really like hearing your thought process.
@ishwerchaudhary6053
@ishwerchaudhary6053 Жыл бұрын
Kevin when watching your videos, my soul just relaxes ... .. I am big fan from Nepal 🙂😊
@adeisaac
@adeisaac Жыл бұрын
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
@jezmck
@jezmck Жыл бұрын
I think I'd try doing it with an overlaid hand-coded SVG.
@marielemaitre5006
@marielemaitre5006 Жыл бұрын
Beautiful!! Thanks Kevin!
@user-vs2kp2wo6g
@user-vs2kp2wo6g 11 ай бұрын
Thanks It worked way better then box shadow method. thank you :)
@hjetwd
@hjetwd Жыл бұрын
Kevin when watching your videos, my soul just relaxes ☺
@philwatts
@philwatts Жыл бұрын
The dev was flexing unnecessarily on this one! Nice effect though. Nice one Kevin. 👊🏼
@fatimanura6359
@fatimanura6359 Жыл бұрын
That's some next level shit , he always seems to send me to the beginner mode
@castlemoyle
@castlemoyle Жыл бұрын
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.
@kushagra-aa
@kushagra-aa Жыл бұрын
Intresting......Surely I will find a good use for this knowledge
@jacoblockwood4034
@jacoblockwood4034 Жыл бұрын
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.
@rockmonty
@rockmonty Жыл бұрын
didn't know you can place absolute elements relative to grid areas . Thanks for sharing.
@jeros2911
@jeros2911 Жыл бұрын
Amazing work Kevin, thank you for the video!
@BlurryBit
@BlurryBit Жыл бұрын
Ahh I remember this one. Great video Kevin!
@zaidnissar356
@zaidnissar356 7 ай бұрын
Crazy well done
@ThomKnepper
@ThomKnepper Жыл бұрын
Kevin, you should be working on the actual CSS spec... You're mind blowingly good at this.
@_abdul
@_abdul Жыл бұрын
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.
@beratsulimani9823
@beratsulimani9823 Жыл бұрын
Wow awesome Kevin, tricky design, ;)
@zeddash
@zeddash Жыл бұрын
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.
@nameless5724
@nameless5724 Жыл бұрын
REally Amazing The CSS King
@domsau2
@domsau2 Жыл бұрын
Hello. Congratulations! Challenge completed!
@daveturnbull7221
@daveturnbull7221 Жыл бұрын
Sometimes the best solution is not really the best solution. Doing this let you push the limits and find new ways to do stuff.
@Bedicoder
@Bedicoder Жыл бұрын
Good work thank you Kevin
@prodbybarn
@prodbybarn Жыл бұрын
Awesome just awesome, the css king
@ed1nh0
@ed1nh0 Жыл бұрын
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!
@RaneBowen
@RaneBowen Жыл бұрын
That was brilliant
@0Ipsita0
@0Ipsita0 Жыл бұрын
@Kevin Powell can you make a complete series videos on responsiveness with scss, i love you explanation.
@nagualdesign
@nagualdesign Жыл бұрын
Looks great. 👍🏻
@unleashthedog
@unleashthedog 4 ай бұрын
split keyboard? wow, i'm interested to know how good that is
@Vickwick58
@Vickwick58 Жыл бұрын
Both "radii" and "radiuses" are used in the UK and the US. "Radii" is far more common in published writing and academic papers.
@Simple_Minded
@Simple_Minded Жыл бұрын
i need to try this
@lukas.webdev
@lukas.webdev Жыл бұрын
Very interesting video! Thanks for sharing. 😉🔥
@suvojitmodak3285
@suvojitmodak3285 Жыл бұрын
You are my favourite teacher ❤
@nove1398
@nove1398 Жыл бұрын
This is a nice solution
@marcllobera3934
@marcllobera3934 Жыл бұрын
as allways amazing
@renatos.novaes8700
@renatos.novaes8700 Жыл бұрын
GENIUS!
@ThomasGodart
@ThomasGodart Жыл бұрын
Congratulations! This one is really tricky, having tried it some time ago, and failed
@PabloGaraguso
@PabloGaraguso Жыл бұрын
I tip my hat to you sir. Amazing.
@GetFreeBitcoin
@GetFreeBitcoin Жыл бұрын
Designer: Please implement this design Engineer: Wait a minute... it's done Enemy: Oh, that's good. Let's put this above the gradient
@saschab.5154
@saschab.5154 Жыл бұрын
You are a true magiccsian!
@haroldguzman1285
@haroldguzman1285 Жыл бұрын
Wow amazing thank. Now I Know
@NurioonSoftware
@NurioonSoftware Жыл бұрын
You are Magic Johnson of the CSS
@monarchgam3r
@monarchgam3r Жыл бұрын
That was a lot…. Thanks for all your work
@husreihn1070
@husreihn1070 Жыл бұрын
Wished you showed more regarding the stacking in grid. Havent seen a video regarding this..
@irfantayyib
@irfantayyib 5 ай бұрын
Explicitly set the same grid column and row on both the elements that you want to overlap
@code.design
@code.design Ай бұрын
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. 😎📚
@hassanfarooq534
@hassanfarooq534 Жыл бұрын
amazing maaan you are the goat ✨✨✨✨✨✨
@GulaManYOW
@GulaManYOW Жыл бұрын
Absolute goat
@minadivlogs4790
@minadivlogs4790 Жыл бұрын
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.
@_Amilio_
@_Amilio_ Жыл бұрын
CSS King 👌
@rojka-_-
@rojka-_- Жыл бұрын
Damm thats awesome
@truvc
@truvc Жыл бұрын
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.
@ShiloBuff
@ShiloBuff Жыл бұрын
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.
@proteus1
@proteus1 Жыл бұрын
Greetings from Cyprus. I was trying to do this on a project I'm working on..
@cdey3886
@cdey3886 Жыл бұрын
idk why but I really like the editing and overall the video. Did you change anything?
@KevinPowell
@KevinPowell Жыл бұрын
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
@cdey3886
@cdey3886 Жыл бұрын
@@KevinPowell Keep it going!
@juliofreitas1652
@juliofreitas1652 Жыл бұрын
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 :)
@anthonyewell3470
@anthonyewell3470 Жыл бұрын
This is definitely one of those "great katas that you'd never want to actually implement" type of things
@meganweber5057
@meganweber5057 4 ай бұрын
You could use gradients for mask-image instead of an svg.
@erichepperlewp
@erichepperlewp 2 ай бұрын
I'd love to know how to do that! Can you share a link?
@meganweber5057
@meganweber5057 2 ай бұрын
@@erichepperlewp I don't think KZfaq lets you comment links but its on my Codepen megancweber.
@bigphab7205
@bigphab7205 Жыл бұрын
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.
@dave6012
@dave6012 Жыл бұрын
Slay, king 🤴
@thedacian123
@thedacian123 Жыл бұрын
So absolute position in grid is relative la grid area that grid item takes not all grid container rectangle?. Is this correct? Thank you!
@itssNiraj
@itssNiraj Жыл бұрын
Maybe if we can apply Image-rendering: smooth; To shapes is possible
@I-Broke-Your-Mailbox
@I-Broke-Your-Mailbox Жыл бұрын
I'm still getting better at css so please forgive me if there is something obvious I'm forgetting. But why can't you just create an overlapping div or 2 to the right with border radius properties and a background color set to black, then use mix-blend-mode: screen; on it, to subtract the corners from the bottom shape?
@DEBO5
@DEBO5 Жыл бұрын
Css legend
@peter-bash
@peter-bash Жыл бұрын
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.
@ahmedhussien6868
@ahmedhussien6868 Жыл бұрын
From Egypt u are the best
@Kamrul_abc
@Kamrul_abc Жыл бұрын
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!!
@KevinPowell
@KevinPowell Жыл бұрын
the gap is there, but it doesn't work because the image is spanning multiple cells, so we don't see the gap there.
@savado
@savado Жыл бұрын
Next video: this layout, but with transparency instead of using white
@KevinPowell
@KevinPowell Жыл бұрын
Then I'd just use the svg I made at the start with a mask-image 😊
@shoulderstack5527
@shoulderstack5527 Жыл бұрын
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
@danatronics9039
@danatronics9039 Жыл бұрын
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.
@Evangelist45938
@Evangelist45938 Жыл бұрын
Kevin amazing video as always It’s mind blowing how complex css can get Here a video idea Kevin shows us your old css projects or websites would be fun to see CSS master struggles or I guess progress 👍😃
@xXarz15Xx
@xXarz15Xx Жыл бұрын
About to be enlightened by the content but first - which monitor do you use Kevin?
@KevinPowell
@KevinPowell Жыл бұрын
Samsung Odyssey Neo G9 🙂
@jezmck
@jezmck Жыл бұрын
@@KevinPowell Wow, that is _not_ cheap!
@xXarz15Xx
@xXarz15Xx Жыл бұрын
If 1440p is good enough for Kevin then might have to purchase 😅
@d.o.nmuzic3802
@d.o.nmuzic3802 Жыл бұрын
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 🙏🏾
@KevinPowell
@KevinPowell Жыл бұрын
​@@jezmck definitely a bit of a splurge, lol. I really like it, but a good 2 monitor set up is just fine as well
When you accidentally make something awesome
16:38
Kevin Powell
Рет қаралды 40 М.
Using CSS custom properties like this is a waste
16:12
Kevin Powell
Рет қаралды 167 М.
If Barbie came to life! 💝
00:37
Meow-some! Reacts
Рет қаралды 73 МЛН
Ik Heb Aardbeien Gemaakt Van Kip🍓🐔😋
00:41
Cool Tool SHORTS Netherlands
Рет қаралды 9 МЛН
The problems with viewport units
13:23
Kevin Powell
Рет қаралды 359 М.
:has() opens up new possibilities with CSS
14:30
Kevin Powell
Рет қаралды 285 М.
3D CSS - lighting, animations, and more!
44:57
Kevin Powell
Рет қаралды 405 М.
What I do as an Email Developer
8:41
JasheleTechTV
Рет қаралды 37 М.
A new approach to container and wrapper classes
25:27
Kevin Powell
Рет қаралды 254 М.
5 super useful CSS properties that don't get enough attention
16:23
Kevin Powell
Рет қаралды 144 М.
Relative colors make so many things easier!
13:16
Kevin Powell
Рет қаралды 47 М.
Become A Master Grid CSS In 13 Minutes
13:46
Lun Dev
Рет қаралды 30 М.