home.social

#cssvariables — Public Fediverse posts

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

fetched live
  1. 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

  2. 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

  3. 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

  4. #cssChallenge2025
    How would you do this? A gradient tinted image, the gradient tint gradually disappearing from left to right on hover, then coming back from left to right on exit.

    ✨ single `img` elem (so no pseudos)
    ✳️ cross-browser
    🚫 no JS
    🚫 no SVG filter

    #CSS #cssGradient #cssVariables #code #web #dev #webDevelopment #webDev #frontend #coding #cssMaths

  5. 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

  6. For all Ko-fi/ Patreon supporters...

    First off, thank you for supporting my work and helping me stay afloat!

    And second, something new dropped today...

    ko-fi.com/post/Blobby-reveal-o

    patreon.com/posts/blobby-revea

    PS: hope you like SVG filters because there's more cooking/ coming soon. Next thing *very* soon because it's functional (even if not pretty yet) & dying to share it.

    #SVG #filter #CSS #svgFilter #coding #code #frontend #cssGradient #web #dev #webDevelopment #cssVariables #webDev #cssMaths

  7. そしてこうなってくると、#Tailwind はもう #CSSVariables だけでいいんじゃない?という気持ちにもなって、だったら #OpenProps のほうが使いやすいんだよなーという気持ちがある

    Open Props: sub-atomic styles
    open-props.style/

  8. It's definitely not perfect but I made a thing! It's a shiny card effect 🎴 with 3d perspective, done in mostly-pure CSS with a bit of Javascript for cursor positions etc.

    📱 Doesn't work very well on mobile at the moment though - it's on my todo list.

    In other news, CSS container queries are both fun, useful, and confusing. 📦📦📦

    starbeamrainbowlabs.com/labs/s

    #HowDoITag #IDontEvenKnowIJustPostHere #Noodling #WebNoodling #NoodlingAround #CSS #CssVariables #WereUsed #AndAbused #CSS3D

  9. So what else could we do? Use an SVG filter!✨

    Set the #CSS gradient as one with two end stops and no steps and apply a super simple #SVG #filter (same idea as here mastodon.social/@anatudor/1147 ) that makes it stepped.

    Works for all gradient types - see this @codepen demo codepen.io/thebabydino/pen/raV 😼

    #cssGradient #code #coding #frontend #web #dev #webDevelopment #webDev #svgFilter #cssVariables

  10. Using CSS variables solves both these problems, but we cannot use #CSS variables inside the #Sass `mix()` function, we have to use the CSS `color-mix()`. This means the compiled output looks way uglier.

    You can check it out in this @codepen demo codepen.io/thebabydino/pres/bN

    #cssGradient #code #coding #frontend #web #dev #webDev #webDevelopment #cssVariables

  11. Naty S @eclecticpassions ·

    As a amateur, I've always just hard coded my colours the traditional way. While working on a light and dark theme switcher on my Hugo blog, I learnt the proper way to do it using the var() function and defining a css variables, e.g. `var(--light-blue)`. I can easily and happily change colours in my theme in the future!

    Plus, I get to clean up my custom.css file which got ugly quick from all the random customizations I've been making.

  12. I turn 13 on @codepen in June, so here are my 13 most hearted demos:

    1️⃣ 1092 ♥️ #CSS infinite #scroll gallery codepen.io/thebabydino/pen/XJr - my only demo to ever get to 1K ♥️ without being in most hearted of the year first

    mostly CSS scroll-driven animations + tiniest bit of JS (~200 bytes for infinity part)

    #cssVariables #cssTransforms #coding #code #frontend #cssTransform #3D #web #webDev #webDevelopment #dev #maths #mathematics #geometry #filter

  13. Because someone asked for this on reddit: an image that shows when hovering a nav item, under that nav item, but above all others and follows the pointer motion reddit.com/r/css/comments/1kgp

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

    Uses a tiny bit of #JS until we can get the pointer position in pure #CSS - see this proposal by @bramus github.com/w3c/csswg-drafts/is

    #code #coding #frontend #cssVariables #web #dev #webDevelopment #webDev

  14. #CSSVariables をはじめ #CSS まわりの最近の進化はほんともっと注目されてよいと思っている。

    #CSS ってなんか最近のフロントエンドでも「低レイヤーの話」みたいになっちゃってて、目新しいフレームワークっぽいシャレた名前もない「 #CSS の新機能!」っていっても、なんかいまいち盛り上がりきらない感があるような気がするんだけど、 #CSS はいま素で書くだけでもすごい強力になってきている(むしろフレームワークに寄らずに素の CSS 書きたい気持ちすらある

  15. #Misskey :misskey: の中の人が #CssVariables とか #RelativeColorSyntax について書いてくれてとても俺得な記事だった :amaze:
    最近はここに #oklch 関数も組み込めるので、さらに進化が進んでいる…

    CSS Variablesはここまで進化した
    gihyo.jp/article/2025/04/missk

  16. A fun little scroll-driven thing I made. The text is white over the image, but the image isn't static, it rotates on scroll. 😼

    Here's a detailed explanation of the how behind reddit.com/r/css/comments/1jyu

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

    Also uses container queries, CSS trigonometric functions.

    #CSS #scroll #cssAnimation #code #web #scrollAnimation #frontend #coding #dev #cssVariables #cssTransform #webDev #webDevelopment #cssMaths #trigonometry

  17. * 🎨 明度・彩度・色相もそれぞれ変数化できる #CssVariables
    * 🧮 特定の色を相対的に変化可能な #RelativeColorSyntax
    * 🌈 色をより人間の知覚に近い形で扱える #oklch

    このあたりは、現存するどのデザインツールよりも、現在のブラウザーで使える #CSS の機能のほうが柔軟で拡張性が高い。

    …あれ、ということはやっぱり最強のデザインツールは #CSS なのでは :vivaldia_1:

  18. Flip card on hover, flip back on hover out...

    ... but on touchscreens, flip it on click and then flip it back on second click!

    A mostly #CSS solution, using #3D transforms, variables, grid, pointer MQ + a little bit of #JS.

    Because somebody asked how to do it reddit.com/r/css/comments/1jm0

    Live demo on @codepen: codepen.io/thebabydino/pen/MYW

    #cssGrid #cssVariables #JavaScript #css3D #code #coding #frontend #cssLayout #web #dev #webDevelopment #webDev

  19. 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 codepen.io/thebabydino/pen/QwW

    #cssLayout #cssGrid #clipPath #hexagon #cssMaths #containerQueryUnits #code #cssVariables #coding #frontend #webDev #web #dev #webDevelopment

  20. No JS #fluid animation. The animation is created in #CSS, where I'm animating the values of two custom properties back and forth. `feTurbulence` creates the background, `feDisplacement` map uses the CSS-animated input to make it move.

    My take on this question reddit.com/r/webdev/comments/1

    #SVG #svgFilter #filter #cssGradient #code #web #dev #webDev #webDevelopment #coding #frontend #cssVariables

  21. My most popular demo of 2024. By far. My second most hearted @codepen demo ever.

    codepen.io/thebabydino/pen/WNV

    Pure #CSS, single div, very little code overall; and that's even including layout, prettifying & animation styles. Oh, heavily commented too.

    #code #coding #frontend #cssVariables #web #dv #webDev #webDevelopment #cssGradient #filter #cssFilter #glow

  22. I haven't used style queries much, but just gave them a spin and got an idea (that I've just tested & works) about how we can have ranges in style queries right now. 🥳

    That is, red background if --k <= 20, orange background if 20 < --k <= 40 and so on...

    #CSS #styleQueries #cssVariables #code #coding #frontend #containerQueries #web #dev #webDev #webDevelopment

  23. Here's a little thing I made for the 1st #CodePenChallenge of '25: pure #CSS tilt & zoom grid on scroll!

    Check it out on @codepen

    codepen.io/thebabydino/pen/jEN

    Using pure CSS scroll driven animations, grid, variables, mathematical functions, container query units. Also uses an SVG filter for the dissolve effect.

    Chromium only.

    #scroll #scrollAnimation #cssVariables #cssGrid #cssLayout #cssMaths #containerQueryUnits #svgFilter #SVG #filter #code #coding #frontend #webDev #webDEvelopment #web #dev