hhmx.de

Föderation EN Di 25.06.2024 19:23:50

We have a new CSS module

drafts.csswg.org/css-mixins/

Medien: 1

Föderation EN Di 25.06.2024 20:02:32

@simevidas YESSS πŸ“―βœ¨

Föderation EN Di 25.06.2024 20:42:51

@simevidas Whoa! Much hype 🀩

Föderation EN Di 25.06.2024 20:45:46

@simevidas Oh wow, this is great. When I first asked for custom functions in , I suggested a JS-based function body, similar to the Paint API. And since we still don't have widespread support for paint functions, no surprise that never happened.

But: it was worth the wait! Now we have so many math and colour primitives in CSS itself (and soon if-else 🀞) that we can define reusable functions fully in CSS. I really like the nested media queries option!

(The @-nest bits confused me, though.)

Föderation EN Mi 26.06.2024 07:06:11

@AmeliaBR @simevidas yeah the nest bit is a relic of a previous potential interaction that isn't needed. That'll get removed.

Föderation EN Mi 26.06.2024 00:14:26

@simevidas This seems to be only functions? And only returning single string values?

This isn't wnat I expect from "mixins".

I expect this from mixins:

```
@mixin bob {
prop: val;
otherProp: other val;
}

.thing {
@mixin bob;
...
}
```

e.g.,

Define heading styles, and include them where needed.

WITHOUT:

- code repetition
- a massive selector list divorced from context
- relying on naked heading levels
- relying on utility classes

Functions I never use in SCSS. ^ that I do. A lot.

Föderation EN Mi 26.06.2024 00:29:18

@MattWilcox @simevidas To clarify:

- This is only the first commit to an early Editor's Draft spec that will eventually include both mixins and functions.

- The `type(<string>)` bit means that the type function *accepts a string argument* which defines the return type. Not that the return type can only be single string values.

Föderation EN Mi 26.06.2024 00:32:58

@mia @MattWilcox@mastodon.social @simevidas Thank you! Thats the vital context I’d missed and didn’t grok from the link :)

Föderation EN Mi 26.06.2024 12:19:59

@mattwilcox@mstdn.social @mia @MattWilcox@mastodon.social @simevidas Initial commit, not final spec (not even first public working draft).

Also, from a load-balancing and burnout prevention angle, good to see another NJT&F spec (Not Just Tab & Fantasai).

Föderation EN Mi 26.06.2024 12:58:35

@svgeesus Yeah, good to see. Once upon a time I tried getting involved with this sort of stuff, but I was not cut out for it. I was in the HTML-WG and Responsive Images Community Group, and that's as far as I could take things before my irritation with process got the better of me. My respect to those who do the work we all benefit from. @mia @MattWilcox@mastodon.social @simevidas