Cascading Style Sheets

Chris,
@Chris@mastodon.social avatar

I've got a #css question!

Using scroll-driven animations, if I wanted to take these shapes, how could I start them in this position (the dark ones) and transition them to the end position (the lightened ones).

Ideally, the shapes are a part of the three columns, and the animation would be sending them to their "real" position.

This seems like it would be somewhat easy if it didn't have to be responsive.

jensimmons,
@jensimmons@front-end.social avatar

Web developers and designers,

What are you hoping to see at WWDC next week??

jensimmons,
@jensimmons@front-end.social avatar
sia,
@sia@front-end.social avatar

@jensimmons performance metrics in Safari. We don't know what the performance bottlenecks are for at least 50% of Shopify mobile traffic so we can't optimize for it

mia,
@mia@front-end.social avatar

It was lovely meeting so many of you at ! I had a great time. Now off to Spain for CSSWG, and then running a layout workshop at the end of June.

(use the conference hashtag in allcaps for a 10% discount!)

https://www.youtube.com/watch?v=9EDOzJJdxWA

sonny, (edited )
@sonny@floss.social avatar

Checkout @alice update on GTK CSS :gtk: 💅

https://blogs.gnome.org/alicem/2024/06/07/css-happenings/

So many goodies 🤩

• variables
• color()
• color-mix()
• relative colors
• rgb, hsl, linear srgb, hwb, oklab, oklch, ...
• math functions
• accent colors

#GTK #CSS #GNOME

mobileatom,
@mobileatom@flipboard.com avatar
cr0ybot,
@cr0ybot@mastodon.social avatar

We lost so much when dropping Sass for PostCSS.

CSS built-in nesting is awkward, static variables can be useful actually, and what's the point of dropping a consistent API with good DX if we're still transforming our stylesheets anyways?

Chaining together interoperable PostCSS modules to accomplish half of what Sass can do is nearly impossible.

css,
@css@front-end.social avatar

Using modern CSS features to create a custom range slider with a tooltip. There is no JS to update the values, it's pure CSS with minimal HTML 😎

Powered by Scroll Driven animation, Anchor positioning, @​property and more! 🤩

Demo: https://codepen.io/t_afif/full/JjqNEbZ via :codepen: @codepen

Online Version: https://css-tip.com/range-slider-tooltip/

It's Chrome only for the tooltip but the range slider works fine in all the browsers.

#CSS #HTML

Showing two range slider with a tooltip containing the selected values. From the linked demo.

simevidas,
@simevidas@mastodon.social avatar

@css You wrapped the element in a <label>, but then you didn’t include a label. That doesn’t really make sense.

css,
@css@front-end.social avatar

The previous range slider was good but not good enough to me. Let's upgrade it with some motion!

Now the tooltip will follow your movement to get a more realistic effect. Still 100% CSS magic. No JS! 😎

Demo: https://codepen.io/t_afif/full/MWdmZPL via :codepen: @codepen

Showing two range sliders with tooltip. Overview from the linked demo

phryk,
@phryk@mastodon.social avatar
  • { box-sizing: border-box; }

Probably my most prejudiced hack. Judge if you want, but this one line saves me from an insane amount of alignment issues and overly complicated calc()s.

bingocaller,
@bingocaller@mastodon.social avatar

@phryk I don’t think this is particularly controversial? Paul Irish has been recommending it since *checks notes* 2012!? Damn, now I feel old. 👴

https://www.paulirish.com/2012/box-sizing-border-box-ftw/

phryk,
@phryk@mastodon.social avatar

@bingocaller I've been using it since essentially forever, too.

This is interesting because I've never seen anyone mention it in conversation around CSS… at the very least I'm glad I'm not the only one thinking that this makes things behave way more sensibly.

peterreeves,
@peterreeves@mstdn.social avatar

I don't understand why CSS is so verbose sometimes. Why couldn't I just do:
color: --brand-red;
???
Why do I need to surround every use of it with var(...)? Wasn't the double-dash prefix was specifically chosen to not clash with any existing or future properties?

It's always so frustrating writing CSS. Especially compared to all the structure, abstractions, and terseness that programming languages offer.

keithjgrant,
@keithjgrant@front-end.social avatar

@css @peterreeves I guarantee the w3c tried to find a way to do this without var(). If you really want to dive through old GitHub issues, it’s probably there (though this one might date back to the older mailing list).

I recall seeing discussion about using $ like Sass, but then deciding that would conflict with existing Sass code, so eventually they settled on the current approach.

mia,
@mia@front-end.social avatar

@keithjgrant @css @peterreeves And it's not only an implementation concern. We also tend to prioritize readability over terse writing, for the sake of authors.

We can create tooling to write the code faster as experts - but if it's hard to understand/maintain the code later, that's a much bigger issue.

Jbasoo,
@Jbasoo@mastodon.social avatar

I was kinda hoping calc-size() could resolve intrinsic sizes inside math functions but it doesn't seem to (at least in Chrome Canary). Not sure if that's a bug or if Friday afternoon isn't the best time to try to understand draft specs 🤯

I don't think it would be a common use case, but it would be handy to be able to use it to solve things like this https://mastodon.social/@Jbasoo/110593686096922129

noleli,
@noleli@mastodon.social avatar

@Jbasoo ooh! I hadn’t heard of calc-size(). Definitely relevant to some stuff I’m thinking about https://mastodon.social/@noleli/112535843863937418

kizu,
@kizu@front-end.social avatar

@Jbasoo It is possible! https://codepen.io/kizu/pen/vYwxyez

calc-size(max-content, round(up, size, var(--grid-size)))

The way it works: in the first argument is the intrinsic value you want to use, and in the second is the calculation that you intend to do with it, where a special size keyword becomes available as the “variable”.

tommi,
@tommi@pan.rent avatar

Hey @piccalilli!

I found https://buildexcellentwebsit.es extremely insightful and inspiring! It pushed me to finally completely restructure my personal website’s #CSS, after many years of mess.

I used the awesome https://utopia.fyi to generate the vars, (actually, I am using the SCSS library).

Unfortunately, though, I find the massive use of all those calc() and clamp() functions to be quite heavy in terms of performance… #Lighthouse gave the website a very bad performance score (see screenshot). It even seems that while scrolling the page it lags (😳) even if it’s super simple and built with pure #HTML and CSS!

Do you have any ideas or suggestions? 🤔

Thank you so much for all the interesting things you share! ❤️🚀

(The current unstable development version of my website is at https://dev.tommi.space/, I am using the homepage as reference)

Cc: @j98 + @trys

#WebDesign #WebDev #browser #BuildExcellentWebsites #PersonalWebsite #CSSGrid #PageSpeed

trys,
@trys@mastodon.social avatar
tommi,
@tommi@pan.rent avatar

Exactly what I was looking for!
Thanks again, @trys! Have a wonderful day.

matthiasott, (edited )
@matthiasott@mastodon.social avatar

My felon… I mean, my fellow web designers and front-end developers!

Do you use clamp() in production? 🤔

Kilian,
@Kilian@mastodon.social avatar

@matthiasott clamp is actually one of the newish things I started using very quickly (the others being variables and nesting) as opposed to thinks like layers, container queries and math functions, none of which I'm really using in production yet.

matthiasott,
@matthiasott@mastodon.social avatar

@Kilian Yes, same here! 😊

css,
@css@front-end.social avatar

🛑 STOP Scrolling!

It's time to learn something new in CSS. You are one click away from getting a cool demo. What are you waiting for?

👉 https://random.css-tip.com 👈

#CSS #HTML

jaandrle,
@jaandrle@fosstodon.org avatar

@css What about creating a mastodon bot like @randomMDN?

css, (edited )
@css@front-end.social avatar

@jaandrle
I prefer to manually share them because they don't have the same format and a random feature may break stuff.

mayank,
@mayank@front-end.social avatar

this is a @kizu appreciation post.

the more i play with cyclic toggles, the more i grow to love it. it's so fucking useful! https://kizu.dev/cyclic-toggles/

mia,
@mia@front-end.social avatar

Many teams are still using decade-old approaches and third-party tools for layout. That's not just extra work, but will leave you with less reliable results.

Join my new Cascading Layouts online workshop at the end of June!

https://www.youtube.com/watch?v=9EDOzJJdxWA

Registration is open https://www.oddbird.net/workshops/cascading-layouts/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • CSS
  • DreamBathrooms
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • GTA5RPClips
  • provamag3
  • ethstaker
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • tacticalgear
  • anitta
  • megavids
  • Leos
  • cisconetworking
  • JUstTest
  • lostlight
  • All magazines