html - 如何为 HTML/CSS 使用“带有 BEM 的原子设计”方法?
问题描述
我刚开始使用原子设计方法来编写我的 HTML。我知道使用 BEM,但不知道将它与 Atomic 一起使用的最佳实践。诸如 , 等之类的东西element of an organism
往往element of a molecule
会modifier of an element of a molecule
造成一些混乱,并且不确定我是否正确使用了这些内容。有人可以解释一下。任何帮助表示赞赏
示例代码:
<div class="container cl-organism-learn">
<div class="row cl-molecule-learn-row cl-organism-learn__elem">
<div class="col-sm cl-atom-first cl-molecule-learn-row__elem cl-atom-first--background-blue">
One of three columns
</div>
<div class="col-sm cl-atom-second cl-molecule-learn-row__elem cl-atom-first--background-red">
Two of three columns
</div>
<div class="col-sm cl-atom-third cl-molecule-learn-row__elem cl-atom-first--background-yellow">
Three of three columns
</div>
</div>
</div>
解决方案
推荐阅读
- wordpress - WordPress中“按下购物按钮后”的钩子
- javascript - 在 ReactJs 中更新数组中的嵌套对象
- java - 在Java的主窗口上画线
- sql-server - 连接多个表会产生重复
- python - Gunicorn 20 未能在“索引”中找到应用程序对象“app.server”
- python - ValueError:检查目标时出错:预期 dot_1 的形状为 (1,),但得到的数组的形状为 (924,)
- bazel - cc_library deps 中的 c++ 代码生成规则?
- c# - 如何声明将等待另一个任务的未启动任务?
- angular - NgXs 动态选择器:TypeError:无法读取未定义的属性“x”
- python-3.x - Python 图像压缩