Discussion
Loading...

Discussion

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
ppk 🇪🇺
ppk 🇪🇺
@ppk@front-end.social  ·  activity timestamp 5 hours ago

Please name your favourite I-used-to-do-this-with-JavaScript-but-now-I-don't-need-to CSS properties/functionalities.

  • Copy link
  • Flag this post
  • Block
Doug Webb
Doug Webb
@douginamug@mastodon.xyz replied  ·  activity timestamp 3 hours ago

@ppk coming up: field-sizing https://caniuse.com/?search=field-sizing

"The field-sizing CSS property allows form controls such as <textarea> to be sized based on their content."

Right now auto-growing an input box with the content inside it requires some artful CSS layering and a sprinkle of JS

https://css-tricks.com/the-cleanest-trick-for-autogrowing-textareas/

  • Copy link
  • Flag this comment
  • Block
meduz'
meduz'
@meduz@m.nintendojo.fr replied  ·  activity timestamp 3 hours ago

@ppk dialog and popover stuff: way less JS needed

  • Copy link
  • Flag this comment
  • Block
Eric Eggert
Eric Eggert
@yatil@yatil.social replied  ·  activity timestamp 3 hours ago

@ppk View transitions between different server-rendered pages. It sometimes means you can do stuff that looks like JavaScript on the server altogether, which makes everything better.

  • Copy link
  • Flag this comment
  • Block
Trygve Lie
Trygve Lie
@trygve_lie@mastodon.social replied  ·  activity timestamp 4 hours ago

@ppk Scroll Snap. Mostly eliminated the need for js when building carousels.

  • Copy link
  • Flag this comment
  • Block
Søren Birkemeyer
Søren Birkemeyer
@polarbirke@indieweb.social replied  ·  activity timestamp 4 hours ago

@ppk Uh, favourites… there are so many.

position: sticky;
:has() and other pseudos
animations (even scroll-based)
color functions, especially relative colors
all kinds of math functions
view transitions
CSS Grid, obviously

  • Copy link
  • Flag this comment
  • Block
ppk 🇪🇺
ppk 🇪🇺
@ppk@front-end.social replied  ·  activity timestamp 3 hours ago

@polarbirke Why grid? What JS does it replace?

  • Copy link
  • Flag this comment
  • Block
ian
ian
@finitebaffle@mas.to replied  ·  activity timestamp 4 hours ago

@ppk so much! Not a favourite like you asked, apologies, but you got me reminiscing that I *think* it all started with anything that :hover gives us, eg rollovers

  • Copy link
  • Flag this comment
  • Block
Philipp Tootloff
Philipp Tootloff
@kleinfreund@mastodon.social replied  ·  activity timestamp 5 hours ago

@ppk Focus styles for more complex components previously sometimes required setting some classes or similar on strategic elements so you can use them selectors. Now, with :has(), that's generally not needed anymore.

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.7 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct