A solid naming convention makes it less likely to run into naming conflicts and helps establish a semantic pattern that is easier for a team to follow. In this lesson, I'm using a variation of the BEM (Block Element Model) naming convention. OOCSS and SMACSS offer similar methodologies. I also use the class attribute selector to target multiple modifier classes.

.todo-list {
list-style: none;
margin:;
padding:;
width: 100%;
order: -1;
display: flex;
flex-direction: column;
}
[class^="todo-list__item"] {
cursor: pointer;
height: 80px;
display: block;
text-transform: uppercase;
color: #af544f;
letter-spacing: 2px;
box-sizing: border-box;
padding: 27px 33px 0 78px;
box-shadow: 0 1px 0 0 #e6e6e6, 0 2px 0 0 white;
background-image: url('https://jsbin-user-assets.s3.amazonaws.com/GarthDB/box.svg');
background-repeat: no-repeat;
background-position: 28px 16px;
}
.todo-list__item--completed {
color: #16a085;
background-image: url('https://jsbin-user-assets.s3.amazonaws.com/GarthDB/done.svg')
}
const Todo = ({
onClick,
completed,
text
}) => (
<li
onClick={onClick}
className={
completed ?
"todo-list__item--completed" :
"todo-list__item--active"
}
>
{text}
</li>
);

最新文章

  1. WINDOWS窗口风格 WS_OVERLAPPEDWINDOW
  2. Kali Linux 秘籍/Web渗透秘籍/无线渗透入门
  3. Java开发之文件上传
  4. C#.NET 大型通用信息化系统集成快速开发平台 4.0 版本 - 用户权限树的实现 -- 权限递归树
  5. LeetCode&mdash;&mdash;Rotate Image(二维数组顺时针旋转90度)
  6. 3----lua的数据转换及运算符
  7. java新手笔记18 类比较
  8. 服务器是windows时tomcat无法打印所有日志配置修改
  9. webpack配置这一篇就够
  10. 关于CoordinatorLayout的用法——复杂交互的克星
  11. 26 python 初学(线程、同步锁、死锁和递归锁)
  12. 全局css控制&lt;td&gt;标签属性
  13. python获取机器信息脚本(网上寻找的)
  14. python学习笔记(5-1)-基本数据类型-字符串类型及操作
  15. Vue--路由
  16. MySQL DBA工作角色和职责介绍
  17. 计算属性和监听,computed,watch
  18. python中收集函数的解包问题
  19. 卸载Myeclipse10.5 报错“an error has occured.See the log file ...Uninstaller\...”
  20. 【POJ1187】陨石的秘密

热门文章

  1. dlopen 方式调用 Linux 的动态链接库
  2. 【翻译自mos文章】OGG的集成捕捉模式支持Oracle database标准版么?
  3. Android-CheckBox 实现计算器
  4. java中异常的限制
  5. 6.Windows 二进制文件 (.exe)安装--终端安装
  6. ubuntu14.04.32 vmware11开发环境搭建
  7. C# 中 int、Convert.ToInt32()、int.Parse()的区别
  8. Vue的学习--怎么在vue-cli中写网页
  9. BZOJ2733: [HNOI2012]永无乡(线段树合并)
  10. 【2017 Multi-University Training Contest - Team 9】Numbers