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

Part nested under an option prints all components hierarchy #43

Open
f-liva opened this issue May 19, 2015 · 1 comment
Open

Part nested under an option prints all components hierarchy #43

f-liva opened this issue May 19, 2015 · 1 comment

Comments

@f-liva
Copy link
Contributor

f-liva commented May 19, 2015

Given this markup

<div class="main">
    <div class="module --title-at-right">
        <div class="module__title">...</div>
    </div>
</div>

And that SCSS

@include component(main) {
    @include component(module) {

        // standard title stay at the left
        @include part(title) {
            float: left;
        }

        // if module has the --title-at-right option,
        // the title should stay at the right
        @include option(title-at-right) {
            @include part(title) {
                float: right;
            }
        }
    }
]

This compiled CSS outputs

.main .module_title {
    float: left;
}

.main .module.\--title-at-right .main .module__title {
    float: right;
}

But .main should not be nested under the .module component. The right result should be:

.main .module_title {
    float: left;
}

.main .module.\--title-at-right .module__title {
    float: right;
}

Nesting a part under a option should print only the first grade parent component, and not all hierarchy.

@f-liva
Copy link
Contributor Author

f-liva commented Jun 24, 2015

This is another case:

@include component(header) {
    @include option(stick) {
        @include component(addsearch) {
            @include part(button) {
                color: white;
            }
        }
    }
}

Given output:

.header.\--stick .addsearch .header__button {
    color: white;
}

Expected output:

.header.\--stick .addsearch__button {
    color: white;
}

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

1 participant