CSS - Web APIs 编辑

The CSS interface holds useful CSS-related methods. No objects with this interface are implemented: it contains only static methods and is therefore a utilitarian interface.

Properties

The CSS interface is a utility interface and no object of this type can be created: only static properties are defined on it.

Static properties

CSS.paintWorklet This is an experimental API that should not be used in production code.Secure context
Provides access to the Worklet responsible for all the classes related to painting.

Methods

The CSS interface is a utility interface and no object of this type can be created: only static methods are defined on it.

Static methods

No inherited static methods.

CSS.registerProperty()
Registers custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.
CSS.supports()
Returns a Boolean indicating if the pair property-value, or the condition, given in parameter is supported.
CSS.escape()
Can be used to escape a string mostly for use as part of a CSS selector.
CSS factory functions
Can be used to return a new CSSUnitValue with a value of the parameter number of the units of the name of the factory function method used.
CSS.em(3) // CSSUnitValue {value: 3, unit: "em"}

Specifications

SpecificationStatusComment
CSS Painting API Level 1
The definition of 'paintWorklet' in that specification.
Working DraftAdds the paintWorklet static property.
CSS Object Model (CSSOM)
The definition of 'CSS' in that specification.
Working DraftAdds the escape() static method.
CSS Conditional Rules Module Level 3
The definition of 'CSS' in that specification.
Candidate RecommendationInitial definition

Browser compatibility

BCD tables only load in the browser

See Also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:130 次

字数:4476

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文