det.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon Server des Unterhaltungsfernsehen Ehrenfeld zum dezentralen Diskurs.

Administered by:

Server stats:

2.1K
active users

#csslayout

0 posts0 participants0 posts today

#cssWish That we could have a zero count for the number of columns in `repeat()`.

That repeat count is often computed. Let's say I want double the width for selected column k out of n columns:

```
repeat(var(--k), var(--w))
calc(2*var(--w)
repeat(calc(var(--n) - var(--k) - 1), var(--w))
```

#CSS#code#coding

Flexy flex layout for any number n of items such that we have:

👉 at most 3 items on a row
👉 at least 2 items on a row IF we have at least 2 items in total

In only 5 (display, flex-wrap, gap, flex and flex-basis override) CSS declarations, working for any number n of items! 🎇

Because someone asked for this on reddit reddit.com/r/css/comments/1jay

Here is the @codepen demo codepen.io/thebabydino/pen/OPJ

#CSS#flexbox#layout

Someone asked (yet again) on reddit for that inverted radius tab pattern so here's a pure #CSS solution from me reddit.com/r/css/comments/1ior

✨ no extra elements or pseudos needed for effect
✨ only need to set border, background, border-radius

If you also want borders, I made another (hopefully accessible) tabs pattern demo using #SVG #filter and #subgrid to answer another reddit question last year reddit.com/r/css/comments/1fwl

#tinyCSStip if you want to make an absolutely positioned pseudo cover its parent's entire `padding-box`, use `inset: 0`!

(love grid for stacking/ full coverage too, but there are differences between how the two solutions work and there are cases when absolute positioning is still preferable)

#CSS#code#coding