OOCSS
面向对象CSS,和BEM一样,都只是一种CSS编写风格
OOCSS
面向对象CSS,和BEM一样,都只是一种CSS编写风格
modifiers
Modifiers represent different states or styles of classes.
CSS修饰器
Unique Selectors vs. Inline Styles
工作原理是使用内联抑或使用uid选择器
Framework-Specific vs. Framework-Agnostic
框架相关型和框架无关型
What Is CSS-in-JS?
CSS-in-JS 是一个 JavaScript 库,它将每个 JavaScript 组件及其所有属于它的 CSS 规则和依赖关系捆绑在一起。因此,组件可以独立运行,而无需依赖任何外部 CSS 文件。
CSS-in-JS libraries provide us with a new approach for writing CSS. They aim to tackle the limitations of CSS, such as the lack of dynamic functionality, scoping, and portability. In spite of its advantages, CSS-in-JS is a controversial technology, as many developers ask if it’s worth further complicating front-end development.
CSS in JS希望能打破CSS的限制,提供动态函数、作用域等特性。但是也有人认为,不应让前端技术变得更复杂
理清你的领域
用它们来构建知识之网
项目:具有明确的目标以及时间范围,是最小执行单位领域:你日常需要精进的领域(所以你需要为此负责)资源:你感兴趣的事情,也是支撑现在 Area 和将来 Area 的外部知识储备归档:沉寂的内容,但也许对未来有用缓存:快速的收集信息,减少判断的成本(个人添加)
缓存在flomo中
D3 (Data-Driven Documents) 是一个 Javascript 图形库
较为复杂
复杂应用 特征 互联网应用 数据量大,维度多
数据大屏、数据报表
简单应用 特点 单机离线 数据量小、维度少
excel,visio
The pipe | character is used to represent choice, matching either of the expressions on its sides. It can, of course, be repeated to express more than two choices (x | y | z). Choice has the lowest precedence of any operator, and, if there are no parentheses present, will apply to the entire expressions to its left and right.
管道 | 字符用于表示选择,匹配其两侧的任何一个表达式。当然,它可以重复以表示两个以上的选择(x | y | z)。Choice 的优先级是所有运算符中最低的,如果没有括号,它将应用于其左右的整个表达式。
tokens must match a regular language (roughly the thing that basic regular expressions can match), whereas nonterminals can express a context-free language.
token使用正则语法,非终止符可以使用上下文无关语言
A grammar is a collection of rules, which define terms. Terms can be either tokens, in which case they directly match a piece of input text, or nonterminals, which match expressions made up of other terms. Both tokens and nonterminals are defined using similar syntax, but they are explicitly distinguished (tokens must appear in a @tokens block), and tokens are more limited in what they can match—for example, they can't contain arbitrary recursion.
grammer: term[]
term = token | noternimals
token和非终止符的语法类似,但是可以显式区分
Given a formal description of a grammar, it can produce a set of parse tables. Such tables provide a description that the parser system can use to efficiently construct a syntax tree for a given piece of text, describing the structure of the text in terms of the grammar.
文法描述 -[Lezer]-> 解析表
文本 -[解析器系统(解析表)] -> 语法树
用形式化的方法表达一下。它的左边是一个非终结符(Non-terminal)。右边是它的产生式(Production Rule)。在语法解析的过程中,左边会被右边替代。如果替代之后还有非终结符,那么继续这个替代过程,直到最后全部都是终结符(Terminal),也就是 Token。只有终结符才可以成为 AST 的叶子节点。这个过程,也叫做推导(Derivation)过程:
表达式是若干个token的组合,根据token的组合判断表达式类型的过程,就是推导。
如声明变量的表达式,需要连续匹配到int、标识符、等号、表达式
int 这个字符串,既符合标识符的规则,又符合 int 这个关键字的规则,这两个规则发生了重叠。
不同类型的token之前有优先级
标识符:第一个字符必须是字母,后面的字符可以是字母或数字。比较操作符:> 和 >=(其他比较操作符暂时忽略)。数字字面量:全部由数字构成(像带小数点的浮点数,暂时不管它)。
token的类型:标识符、字面量、操作符、关键字、保留字。
词法分析的工作是将一个长长的字符串识别出一个个的单词,这一个个单词就是 Token
编译器Step1 :识别token
LR
?
Text
以树形结构存储编辑器的文档内容,可以用行号和偏移量进行快速索引定位 本身是一个字符串迭代器
EditorSelection
编辑器选区对象,包含多个选区
SelectionRange
选区
EditorState
state是一个持久化的不可变数据。只能通过创建transaction来修改,这将会产生一个新的state。 不可以直接修改state, 会造成不可预期的破坏
doc: 当前的文档 selection:当前的选区 field(): 获取field的值 update(): 用transaction spec创建一个用于修改状态的transaction replaceSelection(): 创建一个替换选区内容的transaction spec changeByRange(): xxxxx,返回一个transaction spec changes(): xxxxx,返回一个transaction spec toText(): 用文本创建一个Text对象 sliceDoc(): slice当前的文本 facet: toJSON: 序列化state tabSize: 当前设置的tabSize lineBreak: 当前设置的lineBreak readOnly: 当前的只读状态 phrases: 注册翻译短语的facet languageDataAt(): 获取某个位置上的languageData charCategorizer(): 返回一个函数用于字符分类 languageData: 注册languageData的facet changeFilter: 注册改动拦截器,当transaction起作用的时候,可以禁止它生效或禁止它对doc的某个区域生效 transactionFilter: 注册transaction拦截器,当transaction运行前,可以修改它的transaction spec
EditorStateConfig
创建state所需的配置:doc、selection、extensions
In its most basic form, an editor's state is made up of a current document and a selection
state = doc + selection
可以通过extension增加额外的field到state中
比如随pos而变的是否在某个语言模式下
state, which contains the data structures that model the editor state, and view, which provides the UI component for an editor.
state: 数据模型 view: ui