Can't believe this quick little thing made this week's @codepen Spark!
codepen.io/thebabydino/pen/GgRryoa
Can't believe this quick little thing made this week's @codepen Spark!
codepen.io/thebabydino/pen/GgRryoa
Minimal pure #CSS textile patterns on @codepen https://codepen.io/thebabydino/full/OJmpzya
Absolutely no images other than CSS gradients and they are all tiny! All of them are under 500 bytes minified, some of them well under!
Because someone just hearted this decade old @codepen.io #3D demo, I gave it a quick 2025 remake using modern #CSS features
- grid instead of `position: absolute`, CSS variables to avoid setting multiple properties in Sass loops, `color-mix()` and more!
https://codepen.io/thebabydino/pen/NNxMaN
Based on a GIF by @sasj, originally CSS-ed 9+ years ago live on CodePen in 10 minutes and 50 lines of SCSS. Now the code is even more compact.
Another little @codepen demo: pure #CSS double ball helix https://codepen.io/thebabydino/pen/JreoKw
(yet another demo that cold be simplified by the `position: absolute` to `display: grid` switch for stacking and in the future, further simplified by `sibling-index()`)
For example, nowadays I wouldn't use `position: absolute` + offsets + negative `margin` to stack and place elements in the middle before applying transforms to position them in 3D.
I would use grid now.
Someone hearted this old thing https://codepen.io/thebabydino/pen/GNYvbZ on @codepen and I noticed it said Chrome-only - tested and it's not the case anymore, it works cross-browser.
Do note that it's 8+ years old, before #CSS variables, grid, newer functions and could be much simplified using these.
Some single `button` sets I made on @codepen a while back:
https://codepen.io/thebabydino/pen/dLLxdj
https://codepen.io/thebabydino/pen/QBOKPy
If we have an inline `span` inside a `p` & we give it a semi-transparent `background` + a `padding`, we get an alpha increase where backgrounds of adjacent lines overlap.
How would you solve this problem without text duplication, without stacking 2 identical `p` elements, one for background (opaque background + transparent text + opacity) and one for text (transparent background)?
Hi, mastodon I have a new article out!
A Deep Dive into the Inline Background Overlap Problem: https://frontendmasters.com/blog/overlapping-inline-backgrounds/
How do you get the below result (semi-transparent background on inline span) with large padding & no overlap?
Answer in article, but think a bit about it first.
Ever wanted to get the number of auto-fit columns in CSS?
```
--u: 5em;
grid-template-columns: repeat(auto-fit, minmax(var(--u), 1fr))
```
It's now possible! Using registered #CSS vars, the tan division hack and container query units! Here's a little test on @codepen:
https://codepen.io/thebabydino/pen/JojpBJr
Because I saw a @codepen demo creating a hex grid using my well over a decade old nested and reverted transforms technique to get the shape + MQs...
Here's a super simple modern #CSS grid + clip-path + mathematical functions responsive version with no breakpoints https://codepen.io/thebabydino/pen/QwWQqeR
@pygy I’d like to hide implementation details, so I’d do: https://www.typescriptlang.org/play/?#code/JYOwLgpgTgZghgYwgAgJIgVCBbC4D2UyA3gFDLKgIAUAlAFzIBu+wAJqQL6kwCuGYYPhDJMEOJHRjcBKACZqCXlCzhkAXmQAGBmgxYZYQiXLIsYZSLIUKVOiZs2lKvGADUbgNymKnADSm3NxAA
(Looking at the code right now, I realize that I should change the interface because with only .inc():void there is no way to retrieve the current counter. But that doesn’t change the basic challenge.)
"we find that participants who had access to an #AI assistant based on #OpenAI's codex-davinci-002 model wrote significantly less secure code than those without access. Additionally, participants with access to an AI assistant were more likely to believe they wrote #secure #code than those without access to the AI assistant. "
@rauschma Use a proper class instead of fumbling objects and be done.
Whether you then still want to have the factory method instead of just calling the constructor is up to you.
@dotproto Alternative: only `as any` at the end of the `return`.
But there is one significant downside: `this` now has the type `any` (line A): https://www.typescriptlang.org/play/?#code/JYOwLgpgTgZghgYwgAgJIgVCBbC4D2UyA3gFDLKgIAUAlAFzIBu+wAJqQL6kwCuGYYPhDJMEOJHRjcBKACZqAZzBwoYZAF5kABgZoMWGWEIlyyLGF5QRZChQT5+kKI2WqwAGjMUqdU3bswAAtgRQA6BydoAGpogG5vQJDw4NCABXwAB2gwAE8AEXwIRQA5fDAAUQAPULBYuOQAekbkagBBWkTOLwpOZDhFfpBchM4gA
Because this quick @codepen thing I made is getting hearted for some reason... corner grid item with inner corner rounding and text wrapping around the corner
https://codepen.io/thebabydino/pen/LEYObpy
Some grid + shape-outside + container query units #CSS magic + #SVG #filter magic.
¯\_(ツ)_/¯
Safari supports the `filter()` function, which allows us to apply a filter to just the `border-image-source`. It's not ideal, as we still need to have the image link twice, once in the `src` attribute and once in a custom property set on the same `img`. Oh, well... at least it doesn't require any extra elements, just the `img` suffices.
@codepen demo, but remember, it only works in Safari https://codepen.io/thebabydino/pen/XWxdyro
Made this a couple of years ago on @codepen but for some reason never shared it: a hopefully accessible base for a smooth elastic dropdown https://codepen.io/thebabydino/pen/qBJENKM
Based on a thing at a now dead link which did something of the kind with a huge div soup.
Someone hearted this button ripple effect demo on @codepen (coded about half a decade ago) and made me notice it still said "only works in Chromium" - as of last summer, it's cross-browser!