css3学习笔记01-css-2023-20230214

原文来自
https://www.w3.org/TR/2023/DNOTE-css-2023-20230214/
注意这是2023-02-14发布的css规范!!现在可能已过时

翻译参考有道翻译

大概翻译了1/3,剩下的以后再说
2023-06-20 ~ v1.0
2023-09-03 ~ v1.1

不确定的翻译和一些添加的词语写在英文括号里
如侵权请私信删除

Cascading 可以翻译为 级联 - 层叠 等等
define 可以翻译为 定义 - 解释 - 阐明 - 规定 等等
Replaces 可以翻译为 取代 - 替代 - 覆盖 等等
author作者,指使用CSS规范编写网站等的CSS部分代码的人?
Features功能 - 特性
interoperable互操作性、互用性;应该是指某些属性在不同设备比如谷歌浏览器和火狐浏览器等等不兼容?

简介:
叙述了css层叠样式表的历史,从第一版一整个文件,到第二版文件分章节叙述不同部分,到现在css3采用模块化的方法定义,css不再有css4了,但css各模块的版本在不断变化。css3的某时间发布的版本只用说明那个模块的第几版已经经过测试稳定可行了,那些模块还不稳定等等。

目录

1. Introduction 介绍

When the first CSS specification was published, all of CSS was contained in one document that defined CSS Level 1.
当第一个CSS规范发布时,所有的CSS(规则)都包含在一个的文档中,这个文档(定义/解释/规定/阐明)了CSS1。CSS Level 2 was defined also by a single, multi-chapter document. CSS2 也是由一个单独的多章节的文档规定的。However for CSS beyond Level 2, the CSS Working Group chose to adopt a modular approach, where each module defines a part of CSS, rather than to define a single monolithic specification. 然而,对于CSS3及以上, CSS工作组不再定义一个单一的整体规范,而是选择采用模块化的方法,每个模块规定CSS的一部分,。
This breaks the specification into more manageable chunks and allows more immediate, incremental improvement to CSS.这将规范分解为更易于管理的块,并允许对CSS进行更(直接/快速)、更(渐进/逐步)的改进。(注:我理解的是,如果发现那里有问题,可以直接对相对应的块立即进行修改,然后单独发布更改后的这一模块就行了,不用等问题多了整体发布一个新版本)
Since different CSS modules are at different levels of stability, the CSS Working Group has chosen to publish this profile to define the current scope and state of Cascading Style Sheets as of 2023.由于不同的CSS模块处于不同的稳定性级别,CSS工作组选择发布这个概要文件来规范到2023年层叠样式表的范围和状态。

1.1. What is CSS? 什么是CSS

Cascading Style Sheets (CSS) 层叠样式表
CSS is a language for writing style sheets, and is designed to describe the rendering of structured documents (such as HTML and XML) on a variety of media.
层叠样式表是一种用于编写样式表的语言,旨在描述结构化文档(如HTML和XML)在各种媒体上的呈现方式。CSS is used to describe the presentation of a source document, and usually does not change the underlying semantics expressed by its document language.CSS用于描述源文档的呈现方式,通常不会改变其文档语言表达的底层语义。
Style sheet 样式表
A set of rules that specify the presentation of a document. 指定文档表示形式的一组规则。Style sheets are written by an Author, and interpreted by a User Agent, to present the document to the User.样式表由作者编写,并由用户代理进行解释,来将文档呈现给用户。
Source document 源文档
The document to which one or more style sheets apply. 应用一个或多个样式表的文档。A source document’s structure and semantics are encoded using a document language (e.g., HTML, XHTML, or SVG).源文档的结构和语义使用文档语言(如HTML、XHTML和SVG)进行编码。
Author 作者
An author is a person who writes documents and associated style sheets. 作者是编写文档和(在文档里)关联样式表的人。An authoring tool is a User Agent that generates style sheets.一个创作工具是用户代理,它能生成样式表。
User 用户
A user is a person who interacts with a user agent to view, hear, or otherwise use the document.用户是与用户代理交互以看、听或其他方式使用文档的人。
User Agent (UA) 用户代理
A user agent is any program that interprets a document and its associated style sheets on behalf of a user. 用户代理是任意可以在用户方解释文档和文档关联的样式表的程序。A user agent may display a document, read it aloud, cause it to be printed, convert it to another format, etc. 用户代理可能可以显示文档、大声朗读文档、把文档打印出来、把文档转换为另一种格式等等。For the purposes of the CSS specifications, a User Agent is one that supports and interprets Cascading Style Sheets as defined in these specifications.(由于)规范了CSS,用户代理(可以)支持并解释这些符合那些定义的规范的层叠样式表。(注:就是规范了css的规则,比如浏览器就可以编写程序处理文档关联的css并按照css呈现文档,即支持并解释css,如果不规范,那浏览器就不知道该怎么处理css了)

1.2. Background: The W3C Process and CSS 背景:W3C流程和CSS

This section is non-normative.本节是非规范性的。
In the W3C Process, a Recommendation-track document passes through three levels of stability, summarized below:在W3C流程中,推荐跟踪文档要经过三个级别的稳定性,总结如下:
Working Draft (WD) 工作草案
This is the design phase of a W3C spec. 这是W3C规范的设计阶段。The WG iterates the spec in response to internal and external feedback. 工作组(根据/处理/响应/回应)内部和外部的反馈迭代规范。

The first official Working Draft is designated the “First Public Working Draft” (FPWD). 第一份正式工作草案被命名为“第一份公开工作草案”(FPWD)。In the CSSWG, publishing FPWD indicates that the Working Group as a whole has agreed to work on the module, roughly as scoped out and proposed in the editor’s draft. 在CSS工作组中,发布FPWD表明工作组整体上同意就该模块开展工作,(大致与编者初稿中提出的范围和建议一致)。

The transition to the next stage is sometimes called “Last Call Working Draft” (LCWD) phase.到下一阶段的过渡有时被称为“最终征求意见稿”(LCWD)阶段。The CSSWG transitions Working Drafts once we have resolved all known issues, and can make no further progress without feedback from building tests and implementations.一旦解决了所有已知的问题,并且如果没有来自构建测试和实现的反馈,就不能再进行进一步的工作,CSS工作组就会转换工作草案。

This “Last Call for Comments” sets a deadline for reporting any outstanding issues, and requires the WG to specially track and address incoming feedback. 这个“最终征求意见稿”为报告任何未解决的问题设定了最后期限,并且要求工作组专门跟踪和处理收到的反馈。The comment-tracking document is the Disposition of Comments (DoC). 意见跟踪文档就是意见处理文档(DoC)。It is submitted along with an updated draft for the Director’s approval, to demonstrate wide review and acceptance.它与一份更新的草案一起提交,供(理事/负责人)批准,以表明充分的审查和(验收/认可/接受)。

Candidate Recommendation (CR) 候选推荐标准
This is the testing phase of a W3C spec. 这是W3C规范的测试阶段Notably, this phase is about using tests and implementations to test the specification: it is not about testing the implementations. 值得注意的是,这个阶段是关于使用测试和实现来测试规范的,并不是关于测试实现的。This process often reveals more problems with the spec, and so a Candidate Recommendation will morph over time in response to implementation and testing feedback, though usually less so than during the design phase (WD).这个过程通常会暴露出规范的更多问题,因此候选标准将随着时间的推移而改变,以回应实现和测试的反馈。不过通常比设计阶段(WD)的变化要少。
Demonstration of two correct, independent implementations of each feature is required to exit CR, so in this phase the WG builds a test suite and generates implementation reports.退出CR需要每个特性都有两个正确的、独立的实现示例。因此在此阶段,工作组会构建一个测试套件并生成实现报告。

The transition to the next stage is “Proposed Recommendation” (PR). 到下一阶段的过渡是“提议提议”(PR)。During this phase the W3C Advisory Committee must approve the transition to REC.在此阶段,W3C顾问委员会必须核准向REC的过渡。

Recommendation (REC) 正式提议
This is the completed state of a W3C spec and represents a maintenance phase. 这是W3C规范的完成状态,代表进入了维护阶段。At this point the WG only maintains an errata document and occasionally publishes an updated edition that incorporates the errata back into the spec.在这一阶段,工作组只维护一个勘误表文档,偶尔发布最新修订本来将勘误表合并回规范中。
An Editor’s Draft is effectively a live copy of the editors’ own working copy. 编辑的草稿实际上是编辑自己的工作副本的实时副本。It may or may not reflect Working Group consensus, and can at times be in a self-inconsistent state. 它可能体现也可能不体现工作组的共识,甚至有时可能处于自相矛盾的状态。(Because the publishing process at W3C is time-consuming and onerous, the Editor’s Draft is usually the best (most up-to-date) reference for a spec. Efforts are currently underway to reduce the friction of publishing, so that official drafts will be regularly up-to-date and Editor’s Drafts can return to their original function as scratch space.)(因为W3C的发布过程费时又繁重,所以编者草案通常是规范的最佳(通常是最新的)参考。目前正在努力减少发布的分歧,以便官方草稿定期更新,并且编辑草稿可以恢复其原始功能:(作为草稿)。

2. Classification of CSS Specifications CSS规范的分类

A list of all CSS modules, stable and in-progress, and their statuses can be found at the CSS Current Work page.所有CSS模块的列表,(包括稳定的和开发中的)。模块的状态可以在CSS当前工作页面找到。

2.1. Cascading Style Sheets (CSS) — The Official Definition 层叠样式表(CSS)–官方规范

This profile includes only specifications that we consider stable and for which we have enough implementation experience that we are sure of that stability. 这个概要文档仅包含我们认为稳定并且有足够的实现经验来确保这种稳定性的规范。

NOTE: This is not intended to be a CSS Desktop Browser Profile: inclusion in this profile is based on feature stability only and not on expected use or Web browser adoption. This profile defines CSS in its most complete form.这并不打算成为一个CSS桌面浏览器(配置文件):包含在这个配置文件中只是基于特性的稳定性,而不是基于预期的使用或Web浏览器的(选择/采用)。这个概要文件以最完整的形式定义了CSS。

As of 2023, Cascading Style Sheets (CSS) is defined by the following specifications. 截至2023年,层叠样式表(CSS)由以下规范定义:
CSS Level 2, latest revision (including errata) [CSS2] CSS2 最新修订版(包括勘误表)
This defines the core of CSS, parts of which are overridden by later specifications. We recommend in particular reading Chapter 2, which introduces some of the basic concepts of CSS and its design principles. 这定义了 CSS 的核心,其中部分被之后的规范覆盖。 我们特别建议阅读第2章, (第二章)介绍了CSS的一些基本概念和CSS的设计原则。
CSS Syntax Level 3 [CSS-SYNTAX-3] CSS 语法 第三版
Replaces CSS2§4.1, CSS2§4.2, CSS2§4.4, and CSS2§G, redefining how CSS is parsed. 取代了CSS2的4.1、4.2、4.4和G章节,重新定义和CSS的解析方法。
CSS Style Attributes [CSS-STYLE-ATTR] CSS 样式属性
Defines how CSS declarations can be embedded in markup attributes. 定义如何在标记属性中插入CSS声明。
Media Queries Level 3 [CSS3-MEDIAQUERIES] CSS 媒体查询 第三版
Replaces CSS2§7.3 and expands on the syntax for media-specific styles. 取代CSS2的7.3章,并扩展了特定媒体样式的语法。
CSS Conditional Rules Level 3 [CSS-CONDITIONAL-3] CSS 条件规则 第三版
Extends and supersedes CSS2§7.2, updating the definition of '@media' rules to allow nesting and introducing the '@supports' rule for feature-support queries. 扩展并取代了CSS2的7.2章,更新了@media规则的定义,使其可以嵌套,并引入了@supports规则支持特性查询。
Selectors Level 3 [SELECTORS-3] CSS 选择器 第三版
Replaces CSS2§5 and CSS2§6.4.3, defining an extended range of selectors. 取代了CSS2的5和6.4.3章,定义了选择器的扩展范围(定义了更大范围的选择器)
CSS Namespaces [CSS3-NAMESPACE] CSS 命名空间 第三版
Introduces an '@namespace' rule to allow namespace-prefixed selectors. 引入@namespace规则,允许以命名空间为前缀的选择器
CSS Cascading and Inheritance Level 4 [CSS-CASCADE-4] CSS 级联和继承 第四版
Extends and supersedes CSS2§1.4.3 and CSS2§6, as well as [CSS-CASCADE-3]. 扩展并取代CSS2的1.4.3和6章,以及“CSS3层叠和继承”。Describes how to collate style rules and assign values to all properties on all elements. 描述了如何(整理/核对/解析)样式规则并确定所有元素的所有属性的值。By way of cascading and inheritance, values are propagated for all properties on all elements.通过层叠和继承,为所有元素上的所有属性传播值。
CSS Values and Units Level 3 [CSS-VALUES-3] CSS 值和单位 第三版
Extends and supersedes CSS2§1.4.2.1, CSS2§4.3, and CSS2§A.2.1–3, defining CSS’s property definition syntax and expanding its set of units.扩展并取代CSS2的1.4.2.1、4.3 和A.2.1–3章,定义了CSS属性的定义语法,并扩大了它的单位集。
CSS Custom Properties for Cascading Variables Module Level 1 [CSS-VARIABLES-1] CSS 层叠变量模块的自定义属性 第一版
Introduces cascading variables as a new primitive value type that is accepted by all CSS properties, and custom properties for defining them.引入层叠变量作为所有CSS属性都接受的新原生的值类型,(用于定义它们的自定义属性)。
CSS Box Model Level 3 [CSS-BOX-3] CSS 盒子模型 第三版
Replaces CSS2§8.1, §8.2, §8.3 (but not §8.3.1), and §8.4.取代CSS2的8.1、8.2、8.3(除了8.3.1)和 8.4章。
CSS Color Level 4 [CSS-COLOR-4] CSS 颜色 第四版
Extends and supersedes CSS2§4.3.6, CSS2§14.1, and CSS2§18.2, also extends and supersedes [CSS-COLOR-3], introducing an extended range of color spaces beyond sRGB, extended color values, and CSS Object Model extensions for color. Also defines the opacity property.扩展并取代了CSS2的4.3.6、14.1和18.2章,也扩展并取代了“CSS3 颜色”,引入扩展了在sRGB范围之外的颜色空间,扩展了颜色值,也扩展了CSS对象模型的颜色。还定义了不透明度属性
CSS Backgrounds and Borders Level 3 [CSS-BACKGROUNDS-3] CSS 背景和边框 3
Extends and supersedes CSS2§8.5 and CSS2§14.2, providing more control of backgrounds and borders, including layered background images, image borders, and drop shadows.扩展并取代CSS2的8.5和14.2章。提供更多的背景和边框控制方式,包括分层背景图片、图像、片边界和投影。
CSS Images Level 3 [CSS-IMAGES-3] CSS 图片 第三版
Redefines and incorporates the external 2D image value type, introduces native 2D gradients, and adds additional controls for replaced element sizing and rendering.重新定义并合并外部2D图像值类型,引入原生2D渐变,并添加用于替换元素大小调整和呈现的其他控件。
CSS Fonts Level 3 [CSS-FONTS-3] CSS 字体 第三版
Extends and supersedes CSS2§15 and provides more control over font choice and feature selection.扩展并取代 CSS2的15章并提供对字体选择和特征选择的更多控制方式。
CSS Writing Modes Level 3 [CSS-WRITING-MODES-3] CSS 书写模式 第三版
Defines CSS support for various international writing modes, such as left-to-right (e.g. Latin or Indic), right-to-left (e.g. Hebrew or Arabic), bidirectional (e.g. mixed Latin and Arabic) and vertical (e.g. Asian scripts). Replaces and extends CSS2§8.6 and §9.10.定义对各种国际书写模式的CSS支持,包括从左到右(如拉丁文或印度文),从右到左(如希伯来文或阿拉伯文),双向书写(如混合拉丁文和阿拉伯文)和纵排书写(如亚洲文字)。取代和扩展了CSS2的8.6和9.10章。
CSS Multi-column Layout Level 1 [CSS-MULTICOL-1] CSS 多列布局 第一版
Introduces multi-column flows to CSS layout.为CSS布局引入多列布局
CSS Flexible Box Module Level 1 [CSS-FLEXBOX-1] CSS 弹性盒子模块 第一版
Introduces a flexible linear layout model for CSS. 为CSS引入(灵活的/弹性的)线性布局模块
CSS User Interface Module Level 3 [CSS-UI-3] CSS 用户界面模型 第三版
Extends and supersedes CSS2§18.1 and CSS2§18.4, defining 'cursor,' 'outline', and several new CSS features that also enhance the user interface.扩展并取代 CSS2的18.1和 18.4章,定义“游标”、“轮廓”和几个新的CSS功能,这些功能改善了用户界面。
CSS Containment Module Level 1 [CSS-CONTAIN-1] CSS 包含模块 第一版
Introduces the 'contain' property, which enforces the independent CSS processing of an element’s subtree in order to enable heavy optimizations by user agents when used well.引入“包含”属性,该属性强制对元素的子树进行独立的CSS处理,以便在使用得当的情况下允许用户代理进行大量优化。
CSS Transforms Level 1 [CSS-TRANSFORMS-1] CSS 变换 第一版
Introduces coordinate-based graphical transformations to CSS.向CSS引入基于坐标的图形变换。
CSS Compositing and Blending Level 1 [COMPOSITING] CSS 合成和协调(拼接与混合) 第一版
Defines the compositing and blending of overlaid content and introduces features to control their modes.定义叠加内容的合成和协调并引入了控制其模式的功能。
CSS Easing Functions Level 1 [CSS-EASING-1]. CSS 缓冲方法 第一版
Describes a way for authors to define a transformation that controls the rate of change of some value. 描述了作者定义控制某个值变化速度的变换的方法。Applied to animations, such transformations can be used to produce animations that mimic physical phenomena such as momentum or to cause the animation to move in discrete steps producing robot-like movement.应用于动画,这样的变换可以同于生成模拟动量等物理现象的动画,或者使动画不连续的(改变/播放)来产生类似机器人移动的效果。
CSS Counter Styles Level 3 [CSS-COUNTER-STYLES-3] CSS 计数器样式 第三版
Introduces the '@counter-style' rule, which allows authors to define their own custom counter styles for use with CSS list-marker and generated-content counters [CSS-LISTS-3]. 引入计数器样式规则,它允许作者定义自己的自定义计数器样式用于CSS列表标记和生成内容计数器(CSS 列表 第三版)。It also predefines a set of common counter styles, including the ones present in CSS2 and CSS2.1.它还预定义了一组常见的计数器样式,包含CSS2和CSS2.1中的那些。

NOTE: Although we don’t anticipate significant changes to the specifications that form this snapshot, their inclusion does not mean they are frozen. 尽管我们预计这个快照涉及的规范不会发生重大变化,它们的内容并不是(一成不变的/冻结的)。The Working Group will continue to address problems as they are found in these specs. 工作组将持续处理这些规范中发现的问题。Implementers should monitor www-style and/or the CSS Working Group Blog for any resulting changes, corrections, or clarifications. (实现/实施/使用)者应该(关注/监视)3W样式 和/或 CSS工作组的博客,来获取产生的更改、更正和(澄清/说明/阐明/纯化)。

2.2. Fairly Stable Modules with limited implementation experience 完全稳定但(实现经验有限)的模块

The following modules have completed design work, and are fairly stable, but have not received much testing and implementation experience yet. We hope to incorporate them into the official definition of CSS in a future snapshot.以下模块已经完成了设计工作,并且相当稳定,但还没有太多的测试和实现经验。我们希望在未来的快照中将它们合并到CSS的官方定义中。
Media Queries Level 4 [MEDIAQUERIES-4] CSS 媒体查询 第四版
Extends and supersedes [CSS3-MEDIAQUERIES], expanding the syntax, deprecating most media types, and introducing new media features. 扩展并取代“CSS 媒体查询 第三版”,扩展了语法,弃用了大多数媒体类型,并引入了新的媒体类型。
CSS Display Module Level 3 [CSS-DISPLAY-3] CSS 显示模块 第三版
Replaces CSS2§9.1.2, §9.2.1 (but not §9.2.1.1), §9.2.2 (but not §9.2.2.1), §9.2.3, and §9.2.4 (and lays the foundations for replacing §9.7), defining how the CSS formatting box tree is generated from the document element tree and defining the display property that controls it.取代CSS2的9.1.2、9.2.1(除了9.2.1.1)、9.2.2(除了9.2.2.1)、9.2.3和9.2.4章。(并为替换 9.7章奠定了基础),定义了CSS格式化盒子节点树是如何从文档元素树中生成的,同时还定义了可以控制该模块的‘display’属性。
CSS Writing Modes Level 4 [CSS-WRITING-MODES-4] CSS 书写模式 第四版
Extends and supersedes [CSS-WRITING-MODES-3], adding more options for vertical writing.扩展并取代了“CSS 书写模式 第三版”, 为垂直书写增添了更多选项。
CSS Fragmentation Module Level 3 [CSS-BREAK-3] CSS 片段模块 第三版
Describes the fragmentation model that partitions a flow into pages, columns, or regions and defines properties that control it. Extends and supersedes CSS2§13.3. 描述了将一个内容流切分到不同的页面、竖行或区域的片段模型,并定义了控制它的属性。扩展并取代了CSS2的13.3章。
CSS Box Alignment Module Level 3 [CSS-ALIGN-3] CSS 盒子对齐模块 第三版
Introduces properties to control the alignment of boxes within their containers in the various CSS box layout models: block layout, table layout, flex layout, and grid layout.引入了控制盒子在其容器中对齐的属性,包括多种CSS盒子布局模块:block布局、flex布局、table布局和grid布局。
CSS Shapes Module Level 1 [CSS-SHAPES-1] CSS 形状模块 第一版
Extends floats (CSS2§9.5) to effect non-rectangular wrapping shapes.扩展了float(CSS2的9.5章)来实现非矩形的环绕形状
CSS Text Module Level 3 [CSS-TEXT-3] CSS 文本模块 第三版
Extends and supersedes CSS2§16 excepting §16.2, defining properties for text manipulation and specifying their processing model. 扩展并取代了CSS2的16章,16.2除外,定义了控制文本的属性及其处理模式。It covers line breaking, justification and alignment, white space handling, and text transformation.它包括换行、垂直和水平的对齐、空格处理和文本变换。
CSS Text Decoration Level 3 [CSS-TEXT-DECOR-3] CSS 文本修饰模块 第三版
Extends and supersedes CSS2§16.3, providing more control over text decoration lines and adding the ability to specify text emphasis marks and text shadows.扩展并取代了CSS2的16.3章,提供更多对文本修饰线的控制,并增加了对指定文本加强调符号和加文本阴影的功能。
CSS Masking Level 1 [CSS-MASKING-1] CSS 遮盖模块 第一版
Replaces CSS2§11.1.2 and introduces more powerful ways of clipping and masking content.取代了CSS2的11.1.2章,并引入了更强大的内容遮盖和剪切方法。
CSS Scroll Snap Module Level 1 [CSS-SCROLL-SNAP-1] CSS滚动捕捉模块 第一版
Contains features to control panning and scrolling behavior with “snap positions”. 包含通过“界限点”控制触屏滑动和滚动行为的功能。
CSS Speech Module Level 1 [CSS-SPEECH-1] CSS 语音模块
Replaces CSS2§A, overhauling the (non-normative) speech rendering chapter. 取代CSS2的A章,大修了(非规范的)语音渲染章节。
CSS Scrollbars Styling Module Level 1 [CSS-SCROLLBARS-1] CSS 滚动条样式模块 第一版
Defines properties to influence the visual styling of scrollbars, introducing controls for their color and width. 定义了影响滚动条视觉样式的属性,包括颜色和宽度的控件。

2.3. Modules with Rough Interoperability - 具有粗糙互用性的模块

Although the following modules have been widely deployed with rough interoperability, their details are not fully worked out or sufficiently well-specified and they need more testing and bugfixing. We hope to incorporate them into the official definition of CSS in a future snapshot.尽管以下模块已经被广泛部署,具有粗略的互操作性,但它们的细节还没有完全制定出来或足够明确,它们需要更多的测试和错误修复。我们希望在未来的快照中将它们合并到CSS的官方定义中。
CSS Transitions Level 1 [CSS-TRANSITIONS-1] and CSS Animations Level 1 [CSS-ANIMATIONS-1].
Introduces mechanisms for transitioning the computed values of CSS properties over time.
CSS Grid Layout Module Level 1 [CSS-GRID-1]
Introduces a two-dimensional grid-based layout system, optimized for user interface design. In the grid layout model, the children of a grid container can be positioned into arbitrary slots in a predefined flexible or fixed-size layout grid.
CSS Grid Layout Module Level 2 [CSS-GRID-2]
Extends and supersedes [CSS-GRID-1], introducing “subgrids” for managing nested markup in a shared grid framework.
CSS Will Change Level 1 [CSS-WILL-CHANGE-1]
Introduces a performance hint property called will-change.
Filter Effects Module Level 1 [FILTER-EFFECTS-1]
Introduces filter effects as a way of processing an element’s rendering before it is displayed in the document.
CSS Font Loading Module Level 3 [CSS-FONT-LOADING-3]
Introduces events and interfaces used for dynamically loading font resources.
CSS Box Sizing Level 3 [CSS-SIZING-3]
Overlays and extends CSS§10., expanding the value set of the sizing properties, introducing more precise sizing terminology, and defining with more precision and detail various automatic sizing concepts only vaguely defined in CSS2.
CSS Transforms Level 2 [CSS-TRANSFORMS-2]
Builds upon [CSS-TRANSFORMS-1] to add new transform functions and properties for three-dimensional transforms, and convenience functions for simple transforms.
CSS Lists and Counters Module Level 3 [CSS-LISTS-3]
Contains CSS features related to list counters: styling them, positioning them, and manipulating their value.
CSS Logical Properties and Values Level 1 [CSS-LOGICAL-1]
Introduces logical properties and values that provide the author with the ability to control layout through logical, rather than physical, direction and dimension mappings. Also defines logical properties and values for the features defined in [CSS2]. These properties are writing-mode relative equivalents of their corresponding physical properties.
CSS Positioned Layout Module Level 3 [CSS-POSITION-3]
Contains defines coordinate-based positioning and offsetting schemes of CSS: relative positioning, sticky positioning, absolute positioning, and fixed positioning.
Resize Observer [RESIZE-OBSERVER-1]
This specification describes an API for observing changes to element’s principal box’s size.
Web Animations [WEB-ANIMATIONS-1]
Defines a model for synchronization and timing of changes to the presentation of a Web page. Also defines an application programming interface for interacting with this model.
CSS Fonts Module Level 4 [CSS-FONTS-4]
Extends and supersedes CSS Fonts 3 and provides more control over font choice and feature selection, including support for OpenType variations.
CSS Color Adjustment Module Level 1 [CSS-COLOR-ADJUST-1]
This module introduces a model and controls over automatic color adjustment by the user agent to handle user preferences and device output optimizations.
CSS Conditional Rules Module Level 4 [CSS-CONDITIONAL-4]
Extends CSS Conditional 3 to allow testing for supported selectors.
CSS Cascading and Inheritance Level 5 [CSS-CASCADE-5]
Extends CSS Cascade 4 to add cascade layers.
CSS Scroll Snap Module Level 1 [CSS-SCROLL-SNAP-1]
Adds features to control panning and scrolling behavior with “snap positions”.

2.4. CSS Levels - CSS级别

Cascading Style Sheets does not have versions in the traditional sense; instead it has levels. 层叠样式表没有传统意义上的版本,它以级别代替。Each level of CSS builds on the previous, refining definitions and adding features. 每个级别的CSS都建立在上一个级别的基础上,优化定义并添加功能。The feature set of each higher level is a superset of any lower level, and the behavior allowed for a given feature in a higher level is a subset of that allowed in the lower levels. 高级别的功能集是任何低级别功能集的超集,并且给定级别中允许的功能集,较高级别中的功能集是较低级别中允许的功能集的子集。A user agent conforming to a higher level of CSS is thus also conformant to all lower levels.因此,符合更高级别的CSS的用户代理也符合所有较低级别的CSS。

CSS Level 1
The CSS Working Group considers the CSS1 specification to be obsolete. CSS工作组认为CSS1规范已经(过时了/废弃了)。CSS Level 1 is defined as all the features defined in the CSS1 specification (properties, values, at-rules, etc), but using the syntax and definitions in the CSS2.1 specification. CSS1把所有的功能定义在了CSS1规范里(属性、值、@规则等等),但是使用了CSS2.1规范中的语法和定义。CSS Style Attributes defines its inclusion in element-specific style attributes.CSS样式属性定义了它包含在特定元素样式属性中。
CSS Level 2
Although the CSS2 specification is technically a W3C Recommendation, it passed into the Recommendation stage before the W3C had defined the Candidate Recommendation stage. 尽管在技术上W3C推荐CSS2规范,CSS2规范在W3C定义候选推荐阶段之前就进入了推荐阶段。 Over time implementation experience and further review has brought to light many problems in the CSS2 specification, so instead of expanding an already unwieldy errata list, the CSS Working Group chose to define CSS Level 2 Revision 1 (CSS2.1). 随着时间的推移,实现经验和进一步的审查(揭露/发现)了CSS2规范的很多问题。所以CSS工作组选择定义CSS2的第一版修订版(CSS2.1),而不是继续扩展已经(笨重的/不实用的)勘误表。 In case of any conflict between the two specs CSS2.1 contains the definitive definition. 如果两个规格之间存在(任何)冲突,(以CSS2.1为准/CSS2.1中的是最终的/最权威的定义)。

Once CSS2.1 became Candidate Recommendation—effectively though not officially the same level of stability as CSS2—obsoleted the CSS2 Recommendation. 一旦CSS2.1成为候选推荐-实际上尽管没有和CSS2相同的官方的稳定性-CSS2推荐将被废弃。 Features in CSS2 that were dropped from CSS2.1 should be considered to be at the Candidate Recommendation stage, but note that many of these have been or will be pulled into a CSS Level 3 working draft, in which case that specification will, once it reaches CR, obsolete the definitions in CSS2. 在CSS2.1中被删除的CSS2的功能应该认为是处于候选推荐阶段,但请注意,这些中的许多已经或者将要被列入CSS3的工作草案,在这种情况下,一旦草案达到候选推荐标准,就废弃CSS2中对应的定义。

The CSS2.1 specification defines CSS Level 2 and the CSS Style Attributes specification defines its inclusion in element-specific style attributes. CSS2.1规范定义了CSS2,CSS样式属性规范定义了其在特定元素样式属性中的都包含什么属性。

CSS Level 3
CSS Level 3 builds on CSS Level 2 module by module, using the CSS2.1 specification as its core. CSS3以CSS2.1为核心,以CSS2为基础,逐个模块的构建。 Each module adds functionality and/or replaces part of the CSS2.1 specification. 每个模块添加新功能和/或取代CSS2.1中的部分规范。 The CSS Working Group intends that the new CSS modules will not contradict the CSS2.1 specification: only that they will add functionality and refine definitions. CSS工作组计划新的CSS模块不会与CSS2.1中的规范相矛盾,新模块只会添加功能和优化定义。 As each module is completed, it will be plugged in to the existing system of CSS2.1 plus previously-completed modules. 每个模块完成后,都将和之前完成的模块一起插入CSS2.1的现有系统中。

From this level on modules are levelled independently: for example Selectors Level 4 may well be completed before CSS Line Module Level 3. 从CSS3开始,所有的模块都是平等独立的。比如说选择器第四版可能比CSS行模块第三版之前完成。 Modules with no CSS Level 2 equivalent start at Level 1; modules that update features that existed in CSS Level 2 start at Level 3. CSS2中没有对应内容的模块从第一版开始,而更新CSS2中已经存在的功能的模块从第三版开始。

CSS Level 4 and beyond
There is no CSS Level 4. 没有CSS4.Independent modules can reach level 4 or beyond, but CSS the language no longer has levels. ("CSS Level 3" as a term is used only to differentiate it from the previous monolithic versions.)独立模块可以达到4级甚至更高,但CSS语言不再有更多的级别。(CSS3作为一个术语仅用于将其与之前的整体版本区别开来。)

2.5. CSS Profiles - CSS概述文件

Not all implementations will implement all functionality defined in CSS. 并非所有的实现都将实现定义在CSS中的所有功能。

In the past, the Working Group published a few Profiles, which were meant to define the minimal subset of CSS that various classes of user agents were expected to support. 过去。工作组发表了一些概述文件,想定义一个期望各种类型的用户代理都支持的CSS最小子集。

This effort has been discontinued, as the Working Group was not finding it effective or useful, and the profiles previously defined are now unmaintained. 这项工作已经停止了,因为工作组发现它没有效果。并且原来定义的概述文件现在不再维护。

NOTE: Partial implementations of CSS, even if that subset is an official profile, must follow the forward-compatible parsing rules for partial implementations. CSS的部分实现必须遵循部分实现的向前兼容解析规则,就算该子集是官方概述文件也一样。

3. Requirements for Responsible Implementation of CSS 对CSS负责任实现的要求

The following sections define several conformance requirements for implementing CSS responsibly, in a way that promotes interoperability in the present and future.下面几节定义了以一种促进当前和未来互操作性的方式负责任地实现CSS的几个一致性要求。

3.1. Partial Implementations - 部分实现

So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers must treat as invalid (and ignore as appropriate) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. 为了使作者可以利用向前兼容的解析规则来分配回退值,CSS渲染器必须将没有可用版本支持的任何@规则、属性、属性值、关键字和其他语法构造视为无效(并酌情忽略)。In particular, user agents must not selectively ignore unsupported property values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored. 特别的,用户代理不得在单个多值属性声明中选择性的忽略不支持的属性值,而采用受支持的值:如果任何值被视为无效,(比如不支持的值必须视为无效)CSS规定忽略整个声明。

3.2. Implementations of Unstable and Proprietary Features - 不稳定和专有功能的实现

To avoid clashes with future stable CSS features, the CSSWG recommends the following best practices for the implementation of unstable features and proprietary extensions to CSS: 为了避免和未来稳定版本的CSS(规范)的功能发生冲突,CSS工作组建议采用以下最佳实践来实现CSS的不稳定功能和专有扩展。

3.2.1. Experimentation and Unstable Features - 实验和不稳定功能

Implementations of unstable features that are described in W3C specifications but are not interoperable should not be released broadly for general use; but may be released for limited, experimental use in controlled environments. W3C规范中描述了不稳定功能的实现,但是这种实现不可互操作,不应广泛发布来供一般使用。但可能会在受控环境中发布用于有限的实验性使用。

Why? 为什么

EXAMPLE 1
For example, a UA could release an unstable features for experimentation through beta or other testing-stage builds; behind a hidden configuration flag; behind a switch enabled only for specific testing partners; or through some other means of limiting dependent use. 例如,用户代理可以发布不稳定的功能供实验。通过beta测试版或其他测试阶段构建的测试版;通过在前面加隐藏配置标志;通过仅特定测试合作伙伴可以用的交换机;或者通过其他的一些限制使用的手段。

A CSS feature is considered unstable until its specification has reached the Candidate Recommendation (CR) stage in the W3C process. CSS的功能在其规范走到W3C流程的候选推荐阶段(CR)之前都被认为是不稳定的。In exceptional cases, the CSSWG may additionally, by an officially-recorded resolution, add pre-CR features to the set that are considered safe to release for broad use. 在特使情况下,CSS工作组可以通过官方记录的决议,例外地将CR阶段前的功能添加到被认为可以安全发布供广泛使用的那一部分里。See § 4 Safe to Release pre-CR Exceptions. 参见本规范第四节。

NOTE: Vendors should consult the WG explicitly and not make assumptions on this point, as a pre-CR spec that hasn’t changed in awhile is usually more out-of-date than stable. 注意:供应商应明确咨询工作组,不要在某一点上做假设。因为一段时间没有修改的CR前规范通常比其稳定版更过时。

3.2.2. Proprietary and Non-standardized Features - 专有和非标准化功能

To avoid clashes with future CSS features, the CSS2.1 specification reserves a prefixed syntax [CSS2] for proprietary and experimental extensions to CSS. 为了避免与未来的CSS特性发生冲突,CSS2.1规范为专有的和实验性的CSS扩展保留了前缀语法[CSS2]。 A CSS feature is a proprietary extension if it is meant for use in a closed environment accessible only to a single vendor’s user agent(s). 。如果一个CSS特性是为了在一个只有一个供应商的用户代理可以访问封闭环境中使用,它就是一个专有的扩展 A UA should support such proprietary extensions only through a vendor-prefixed syntax and not expose them to open (multi-UA) environments such as the World Wide Web.用户代理应该只通过以供应商为前缀的语法来支持这些专有扩展,而不是将它们暴露给开放的(多UA)环境,比如万维网。

Why?

EXAMPLE 2
For example, Firefox’s XUL-based UI, Apple’s iTunes UI, and Microsoft’s Universal Windows Platform app use extensions to CSS implemented by their respective UAs. 例如,Firefox的基于xul的UI,苹果的iTunes UI,以及微软的通用Windows平台应用程序都使用了由各自的用户代理实现的CSS扩展。So long as these UAs do not allow Web content to access these features, they do not provide an opportunity for such content to become dependent on their proprietary extensions.如果这些用户代理不允许Web内容访问这些功能,它们(只需要)不为此类内容提供依赖于其专有扩展的机会。

Even if a feature is intended to eventually be used in the Web, if it hasn’t yet been standardized it should still not be exposed to the Web. 即使一个特性最终打算在Web上使用,如果它还没有标准化,那么它仍然不应该发布在Web上。

3.2.3. Market Pressure and De Facto Standards - 市场压力和事实标准

If a feature is unstable (i.e. the spec has not yet stabilized), but

  • at least three UAs implement the feature (or a UA has broken the other rules and shipped for broad use an unstable or otherwise non-standard feature in a production release),
  • and the implementations have rough interoperability,
  • and the CSS Working Group has recorded consensus that this feature should exist and be released,

implementers may ship that feature unprefixed in broad-release builds. Rough interoperability is satisfied by a subjective judgment that even though there may be differences, the implementations are sufficiently similar to be used in production websites for a substantial number of use cases.

Note that the CSSWG must still be consulted to ensure coordination across vendors and to ensure coherency review by the CSS experts from each vendor. Note also that rough interoperability still usually means painful lack of interop in edge (or not-so-edge) cases, particularly because details have not been ironed out through the standards review process.

Why?

3.2.3.1. Vendor-prefixing Unstable Features

When exposing such a standards-track unstable feature to the Web in a production release, implementations should support both vendor-prefixed and unprefixed syntaxes for the feature. Once the feature has stabilized and the implementation is updated to match interoperable behavior, support for the vendor-prefixed syntax should be removed.

Why?
Anyone promoting unstable features to authors should document them using their standard unprefixed syntax, and avoid encouraging the use of the vendor-prefixed syntax for any purpose other than working around implementation differences.

3.2.3.2. Preserving the Openness of CSS

In order to preserve the open nature of CSS as a technology, vendors should make it possible for other implementors to freely implement any features that they do ship. To this end, they should provide spec-editing and testing resources to complete standardization of such features, and avoid other obstacles (e.g., platform dependency, licensing restrictions) to their competitors shipping the feature.

3.3. Implementations of CR-level Features - CR级功能的实现

Once a specification reaches the Candidate Recommendation stage, implementers should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec, and should avoid exposing a prefixed variant of that feature.

To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group.

Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at https://www.w3.org/Style/CSS/Test/. Questions should be directed to the public-css-testsuite@w3.org mailing list.

4. Safe to Release pre-CR Exceptions - 安全释放CR前异常

The following features have been explicitly and proactively cleared by the CSS Working Group for broad release prior to the spec reaching Candidate Recommendation. See § 3.2.1 Experimentation and Unstable Features.

  • The flow-relative equivalents of the sizing properties (`width`, `height`, etc.), the border properties, the margin and padding properties. See explanation and specification.
  • The `min-content` and `max-content` keywords of the sizing properties. See decision and specification.
  • The `conic-gradient()` gradient notation. See decision.
  • The `aspect-ratio` property. [CSS-SIZING-4]
  • The `translate`, `rotate`, and `scale` properties. [CSS-TRANSFORMS-2]
  • The `hyphenate-character` property. [CSS-TEXT-4]
  • The color-mix() function. [CSS-COLOR-5]
  • The <color-interpolation-method>, defined in [CSS-COLOR-4] and used for interpolation of linear, radial and conic gradients. [CSS-IMAGES-4]
  • The relative color syntax, defined in [CSS-COLOR-5]
    The following features have been explicitly and retroactively cleared by the CSS Working Group for broad release prior to the spec reaching Candidate Recommendation:
  • Everything in CSS Animations Level 1 and CSS Transitions Level 1.
  • The `:dir()`, `:lang()`, and `:focus-within` pseudo-classes from [SELECTORS-4].

5. Indices - 索引/目录

These sections are non-normative.

5.1. Terms Index - 术语索引

… 太多了,略去

5.2. Selector Index - 选择器索引

*:active::after::before
:checked:disabled:empty:enabled
:first-child::first-letter::first-line:first-of-type
:focus:hover:lang:last-child
:last-of-type:link:not():nth-child()
:nth-last-child():nth-last-of-type():nth-of-type():only-child
:only-of-type:root:target:visited

5.3. At-Rule Index - @规则索引

@charset@counter-style@import
@keyframes@media@supports

5.4. Property Index - 属性索引

… 太多了,略去

6. Acknowledgements - 致谢

Special thanks to Florian Rivoal for creating the initial draft of the § 3.2.1 Experimentation and Unstable Features recommendations.特别感谢Florian Rivoal创建了3.2.1尝试和不稳定特性建议的初稿。

Conformance - 一致性

Document conventions - 文档惯例/约定

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

Examples in this specification are introduced with the words “for example” or are set apart from the normative text with , like this: class=“example”

EXAMPLE3
This is an example of an informative example.

Informative notes begin with the word “Note” and are set apart from the normative text with , like this: class=“note”

Note, this is an informative note.

Advisements are normative sections styled to evoke special attention and are set apart from other normative text with , like this:

UAs MUST provide an accessible alternative.

Conformance classes - 一致性种类

Conformance to this specification is defined for three conformance classes:
style sheet
A CSS style sheet.
renderer
A UA that interprets the semantics of a style sheet and renders documents that use them.
authoring tool
A UA that writes a style sheet.

A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module.

A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.)

An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module.

Partial implementations - 部分实现

So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers must treat as invalid (and ignore as appropriate) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents must not selectively ignore unsupported component values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.

Implementations of Unstable and Proprietary Features - 不稳定和专有功能的实现

To avoid clashes with future stable CSS features, the CSSWG recommends following best practices for the implementation of unstable features and proprietary extensions to CSS.

Non-experimental implementations - 非实验性实现

Once a specification reaches the Candidate Recommendation stage, non-experimental implementations are possible, and implementors should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec.

To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group.

Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at https://www.w3.org/Style/CSS/Test/. Questions should be directed to the public-css-testsuite@w3.org mailing list.

References - 引用

Normative References - 规范性参考文献

… 略去,请见网页

Informative References - 参考资料

… 略去,请见网页

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值