node-beml icon indicating copy to clipboard operation
node-beml copied to clipboard

Don't works mix, if elem has -

Open maksimenka opened this issue 7 years ago • 4 comments

Example of not working code: th(elem="head-cell", mix="block:table, elem:head-cell")

This code works well: th(elem="head-cell", mix="block:table, elem:head")

maksimenka avatar Jul 18 '17 17:07 maksimenka

Hello! I checked your case and also added test for it. Looks like dash in the mix element name works fine and problem is not here. Can you provide full block of code where this problem occurs?

maxpoletaev avatar Jul 18 '17 19:07 maxpoletaev

All is ok, maybe this my mistake, sorry. But i has one more problem, if i use this code: table(block="payment-table", mix="{block:table}, {block:table, mod:{theme:material}}") I want to receive: <table class="payment-table table table_theme_material"> But I get: <table class="payment-table table_theme_material">

maksimenka avatar Jul 19 '17 07:07 maksimenka

About the first problem, here is an example that works incorrectly (Code written in pug syntax)

table(block="payment-table", mix="block:table, mod:{theme:material}")
    thead(elem="head", mix="block:table, elem:head")
        tr(elem="head-row", mix="block:table, elem:head-row")
            th(elem="head-cell", mix="block:table, elem:head-cell")

result:

<table class="payment-table table_theme_material">
    <thead class="payment-table__head">
        <tr class="payment-table__head-row">
            <th class="payment-table__head-cell"></th>
        </tr>
    </thead>
</table>

About symbol -

table(block="payment-table", mix="block:table, mod:{theme:material}")
    thead(elem="head", mix="block:table, elem:head")
        tr(elem="head-row", mix="block:table, elem:headrow")
            th(elem="head-cell", mix="block:table, elem:headcell")

Result

<table class="payment-table table_theme_material">
    // in this line, mixin dont accepted
    <thead class="payment-table__head">
        <tr class="payment-table__head-row table__headrow">
            <th class="payment-table__head-cell table__headcell"></th>
        </tr>
    </thead>
</table>

maksimenka avatar Jul 19 '17 13:07 maksimenka

One more example

div(block="test")
    div(elem="card", mix="block:card")

result:

<div class="test">
    <div class="test__card"></div>
</div>

maksimenka avatar Jul 20 '17 09:07 maksimenka