Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

CSS Tip ๐Ÿ“– Use CSS shape-outside to wrap text around shapes .column--left .shape { float: right; shape-outside: circle(100px at 100% 50%)); }

487,130 Aufrufe โ€ข vor 2 Jahren โ€ขvia X (Twitter)

10 Kommentare

Profilbild von jhey โ–ฒ๐Ÿป๐ŸŽˆ
jhey โ–ฒ๐Ÿป๐ŸŽˆvor 2 Jahren

Here's the @CodePen link! ๐Ÿค™ The trick is to use 2 columns with two elements for shape-outside, a semi-circle for each column ๐Ÿ“– Then you can power it with custom properties as seen in the video above ๐Ÿ˜Ž

Profilbild von jhey โ–ฒ๐Ÿป๐ŸŽˆ
jhey โ–ฒ๐Ÿป๐ŸŽˆvor 2 Jahren

The only "caveat"? ๐Ÿ‘€ You're limited in how you use it. You need to split your content into columns manually ๐Ÿ™ƒ It doesn't play nice with column-count Not the end of the world though and would look nice on some landing pages etc. ๐Ÿค™

Profilbild von Simon Vrachliotis
Simon Vrachliotisvor 2 Jahren

Now make the DVD screen saver bouncing thing and the text wraps around it to let it pass

Profilbild von Dheeraj Purohit เคงเฅ€เคฐเคœ เคชเฅเคฐเฅ‹เคนเคฟเคค โญ•โ—โญ•
Dheeraj Purohit เคงเฅ€เคฐเคœ เคชเฅเคฐเฅ‹เคนเคฟเคค โญ•โ—โญ•vor 2 Jahren

Woah ๐Ÿ˜ฒโœจ Is it all static elements(2 cols and circle) , I mean by position

Profilbild von ๐‘จ๐’๐’‚๐’•๐’‰๐’†๐’Ž๐’‚
๐‘จ๐’๐’‚๐’•๐’‰๐’†๐’Ž๐’‚vor 2 Jahren

Bro nailed it

Profilbild von Airem
Airemvor 2 Jahren

Shape-outside ? CSS is insane. What's left to add ?

Profilbild von Baiee
Baieevor 2 Jahren

service ๐Ÿ”ฅ

Profilbild von jhey โ–ฒ๐Ÿป๐ŸŽˆ
jhey โ–ฒ๐Ÿป๐ŸŽˆvor 2 Jahren

Should change my bio ๐Ÿ˜… "Demos as a service" "Tag me and demos will follow"

Profilbild von ๐‘๐ฎ๐ฌ๐ฌ ๐Ÿ–ค
๐‘๐ฎ๐ฌ๐ฌ ๐Ÿ–คvor 2 Jahren

I wonder if it works with images, I could see some cool stuff being created with this.

Profilbild von Luke Martin
Luke Martinvor 2 Jahren

Seeing float

ร„hnliche Videos

CSS Tip! ๐Ÿ’ช You can create these tab controls with CSS :has() + radio buttons โœจ .tabs:has(input:nth-of-type(3)) { --count: 3; } .tabs:has(:checked:nth-of-type(3)) { --active: 2; } .tabs::after { translate: calc(var(--active, 0) * 100%) 0; width: calc(100% / var(--count)); } Two CSS :has() tricks here combined with a rendering trick ๐Ÿค™ The tab control is a container using display: grid. You can use :has() to count the number of tabs in the container: .tabs:has(input:nth-of-type(3)) { --count: 3; } .tabs:has(input:nth-of-type(4)) { --count: 4; } Using the cascade, the last valid :has() gives you the number of tabs ๐Ÿซถ Once you know the number of tabs, you know how to size the indicator: .tabs::after { content: ""; position: absolute; height: 100%; width: calc(100% / var(--count)); } It's a pseudoelement that uses --count to determine its size ๐Ÿ“ The next :has() trick is determining which tab is active or :checked as it's an input [type=radio] .tabs:has(:checked:nth-of-type(2)) { --active: 1; } .tabs:has(:checked:nth-of-type(3)) { --active: 2; } You can use a zero-indexed translation here. If the second input is :checked, set --active: 1, then translate the pseudoelement on the tabs to that position ๐Ÿ‘‰ .tabs::after { translate: calc(var(--active, 0) * 100%) 0; } The last rendering trick is using mix-blend-mode ๐Ÿ‘€ The tabs have a black background-color, the pseudoelement is white, and the label text is white. When you use mix-blend-mode: difference on the pseudoelement it will give this effect that the text transitions from white to black sliding across ๐Ÿ˜Ž .tabs::after { color: hsl(0 0% 100%); mix-blend-mode: difference; } You can totally mix up the colors here though and go with a different effect. The mechanics of how you can use CSS :has() is the main point here ๐Ÿ™ As always, any questions, suggestions, etc. let me know CodePen.IO link below! ๐Ÿ‘‡ (There's even a Tailwind CSS play for this one too ๐Ÿ‘€)

jhey ส•โ€ขแดฅโ€ขส”

437,714 Aufrufe โ€ข vor 2 Jahren