Skip to content

避免使用 CSS-wide keywords #15

@yisibl

Description

@yisibl

CSS 规范中定义了一些保留关键字,我们应该在 <custom-ident> 中避免使用这些值。历史遗留原因,虽然当前某些浏览器支持这些值,但在将来可能会禁用,这会导致相关 CSS 失效。

TODO: CSS 示例

详见:

这些关键字当前散落在不同的规范,包括:

css-values-4

https://www.w3.org/TR/css-values-4/#common-keywords

Defined:

  • initial
  • inherit
  • unset

css-cascade-4

https://drafts.csswg.org/css-cascade/#defaulting-keywords

Defined:

  • initial
  • inherit
  • unset
  • revert

css-cascade-5

https://drafts.csswg.org/css-cascade-5/#revert-layer

Defined:

  • initial
  • inherit
  • unset
  • revert
  • revert-layer

css-values-4

https://www.w3.org/TR/css-values-4/#ref-for-css-wide-keywords

The CSS-wide keywords are not valid <custom-ident>s. The default keyword is reserved and is also not a valid <custom-ident>

There is a default keyword.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions