Back to Type Challenges

README

questions/03326-medium-bem-style-string/README.md

latest1.7 KB
Original Source
<!--info-header-start--><h1>BEM style string </h1><blockquote><p>by Songhn <a href="https://github.com/songhn233" target="_blank">@songhn233</a></p></blockquote><p><a href="https://tsch.js.org/3326/play" target="_blank"></a> </p><!--info-header-end-->

The Block, Element, Modifier methodology (BEM) is a popular naming convention for classes in CSS.

For example, the block component would be represented as btn, element that depends upon the block would be represented as btn__price, modifier that changes the style of the block would be represented as btn--big or btn__price--warning.

Implement BEM<B, E, M> which generate string union from these three parameters. Where B is a string literal, E and M are string arrays (can be empty).

<!--info-footer-start-->

<a href="../../README.md" target="_blank"></a> <a href="https://tsch.js.org/3326/answer" target="_blank"></a> <a href="https://tsch.js.org/3326/solutions" target="_blank"></a> <!--info-footer-end-->