enb / enb-stylus

Stylus related techs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

expression with variable, given via mixin failed

a-x- opened this issue · comments

We use enb-stylus 1.2.3 (stylus 0.52)
If i run simple stylus: node_modules/enb-stylus/node_modules/stylus/bin/stylus
then all're right
but enb make failed.

code:

$gallary__item_size_default = 80px
$gallary__item_size_big = 100px
$root = '.gallery'
{$root}
    size($size)
        flex-basis: $size + 15px

        .carousel__list,
        .carousel__control
            height: $size + 5px

        {$root}__selection
            width: $size
            height: $size
            margin-left: -($size + 10px) / 2

        &__spinner
            line-height: ($size + 5px)

    size($gallery__item_size_default)

error:

   11|
   12|         {$root}__selection
   13|             width: $size
   14|             height: $size
   15|             margin-left: -($size + 10px) / 2
----------------------------------------------^
   16|
   17|         &__spinner
   18|             line-height: ($size + 5px)

TypeError: expected "undefined" to be a unit, but got ident:$gallery__item_size_default10px

i suppose that someone mutate my stylus before it'll be put into stylus processor

Hi! I think that this is problem of stylus.

I cloned project-stub, add test block with your code and run stylus:

./node_modules/enb-stylus/node_modules/stylus/bin/stylus common.blocks/test/test.styl

Got the same error:

/Users/blond/projects/project-stub/node_modules/enb-stylus/node_modules/stylus/bin/stylus:662
              throw err;
                    ^
Error: common.blocks/test/test.styl:15:40
   11|
   12|         {$root}__selection
   13|             width: $size
   14|             height: $size
   15|             margin-left: -($size + 10px) / 2
----------------------------------------------^
   16|
   17|         &__spinner
   18|             line-height: ($size + 5px)

TypeError: expected "undefined" to be a unit, but got ident:$gallery__item_size_default10px
    at ".gallery__selection" (common.blocks/test/test.styl:11:32)
    at size() (common.blocks/test/test.styl:6:15)
    at ".gallery" (common.blocks/test/test.styl:4:19)

Hi! Thank you! It's interesting...

i try run today this file just using stylus and got same with you result...

i not understand, what is chandged.

ok, i'll go to stylus issues :)