home.social

#mixin — Public Fediverse posts

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

  1. I can't quite convince myself yet that all inheritance/coupling is intrinsically bad, but I'm more and more recognising abstract base classes (ABCs) and classes as anti-patterns because they hinder , which to me is key to quality software; and mixins are by construction impossible to test on their own, and both patterns only make sense if a language supports inheritance, so it seems that the simplest option to avoid them is to get rid of inheritance altogether.

  2. Ever want a pure CSS regular #polygon?

    Back in 2016, I first wrote this #Sass #mixin to generate one. I've had others before, but this is the one I've kept updating it ever since and it's heavily commented.

    You just need to pass it a number of vertices and an initial rotation.

    @codepen demo: codepen.io/thebabydino/pen/mEg

    #CSS #clipPath #geometry #2D #code #coding #frontend #web #dev #wbDev #webDevelopment

  3. Re x.com/meodai/status/1800098657

    If you ever want to create a regular/ star-shaped #polygon, I made a #Sass #mixin that generates them years ago
    codepen.io/thebabydino/pen/PRM

    A heavily commented & more modern version of the regular poly mixin codepen.io/thebabydino/pen/mEg

    Bonus: chubby stars mixin codepen.io/thebabydino/pen/KLy

    Example of a @codepen demo using such a regular polygon mixin to create three rolling hexagons: codepen.io/thebabydino/pen/LYz

    #CSS #geometry #maths #trigonometry #code #coding #clipPath #frontend