Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't works mix, if elem has - #14

Open
maksimenka opened this issue Jul 18, 2017 · 4 comments
Open

Don't works mix, if elem has - #14

maksimenka opened this issue Jul 18, 2017 · 4 comments

Comments

@maksimenka
Copy link

maksimenka commented Jul 18, 2017

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 maksimenka changed the title Don Don't work mix, if elem has - Jul 18, 2017
@maksimenka maksimenka changed the title Don't work mix, if elem has - Don't works mix, if elem has - Jul 18, 2017
maxpoletaev added a commit that referenced this issue Jul 18, 2017
@maxpoletaev
Copy link
Owner

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?

@maksimenka
Copy link
Author

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
Copy link
Author

maksimenka commented Jul 19, 2017

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
Copy link
Author

One more example

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

result:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants