CSS Architecture & CSS Design Patterns

BEM

Block, Element, Modifier

https://en.bem.info/methodology/quick-start/


OOCSS

Separate structure and skin(分离结构和主题)

Separate container and content(分离容器和内容)


SMACSS

Base(基础)

Layout(布局)

Modules(模块)

State(状态)

Theme(主题)


Enduring CSS

https://ecss.io/preface.html


React

  1. CSS Modules

  1. CSS in JS

  1. styled-components

demo

https://codepen.io/xgqfrms/pen/LYGeYGo?editors=0010

https://cdnjs.cloudflare.com/ajax/libs/styled-components/3.2.1/styled-components.js

https://styled-components.com/

import styled from 'styled-components';

const Button = styled.button``;

// This Button variable here is now a React component that you can use like any other React component!
const Button = styled.button`
background: transparent;
border-radius: 3px;
border: 2px solid palevioletred;
color: palevioletred;
margin: 0.5em 1em;
padding: 0.25em 1em;
${props => props.primary && css`
background: palevioletred;
color: white;
`}
`;
const Container = styled.div`
text-align: center;
`
render(
<Container>
<Button>Normal Button</Button>
<Button primary>Primary Button</Button>
</Container>
);

SCSS


CSS 3

  1. var

  1. themes/ skins (dark mode)


CSS 选择器的性能优化

CSS选择器从右到左匹配的机制,只要当前选择符的左边还有其他选择符,样式系统就会继续向左移动,直到找到和规则匹配的选择符,或不匹配而退出;

最右边选择符称为关键选择器



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


CSS Architecture & CSS Design Patterns的更多相关文章

  1. 纯css实现Material Design中的水滴动画按钮

    前言 大家平时应该经常见到这种特效,很炫酷不是吗 这是谷歌Material Design中最常见的特效了,市面上也有很多现成的js库,用来模拟这一特效.但是往往要引入一大堆js和css,其实在已有的项 ...

  2. CSS & Architecture

    CSS & Architecture https://sass-guidelin.es/#architecture https://sass-guidelin.es/#the-7-1-patt ...

  3. .NET Best Practices: Architecture & Design Patterns (5 Days Training)

    .NET Best Practices: Architecture & Design Patterns (5 Days Training) .NET最佳实践:架构及设计模式 5天培训课程 课程 ...

  4. Cloud Design Patterns & Architecture Styles

    Cloud Design Patterns Categories Data Management Design and Implementation Messaging Patterns Ambass ...

  5. Cloud Design Patterns: Prescriptive Architecture Guidance for Cloud Applications

    January 2014 Containing twenty-four design patterns and ten related guidance topics, this guide arti ...

  6. AMD - Learning JavaScript Design Patterns [Book] - O'Reilly

    AMD - Learning JavaScript Design Patterns [Book] - O'Reilly The overall goal for the Asynchronous Mo ...

  7. Design Patterns Simplified - Part 3 (Simple Factory)【设计模式简述--第三部分(简单工厂)】

    原文链接:http://www.c-sharpcorner.com/UploadFile/19b1bd/design-patterns-simplified-part3-factory/ Design ...

  8. [Design Patterns] 4. Creation Pattern

    设计模式是一套被反复使用.多数人知晓的.经过分类编目的.代码设计经验的总结,使用设计模式的目的是提高代码的可重用性,让代码更容易被他人理解,并保证代码可靠性.它是代码编制真正实现工程化. 四个关键元素 ...

  9. [Design Patterns] 1. Primary concept & term - UML

    It's time to review design patterns, especially when I reach the turning-point of my career. That's ...

随机推荐

  1. # Set the asyncio reactor's event loop as global # TODO: Should we instead pass the global one into the reactor?

    daphne/server.py at master · django/daphne https://github.com/django/daphne/blob/master/daphne/serve ...

  2. JVM 详解,大白话带你认识 JVM

    前言 如果在文中用词或者理解方面出现问题,欢迎指出.此文旨在提及而不深究,但会尽量效率地把知识点都抛出来 一.JVM的基本介绍 JVM 是 Java Virtual Machine 的缩写,它是一个虚 ...

  3. 线性DP总结(studying

    写在前面 虽然都说线性DP是入门,但我还是今天才开始学 线性DP就是珂以通过线性处理得出答案的一种DP 每一种状态都可以从前面推得,并且推导过程是呈线性的 参考题单(本人现在主要用luogu,所以这些 ...

  4. vmware打开虚拟级断电情况下,无法找到虚拟机文件

    1.此时会在建立的虚拟机目录下,有一些 %虚拟机名字%.vmx.lck 或者别的   %虚拟机名字%.***.lck   删除这些文件夹 2.虚拟文件 是一个后缀名为vmx的文件,发现断电后 变成了v ...

  5. 关于webservice实现web接口

    package service; import java.util.List; import javax.jws.WebMethod;import javax.jws.WebService; /** ...

  6. GPLT L2-010 排座位 (并查集)

    Tips: 数据范围较小时可把二维数组当做map<pair<int,int>,int>使用. #include <bits/stdc++.h> using name ...

  7. 2019HDU多校 Round3

    09 K Subsequence #include <bits/stdc++.h> using namespace std; typedef long long ll; const int ...

  8. 【poj 3090】Visible Lattice Points(数论--欧拉函数 找规律求前缀和)

    题意:问从(0,0)到(x,y)(0≤x, y≤N)的线段没有与其他整数点相交的点数. 解法:只有 gcd(x,y)=1 时才满足条件,问 N 以前所有的合法点的和,就发现和上一题-- [poj 24 ...

  9. 【bzoj 3433】{Usaco2014 Jan} Recording the Moolympics(算法效率--贪心)

    题意:给出n个区间[a,b),有2个记录器,每个记录器中存放的区间不能重叠.求2个记录器中最多可放多少个区间. 解法:贪心.只有1个记录器的做法详见--关于贪心算法的经典问题(算法效率 or 动态规划 ...

  10. UVA442 矩阵链乘 Matrix Chain Multiplication

    题意: 这道题也是在不改变原序列每个元素位置的前提下,看每个元素与他身边的两个元素那个先结合能得到最大的能量 题解: 很明显这是一道区间dp的题目,这道题要断环成链,这道题需要考虑在这个区间上某个元素 ...