The background values no one knows about

  Рет қаралды 42,100

Kevin Powell

Kevin Powell

Күн бұрын

Пікірлер: 131
@Thor6398-jt4mb
@Thor6398-jt4mb 7 ай бұрын
Wait, have you always been saying "front-end friends"? I thought you said "friend and friends" 🤦🏼‍♂️
@Tiger__Man
@Tiger__Man 7 ай бұрын
😂😂😂😂 yeah i just now realise also
@salad_txt
@salad_txt 7 ай бұрын
Hahahaha I thought it was just me!
@BliitzPint
@BliitzPint 7 ай бұрын
Haha same here :D
@luca.pettinato
@luca.pettinato 7 ай бұрын
Me too
@olinadeimbakar
@olinadeimbakar 7 ай бұрын
Guilty too😂
@samwalker4438
@samwalker4438 7 ай бұрын
I thought Kevin was saying “hello my friend and friends” Front-End Friends makes so much more sense 😂
@dirkvandiepen1890
@dirkvandiepen1890 7 ай бұрын
I have been thinking that for 6+ months! Even knowing what Kevin actually means it still sounds more like "hello my friend-end friends"
@LennartKlein
@LennartKlein 7 ай бұрын
Hahaha thank you soo much for clearing this up
@_zer09_
@_zer09_ 7 ай бұрын
accidentally found out as well when I had CC on months ago 😅
@ivanbryukhov
@ivanbryukhov 7 ай бұрын
No way!!! I thought the same for years and never ever doubted it. Now it makes much more sense. My life would never be the same... Now it is so obvious! Why would he even say "friend and friends", right?
@marcorieser
@marcorieser 7 ай бұрын
Today I learned 😁
@DatDat59
@DatDat59 7 ай бұрын
Seeing repeat-x and repeat-y reminds me 2000s when we were using an image mapped to simulate shadows and radius around a block made of a table with 9 cells.
@gizmostudios
@gizmostudios 7 ай бұрын
Oh wow that takes me back :'D Draw a button in Photoshop, add gradient, drop shadow, 9 slices and painstakingly write all the code for one button to reproduce! How much easier life's become for a web designer these days, thank god!
@codclever
@codclever 7 ай бұрын
Very thankful to have an nice coding support for our CSS and frontend issues. Love your videos man!
@clevermissfox
@clevermissfox 7 ай бұрын
Love to learn about new obscure properties!! Background-repeat; space seems very valuable!
@TheRealMangoDev
@TheRealMangoDev 7 ай бұрын
thats bc it is
@brunopanizzi
@brunopanizzi 7 ай бұрын
6:10 Round is very useful for the hero section of a website that I'm making, the bg image is just a small 16 by 16 square repeating, and without round it always cropped off the last one because it's not the perfect size. Thanks for the tip, will be updating my site today!
@kirillsukhomlin3036
@kirillsukhomlin3036 7 ай бұрын
You could have your logo rotated to connect edge points of 'f' letter. So background-repeat: round works with repeatable textures like that.
@GerritforBazeja
@GerritforBazeja 7 ай бұрын
I used "round"for an image that was just to small to cover my background part for content. Not jet online.
@codclever
@codclever 7 ай бұрын
How the hell did you send this comment if the video was sent on 11:22 PM IST
@bharatbaraiya7552
@bharatbaraiya7552 7 ай бұрын
​@@codclever Same question bruh😮
@drumming_cat
@drumming_cat 7 ай бұрын
this video was posted an HOUR ago but this comment is from a DAY ago???
@chrispaschall5507
@chrispaschall5507 7 ай бұрын
These background repeat properties are cool. The star example was pretty good, but if it were me, I’d probably just get the svg code of the star, make a symbol tag of its code, and have JavaScript render SVGs with use tags in the DOM using a for loop that would execute every time the select field changed. Then let the flexbox gap property take care of the spacing from there after the stars are rendered. Less math involved that way.
@CirTap
@CirTap 7 ай бұрын
I can see 'round' used with evenly spread grids where a background (svg maybe) "covers" the grid items which are otherwise unstylable. One could mimic border effects or separation lines between these virtual grid or flex items if the elements themselves are irregular but evenly spaced out. I recall a mini gallery where I had to mess with linear gradients and custom props to get simple separation lines between the gallery items that followed the size and width of the container. Messy business 😅
@knaughtilus
@knaughtilus 7 ай бұрын
Did a project for school last year (it was movie/cinema related) and I wanted a decorative stripe resembling an old school film roll seperating my image and text on a card. I wanted a fixed width for it so I utilized background-image. My teacher wasn't happy that the shape was cropped at the end (as background-repeat usually does) and since I didn't know the height of the card background-repeat: round; really came in handy :) Bonus was that you can use it for mask-repeat too, so i threw a nice gradient on there as well. Sorry if you can't follow my description, I'll try to put it in a codepen later if I have the time :D but I found that a very good - and until today only - use case I ever had for it.
@MyDpop
@MyDpop 7 ай бұрын
I learn something new every time, thank you Kevin. 🤟This reminds me a bit of *border-image* . Another exotic and lost property 😏
@VideoNOLA
@VideoNOLA 5 ай бұрын
You should add a giant "CSS Cheat Sheet" wall poster to your merch store!! Leave nothing off!
@jacobwwarner
@jacobwwarner 7 ай бұрын
Regardless of supporting or opposing this, it will be really interesting to see how they restore the land previously submerged in the resevoirs. Also, they mentioned the two dams remaining in OR to mitigate flood waters, but what about the communities downstream in CA? I'm unfamiliar with the area, but Im curious if those small towns could be at risk of major floods if theyre not high enough above the rivers.
@mikaockerman832
@mikaockerman832 6 ай бұрын
Before I hear your use cases. I could see using round on abstract type images where aspect ratio is not as important, perhaps with a semi transparent overlay to dim them a little and set them as decoration behind some display images, like perhaps products or something.
@domanickharper
@domanickharper 7 ай бұрын
all this time, I thought he said friend and friends but front-end friends sounds nice too, a friend none the less
@mansurhamidov2319
@mansurhamidov2319 7 ай бұрын
For gap to work properly it shouldn't be more than quarter of star-width. Just simple math there could work. Like computed gap: max(var(--gap), calc(var(--star-width)/4))
@Matt23488
@Matt23488 7 ай бұрын
you could use `round` to take a simple image that perfectly tiles visually with itself to create some background patterns that are dynamic based on your resolution and aspect ratio. That could be kinda cool.
@DerClaudius
@DerClaudius 7 ай бұрын
You can probably use it to implement different kinds of 9-patch-scaling if you set multiple backgrounds
@PascalHorn
@PascalHorn 7 ай бұрын
One random semi-related fund of my last few weeks was, getting background color on an image to get it perfectly "scaled" to a parent box. Like: .parent { display: flex; justify-content: center; align-items: center; width: 200px; height: 200px; background-color: #ccc; } .parent img { width: 100%; height: 100%; padding: 20px; border-radius: 15px; box-sizing: border-box; object-fit: contain; // Magic; background-color: #fff; // } Even if the image has a random size like 200x100 pixels, this will fill the rest up with the background-color of white in this case. It becomes a filler color. With that logic, even a background-image like a radial gradient and background-size: cover should be interesting. And yes, the border-radius and padding on the image will be placed at the corners of the 200x200 pixels of the parent. Love these random stuff you learn after years and years along the way.
@nielslytzdk
@nielslytzdk 7 ай бұрын
A fun little demo, but I would not use this specific example in production, you are taking away data from the DOM which is critical for accessibility by rendering the stars as a background image. But still glad to learn new features that I didn't know existed 👍.
@Novacification
@Novacification 7 ай бұрын
Another use case for space would be a background of sponsor logos. Maybe you have a sponsored event that needs a promo page with logos in the background and a small info box with event details in the middle. Sponsors don't care if it looks natural, they want their logo to be as visible as possible and preferably not cut off anywhere. You see this pattern used in the real world all over the place, e.g. in sports or at a red carpet event.
@eccenux
@eccenux 7 ай бұрын
Space would work nice for most backgrounds that are covered by content. So there is some pattern on the left, content, pattern on the right. And you want the pattern to align to the sides. You can kind of cheat now and do two backgrounds, but using space would be so much easier 🙂
@atrus3823
@atrus3823 7 ай бұрын
Background repeat round might work pretty well for a grid. I guess the lines stretching might look weird, but maybe it wouldn't be that noticeable. I think I'll try it out at some point
@Maseschine
@Maseschine 7 ай бұрын
For the space and round function I can see image textures coming to websites as their backgrounds.
@yanexy
@yanexy 7 ай бұрын
repeat: space is a beauty, and your implementation also ☺
@mannixmd
@mannixmd 7 ай бұрын
Kevin blowing my mind one video at a time :D
@ellopropello
@ellopropello 7 ай бұрын
css is getting better and better :)
@VE0003
@VE0003 7 ай бұрын
2:24 or a square background texture/pattern that perfectly tiles
@Psyzenn
@Psyzenn 7 ай бұрын
Maybe round for animations ? Like some cool distortion effect.
@BGdev305
@BGdev305 7 ай бұрын
Would have really been nice had you thrown some css fade animation. And 2x as nice with a fade and a growing size transform!
@sunflair-wa
@sunflair-wa 7 ай бұрын
I have a question. Using your star example, would you be able to use a clip path for the repeating image, or even a background-image of a radial gradient using a background size? Asking for a friend, which is me. :)
@Noritoshi-r8m
@Noritoshi-r8m 7 ай бұрын
Have you done a How to make a proper Header video? I always struggle with background images x_X
@outpost31737
@outpost31737 7 ай бұрын
You can use background-repeat: space repeat;
@aseemanand1
@aseemanand1 7 ай бұрын
How does your video work in PIP mode on youtube?
@blokche_dev
@blokche_dev 7 ай бұрын
There's so much we can do with backgrounds.
@peterhorvath6859
@peterhorvath6859 7 ай бұрын
You could make a video on how to format a plain numeric cell value with thousand separators in css only! 1234561234123456781234567890 No js, no html modify. Or why not possible?
@Komentujebomoge32
@Komentujebomoge32 7 ай бұрын
Have anyone any idea how to make button which appears on some scroll level, and by still going downwards it sticks into the place where it appeared? I am asking because I am working on button which takes us after click at the TOP of website, but by trying many own ideas and by trying looking for answers in the NET I barely can find anything about this topic.
@BliitzPint
@BliitzPint 7 ай бұрын
Wait, you can set custom attributes on HTML tags and caculate with their values in CSS?? What is that magic??? 😮How does it work? How is it called? I want to know more of that.
@muhdkamilmohdbaki7054
@muhdkamilmohdbaki7054 7 ай бұрын
It puzzles me why I never watch any magician does CSS on their shows. The amounts of tricks they can perform are limitless and I still can't understand how they do it. All of these are beyond magic to me🤭😅.
@andriydamon8388
@andriydamon8388 7 ай бұрын
do you know React?
@KevinPowell
@KevinPowell 7 ай бұрын
I have used it, not sure if that means I know it though 😅
@RobertMcGovernTarasis
@RobertMcGovernTarasis 7 ай бұрын
No not avFeF, a KP acquaintance
@RobertMcGovernTarasis
@RobertMcGovernTarasis 7 ай бұрын
Virtual)
@TimeFlyBy
@TimeFlyBy 7 ай бұрын
That logo hurts my eyes...
@the-real-pawook
@the-real-pawook 7 ай бұрын
idk if it's tiktok's bad influence or just me being weird, but I was instantly offended by having to watch 15 minutes of the video where it could have been a Shorts clip
@devileyes4u
@devileyes4u 5 ай бұрын
IT'S PERFECT!!! using in prod, thank you Kevin you are CSS hero!
@pdizzlin
@pdizzlin 7 ай бұрын
Lol…it’s funny the number of people that hear “friend and friends”. I always heard front-end friends myself! Funny how everyone’s brain hears different things l.
@gizmostudios
@gizmostudios 7 ай бұрын
Wait... it's not? Which one is it? I also hear Friend and Friends :'D
@aram5642
@aram5642 7 ай бұрын
(In your life, find yourself a friend who'll greet you the way Kevin greets youtubers.)
@blu3tan
@blu3tan 7 ай бұрын
background-repeat: space is mindblowing 🤯
@klemensforster
@klemensforster 7 ай бұрын
Round is actually insanely useful! Imagine all the gaming websites using the cool stone or wood sign textures that begin and end with a texture and have a repeating texture filling the space between. The distortion would not be too bad, but it would ensure the sign to always be seamless.
@complainer406
@complainer406 7 ай бұрын
Until you resize the window and it jumps from 7 copies of the image to 8 Cropping seems like a better option
@Mr.RobotHead
@Mr.RobotHead 7 ай бұрын
I remember the olden days when we used to have a background image that we'd repeat to make a nice tiled pattern. `round` is probably useful to keep those tiles _close enough_ to the original aspect ratio without cutting off a bit of the pattern. I can't really think of any other use, though.
@daviddonachie5333
@daviddonachie5333 7 ай бұрын
I know! That comment that everyone just uses "cover" is so much a thing of our big-bandwidth era. When I started, it was all about making 10px textures and then tiling them ... or 2px textures even! The idea of a non-repeating background was the werid thing.
@PacificDev
@PacificDev 7 ай бұрын
Great stuff as always! Kevin 👋 how did you manage to hide that little oblique bars on the bottom right corner of the resizable element?
@kirillsukhomlin3036
@kirillsukhomlin3036 7 ай бұрын
If the gap is more than 1/nth of the size of the image (star), one won't be able to put more than n stars. Maybe even less (depending on how round is implemented). This example is a little artificial.
@BrankoStancevic
@BrankoStancevic 7 ай бұрын
Cool feature, thanks! Have fun animating star rating example! :D I actually have some thoughts, but I need to try those out first.
@jamescat2386
@jamescat2386 7 ай бұрын
something makes me think if it was a high enough star count (so it's fine in this example) then you could instead of distributing the space, fit another star in, I mean obviously it's fine in this case but at a certain scale it breaks (maybe?)
@muchis
@muchis 7 ай бұрын
interesting, i learned something, but at the end that was honestly an overengineered flex + gap 😅
@slava_trushkin
@slava_trushkin 7 ай бұрын
Round option has one good use I can think of: repeating textures that have one pattern in middle and different on edges. It can also be followed by another element with a texture that fits it perfectly for edge element. I've been designing theme for RPG forum many years ago, this would have been so perfect.
@druharper
@druharper 7 ай бұрын
Nuggets of wisdom :)
@justingolden87
@justingolden87 7 ай бұрын
You should make a fef hat that would be dope
@_dinesh
@_dinesh 7 ай бұрын
wow learned so much in this video. I didn't know you could set css variables from js by `document.body.style.setProperty('--star-count', e.target)`. Nicely done!.
@gizmostudios
@gizmostudios 7 ай бұрын
Also good to know is you can get the CSS properties with style.getProperty() :)
@joll05
@joll05 7 ай бұрын
I hadn't seen round before this, and I also think it's kinda weird when it stretches the image, but I played around with it and I think I found a more practical way of using it. If you combine it with a different repeat value (for example 'background-repeat: round repeat;') then it will resize the image equally in both directions so that it fits either horizontally or vertically (depending on which one is 'round'). This means that the image won't be cropped in the specified direction, but won't be unevenly stretched either. I can see that being used in something like a long background image, where you might not want the image to be cropped off the edge of the page, but don't mind it being cropped off the bottom.
@Korcenton
@Korcenton Ай бұрын
Exactly! round repeat is perfect when you want a pattern to not crop on the x axis. It'll resize without distortion, leaving a bit of cropping at the bottom of the page -- no biggie! I'm using this for a checkerboard pattern on my site: cropping on the right would look horrible, as if you're supposed to scroll horizontally. round repeat fixes that; it's space repeat without a gap :D
@vincentjacquet2927
@vincentjacquet2927 7 ай бұрын
Nice demo. I would only add "print-color-adjust: exact" on the rating element to better support printing.
@harshbhardwaj6060
@harshbhardwaj6060 7 ай бұрын
Is it good using SVG's to create some moving things or should we use CSS for that. Whats your take on those people doing svg craziness.
@kevinphandy2
@kevinphandy2 7 ай бұрын
I used this to add repeating side facing chevrons for a client. The designer had it as a leading element to various things. Used space to make it a responsive element changing the amount based on how much room there was.
@kaustavroy6542
@kaustavroy6542 7 ай бұрын
That is such a good use case. Thanks Kevin.
@TheLastSeason
@TheLastSeason 7 ай бұрын
Thank you Kevin! I love your videos)
@markboots_
@markboots_ 7 ай бұрын
Am I a nerd already knowing those values?
@KevinPowell
@KevinPowell 7 ай бұрын
Most definitely 😆. But that's okay, at least you remember them. I actually did a short on `space` awhile back, and then completely forgot it existed until recently 😅.
@marsovac
@marsovac 7 ай бұрын
This is very overcomplicated for something that just needs to show from 1 to 5 stars :P
Is this a good idea?
24:34
Kevin Powell
Рет қаралды 29 М.
Can I clone this fun effect from CSS Day using modern CSS?
25:39
Kevin Powell
Рет қаралды 35 М.
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 100 МЛН
Officer Rabbit is so bad. He made Luffy deaf. #funny #supersiblings #comedy
00:18
Funny superhero siblings
Рет қаралды 5 МЛН
哈莉奎因怎么变骷髅了#小丑 #shorts
00:19
好人小丑
Рет қаралды 52 МЛН
How programmers flex on each other
6:20
Fireship
Рет қаралды 2,4 МЛН
Most people have no idea you can style underlines like this
10:03
Kevin Powell
Рет қаралды 39 М.
A simple CSS solution to select ranges of content
7:22
Kevin Powell
Рет қаралды 34 М.
OpenAI’s New ChatGPT: 7 Incredible Capabilities!
6:27
Two Minute Papers
Рет қаралды 188 М.
Using currentColor with color-mix is amazing
12:46
Kevin Powell
Рет қаралды 49 М.
Unfamiliar CSS patterns that improve on the classics
22:57
Kevin Powell
Рет қаралды 47 М.
Write less code with these 5 CSS tips
15:38
Kevin Powell
Рет қаралды 47 М.
Is Tailwind Taking Over CSS? (and some other insights)
18:25
Kevin Powell
Рет қаралды 58 М.
A new approach to container and wrapper classes
25:27
Kevin Powell
Рет қаралды 259 М.
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 100 МЛН