home.social

#csslayout — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #csslayout, aggregated by home.social.

fetched live
  1. Rotate & scale card on containing item `:hover` as all other items fade out behind. Using the pure #CSS magic 🪄 of `:has()`!

    Bonus: menu that moves where you click on rotated card, taking into account its transform (en.wikipedia.org/wiki/Transfor)

    Live on @codepen codepen.io/thebabydino/pen/JoE

    #Maths #geometry #cssTransforms #dev #web #code #webDev #coding #webDevelopment #frontend #cssGrid #cssLayout

  2. Ever wanted to have a grid with a row that grows with content, but only within certain limits & if it goes above that, the element within should just get a scrollbar?

    Think about it, how would you approach this?

    Here's a minimal markup and #CSS solution on @codepen

    codepen.io/thebabydino/pen/raj

    #cssLayout #cssGrid #code #coding #web #dev #webDev #webDevelopment #frontend

  3. My take on `box-sizing: border-box` reddit.com/r/css/comments/1tbl

    TL;DR unlearn adding it to the reset, as well as setting dimensions (width/ height) explicitly.

    👋 to @kevinpowell for giving me a video to link to 😀

    👋 to @mia for the cool article on `body` margin to reference 😎

    #CSS #code #coding #cssLayout #web #dev #webDev #webDevelopment

  4. So I saw a demo in the @codepen Spark and I liked the idea, but it was too JS-heavy for my taste, plus I would have preferred the rotation animations to be "hinged" around the top/ bottom edge depending on direction.

    So I did it with pure #CSS on scroll codepen.io/thebabydino/pen/JoK

    cc @bramus

    #cssScrollAnimation #scrollEffect #code #cssTransforms #cssTransform #css3D #3D #coding #frontend #cssLayout #web #dev #webDev #webDevelopment #cssGrid #cssFlex #flexbox #cssVariables #cssTransition

  5. The tiny details make the difference - check out those roundings in the cards demo!

    Even cooler: the shape depends on the size of the sibling it wraps around, no magic numbers. If we need the shape to grow (for ex if we want it to have more content), there's no need to change any clip-path or mask.

    #CSS #SVG #filter #svgFilter #cssSubgrid #cssLayout #cssGrid

  6. This is what I see browsers actually doing: what I want in my simple, no wrap use case.

    Slightly different things in the hypothetical case.

    Chrome, Firefox, Epiphany below.

    Also, please don't make fun of my browser themes. I'm a visual person, so I use themes that visually differentiate one browser from another.

    #CSS #cssGrid #cssLayout

  7. Wake up, wake up, wake up!

    If you're a Cheetah+ supporter on Ko-fi or Patreon, then first of all thank you 🙏 and second, I've just published a massive post about an improved technique for flexible irregular shapes.

    ❇️ ko-fi.com/post/New-year-new-te

    ❇️ patreon.com/posts/new-year-new

    #CSS #SVG #filter #cssGrid #cssLayout #cssSubgrid #containerQueryUnits #code #container #svgFilter #coding #frontend #web #dev #webDev #webDevelopment

  8. Super simple 🦌 profile cards, content aligned with subgrid - all essential layout in just 6 #CSS declarations!

    Check it out on @codepen codepen.io/thebabydino/pen/gbM

    #cssLayout #cssGrid #cssSubgrid #code #web #dev #webDev #webDevelopment #coding #frontend

  9. Fit an integer number of columns of a certain minimum width within parent, overflow the rest - live on @codepen codepen.io/thebabydino/pen/EaP

    Details on technique in this public Ko-fi post ko-fi.com/Post/Fit-an-integer- - if this helps you in any way, please remember praise doesn't keep me afloat financially... but you can! And consider supporting my work by becoming a monthly supporter or with a one time tip.

    #CSS #grid #cssGrid #code #coding #web #dev #webDev #webDevelopment #frontend #cssLayout #layout

  10. Remake of an old, old @codepen animation with 2025 #CSS codepen.io/thebabydino/pen/jOZ

    Now using `conic-gradient()` + `mask` instead of an SVG segments ring image. CSS `grid` for layout. Container query units so ring sizes adapt to number of rings (passed to CSS via a var) & available space. And more, check it out! 🐱

    Original code preserved in Pen description for web history.

    #conicGradient #cssGradient #code #coding #frontend #cssGrid #cssLayout #web #dev #webDev #webDevelopment #containerQueries

  11. A little @codepen demo: resizable panels with draggable panel separators codepen.io/thebabydino/pen/gbP

    Hopefully at least more accessible than the alternatives. The description has info about my testing this thing.

    #CSS #a11y #cssLayout #JS #draggable #cssGrid #code #coding #frontend #web #dev #webDev #webDevelopment #cssVariables

  12. It's 2025 and here's a little @codepen demo illustrating the grid stacking concept: codepen.io/thebabydino/pen/RNa

    The base & hover image, the cart & fave button - all stacked up in the same grid cell on the 1st row. The images stretch to fill the grid cell, the buttons are in opposing corners. #CSS

    mastodon.social/@anatudor/1137

    #cssGrid #cssLayout #code #coding #web #dev #frontend #webDevelopment #webDev

  13. I have a new article out on Frontend Masters: Non-Square Image Blur Extensions frontendmasters.com/blog/non-s

    It details the how behind creating the base effect with a single `img` element and only 4 #CSS declarations, then... well, check the article, I promise you'll learn something new!

    #cssGrid #cssLayout #cssFunction #filter #cssFilter #SVG #svgFilter #code #coding #web #dev #webDevelopment #webDev #frontend #containerQueries

  14. 🚀 Wow, get ready to revolutionize your layouts with CSS Subgrid! 🎉 Because who doesn't want to juggle more grid syntax while praying for browser support? 🙄 Dive into the thrilling peril of 'nested grid numbers' and 'subgrid gotchas'—sounds like a fun Saturday night, right? 😂
    joshwcomeau.com/css/subgrid/ #CSSSubgrid #CSSLayout #WebDevelopment #BrowserSupport #GridDesign #HackerNews #ngated

  15. I am begging you, please don't split your heading into two separate `h2` elements with an `img` in between just to have the image in between your heading words.

    This is what subgrid was made for!

    #CSS #layout #cssLayout #code #coding #web #dev #webDev #webDevelopment

  16. Concave rounding header. Shape on the right depends on content on the left. Real transparency. Using #CSS subgrid and #SVG filters.

    Live demo on @codepen codepen.io/thebabydino/pen/mdN

    How would you do this? Try to think about it before checking my solution!

    #cssGrid #cssLayout #cssSubgrid #coding #svgFilter #filter #frontend #code #web #dev #webDev #webDevelopment

  17. I have a new article out!

    Super Simple Full-Bleed & Breakout Styles
    frontendmasters.com/blog/super - my take on an old problem using modern CSS solutions.

    Using a spooky made up Halloween recipe to illustrate concepts.

    PS @chriscoyier told me to be proud of it 😛

    #CSS #cssLayout #cssGrid #cssVariables #containerQueries #containerQuery #code #web #webDev #webDevelopment #dev #coding #frontend #Halloween

  18. Auch eine deutsche Version ist wie immer verfügbar: ich habe einen neuen Artikel verfasst! Er beschreibt, wie man ein CSS Grid erstellt, das ein klassisches mehrspaltiges Raster (z. B. 12 Spalten) mit Layout-Breakouts (Full Bleed) kombiniert.
    CodePen-Demos des finalen Layouts und zwei Vorversionen sind im Tutorial verlinkt.
    Ich freue mich sehr über Kritik!

    #frontend #css #cssGrid #gridLayout #cssLayout #webDev

    sebkln.de/tutorials/css-layout

  19. I wrote a new article! It explains how to create a CSS Grid that combines a classic multi-column grid (e.g. 12 columns) with Layout Breakouts (Full Bleed positioning). Allows for flexible alignment of grid items.
    CodePen demos for the final layout and two pre-versions are linked in the tutorial. Yes, there's a tl;dr. 😄
    I am very interested in your feedback!

    #frontend #css #cssGrid #gridLayout #cssLayout #webDev

    sebkln.de/en/tutorials/css-lay

  20. Real transparency behind text/ around scrollable image. Shape with both convex and concave roundings changes as the text reflows. No JS, text isn't split into a span per line.

    Can you figure out how to do this before checking out my solution? reddit.com/r/css/comments/1ojp

    Live on @codepen codepen.io/thebabydino/pen/wBM

    #CSS #concave #cssLayout #cssGrid #web #cssSubGrid #SVG #filter #svgFilter #code #coding #dev #webDevelopment #webDev #frontend

  21. There are n equally sized items arranged in half a circle on the left, from top to bottom, with the same gap g in between. How do you do it? Cross-browser, same #CSS (≤20 declarations) should work when changing their number/ gap.

    Try to code it yourself before checking my solution reddit.com/r/Frontend/comments

    Live on @codepen: codepen.io/thebabydino/pen/ZYQ

    #Maths #geometry #trigonometry #code #cssMaths #coding #frontend #cssLayout #webDev #webDevelopment #web #dev #cssGrid #cssTransform #cssVariables

Share on Mastodon

Enter the server where you have an account.