this post was submitted on 08 Jan 2025
53 points (100.0% liked)

Programming

426 readers
2 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
top 12 comments
sorted by: hot top controversial new old
[–] unmagical@lemmy.ml 12 points 1 month ago (1 children)

I, uh, hate that radius calculation. Why does the radius need to be reactive? What do you stand to gain over just setting to like 3 or 4px and moving on with your life?

[–] pcouy@lemmy.pierre-couy.fr 2 points 1 month ago (1 children)

I'm not sure how this relates to the shared post. I'm just searched the article for "radius" and only found one example where a variable is defined then used later. Were you talking about this ? Or can you clarify what "radius calculation" you hate ?

[–] lucas@startrek.website 4 points 1 month ago* (last edited 1 month ago) (1 children)

They're referring (I believe) to the screenshot right at the top of the article, which includes this absurd calculation:

border-radius: max (0px, min(8px, calc( (100vw - 4px - 100%) * 9999)) );

My guess (hope!) is that this is not 'serious' code, but padding for the sake of a screenshot to demonstrate that it's possible to use each of these different features (not that you should!).

[–] pcouy@lemmy.pierre-couy.fr 1 points 1 month ago

border-radius: max(0px, min(8px, calc( (100vw - 4px - 100%) * 9999)) );

Oh I missed this. I think it's only here to showcase doing math between different units, which is really nice in my opinion. I'm thinking about a few instances where I had to resort to dirty JS hacks just because CSS did not support this at the time

[–] frezik@midwest.social 8 points 1 month ago (2 children)

I like that css now has variables, but why that syntax?

[–] GammaGames 5 points 1 month ago (1 children)

I think to make sure they don’t clash with existing identifiers

[–] frezik@midwest.social 23 points 1 month ago

I could understand declaring with --foo, but then referencing should be either var(foo) or just --foo, not the combination var(--foo). I don't get why the grammar has to work that way.

load more comments (1 replies)
[–] Paradox@lemdro.id 6 points 1 month ago

I still reach for sass for a lot of things, but now you don't have to, which is really nice

[–] Cratermaker@discuss.tchncs.de 6 points 1 month ago

Good riddance, I say. Web dev is infested with layers upon layers of tools that attempt to abstract what is already fairly simple and straightforward to work with. We're beyond the days of needing to build buttons out of small image fragments, and JS is (slowly) becoming more livable in its raw form. I welcome anything that keeps the toolchain as simple as possible.

[–] cupcakezealot@lemmy.blahaj.zone 4 points 1 month ago

still can't do mixins and extends though. :(

[–] joachim@drupal.community 0 points 1 month ago (1 children)
[–] pcouy@lemmy.pierre-couy.fr 2 points 1 month ago

It seems to be working for me, it's weird. I've updated the post with the same URL anyway, and you can try https://scribe.bus-hit.me/@karstenbiedermann/goodbye-sass-welcome-back-native-css-b3beb096d2b4 if that still does not work