Coffeekraken.io 0.0.1

s-component-selector

Return the css class selector for the current component setted by the [core/mixins/_s-component.scss] mixin and build with the passed arguments.

Name Type Description Status Default
$element { String } The element name of the class selector '&' if target the same element like &#{s-component-selector('&', null)} {} optional null
$modifier { String } The modifier name of the class selector optional null
$state { String } The state name of the class selector optional null

Return { String } The generated class selector

Example

    @incluse s-component('my-component') {
        // if settings.selector.method === 'BEM'
        s-component-selector('item') // => '.my-component__item'
        s-component-selector(null, 'red') // => '.my-component--red'
        s-component-selector('coco',null,'active') // => '.my-component__coco--active'
}

// if target the same element with & :
@include s-component('my-component') {
        #{s-component-selector(null, red, null, 'color')} {
            &#{s-component-selector('&', null, 'active')} {
                // something here...
            }
        }
}

Author : Olivier Bossel olivier.bossel@gmail.com