Skip to content

Mixin delegates #2331

Closed
Closed
@kreopt

Description

@kreopt

Not sure if this feature is not implemented, but i don't find the way to do this and issues creaded earlier.

I'd like to write some generic mixins taking other mixins as parameters such this:

.clickable(@hoverEffect, @activeEffect){
   &:hover{.@{hoverEffect}();}
   &:active{.@{activeEffect}();}
}

.active_delegate(){background:#aaa;/* something more complicated here...*/}
.hover_delegate(){background:#ddd;/*...*/}
.active_delegate--dark(){background:#666;/*...*/}
.hover_delegate--dark(){background:#333;/*...*/}

.button{
  background: #fff;
  .clickable(hover_delegate, active_delegate);
}

.button--dark{
  background:#000;
  .clickable(hover_delegate--dark, active_delegate--dark);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions