How to use hooks in Stylus?

111 views Asked by At

I would like to make hooking in Stylus by using mixin like it does in LESS. It seems like Stylus can't make @extend .className before .className is defined, but LESS does.

For example. By LESS logic It may look like

    .uk-button {
        display: inline-block;
        border 1px solid #00f;
    }

    .hook-button() {}

    .hook-button() {
        border 1px solid #00a;
    }

but by Stylus logic It must be

hook-button()    
  .hook-button
    {block}

+hook-button()
  border 1px solid #00f

.uk-button
  display inline-block
  border 1px solid #00a
  @extend .hook-button

Is there any way to place hook after @extend in Stylus?

upd: The main problem is that override goes before wanted class. You could try online LESS and Stylus.

0

There are 0 answers