I have component button
<button type="button" className="button button_size_large button_color_primary button_type_fill">
<Icon className="button__icon" type={'bc-icon-info'} disabled={false} isFilled={true} />
<span className="button__text">Button</span>
</button>
each of modifiers changes
- button_color_primary
- button_type_fill
- button_type_outline
- button_type_text
- button_color_secondary
- button_type_fill
- button_type_outline
- button_type_text
- button_color_danger
- button_type_fill
- button_type_outline
- button_type_text
and so on ...
In scss i have created this
&_color_primary {
&.button_type_fill {
&:hover {}
&:focus {}
&:active {}
&:disabled {}
.button__text { }
.button__icon { }
}
&.button_type_outline {
&:hover {}
&:focus {}
&:active {}
&:disabled {}
.button__text { }
.button__icon { }
}
&.button_type_text {
&:hover {}
&:focus {}
&:active {}
&:disabled {}
.button__text { }
.button__icon { }
}
}
And this way for _secondary , _danger. I think this is not good approach. Please provide your suggestions .