Skip to content

Feedback: the mix syntax is confusing to me #96

Description

@thislooksfun

The mix syntax is backwards from how I would have expected it to work. Maybe it's just me, which is why this is feedback rather than a bug, but when I read red | mix(color=base, amount=0.25) I would expect it to be 75% red and 25% base ("start with red, mix 0.25 of base in"), but it is actually the opposite (25% red, 75% base).

Might be too late to change it now, but I wanted to at least get my thoughts down that it was a bit confusing for me to use the first few times.

Activity

  1. backwardspy commented on Aug 30, 2025

    @backwardspy
    Member

    i agree, i always felt it was backwards too.

    we use css_colors for colour operations, which in turn is based on less.

    the mix parameter order is unfortunately also how less works:

    > mix(#000, #fff, 100%)
    #000000
    
    > mix(#000, #fff, 0%)
    #ffffff
    

    changing it now would break a number of ports, so if we do it at all i'd want to hold it back until whiskers v3.

  2. added this to the v3 milestone on Aug 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions