Skip to content

避免使用 CSS-wide keywords #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yisibl opened this issue Jul 15, 2022 · 0 comments
Open

避免使用 CSS-wide keywords #15

yisibl opened this issue Jul 15, 2022 · 0 comments

Comments

@yisibl
Copy link
Contributor

yisibl commented Jul 15, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant