Skip to content
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

Web API - CSS Properties and Values #67

Open
taoliujun opened this issue Mar 5, 2024 · 0 comments
Open

Web API - CSS Properties and Values #67

taoliujun opened this issue Mar 5, 2024 · 0 comments
Labels

Comments

@taoliujun
Copy link
Owner

CSS Properties and Values

MDN: https://developer.mozilla.org/en-US/docs/Web/API/CSS_Properties_and_Values_API

CSS Properties and Values用于为CSS扩展属性,

CSS variables有类似点,但后者只是一个变量,没有CSS属性之特性:比如继承特性。

接口

CSSPropertyRule

属性和值的定义描述。

syntax选项标识了值的预期语法,如<color>

方法

registerProperty

创建自定义css属性。

示例

示例:https://taoliujun.github.io/example/web-api/CSS_Properties_and_Values_API/index.html

  1. 两个Div使用了一样的样式,但registerProperty注册了非继承的属性,所以.parent1 .item1并未继承.parent1中设置的属性值,而使用了默认值。

image

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

No branches or pull requests

1 participant