W3cubDocs

/DOM

CSS

The CSS interface holds useful CSS-related methods. No object with this interface are implemented: it contains only static methods and therefore is 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
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.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.

Specifications

Specification Status Comment
CSS Painting API Level 1
The definition of 'paintWorklet' in that specification.
Working Draft Adds the paintWorklet static property.
CSS Object Model (CSSOM)
The definition of 'CSS' in that specification.
Working Draft Adds the escape() static method.
CSS Conditional Rules Module Level 3
The definition of 'CSS' in that specification.
Candidate Recommendation Initial definition

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 28 Yes 22
22
20
Disabled
Disabled From version 20: this feature is behind the layout.css.supports-rule.enabled preference. To change preferences in Firefox, visit about:config.
No 12.1 No
ch 66 No No No 53 No
cm 66 No No No 53 No
deg 66 No No No 53 No
dpcm 66 No No No 53 No
dpi 66 No No No 53 No
dppx 66 No No No 53 No
em 66 No No No 53 No
escape 46 ? 31 No No No
ex 66 No No No 53 No
fr 66 No No No 53 No
grad 66 No No No 53 No
Hz 66 No No No 53 No
in 66 No No No 53 No
ic No No No No No No
kHz 66 No No No 53 No
lh No No No No No No
mm 66 No No No 53 No
ms 66 No No No 53 No
number 66 No No No 53 No
paintWorklet 65 No ? No 52 No
pc 66 No No No 53 No
percent 66 No No No 53 No
pt 66 No No No 53 No
px 66 No No No 53 No
Q 66 No No No 53 No
rad 66 No No No 53 No
rlh No No No No No No
rem 66 No No No 53 No
s 66 No No No 53 No
supports 61
61
28
Version 60 or older didn't support parentheses-less one-argument version.
Partial
Partial
Edge doesn't support parentheses-less one-argument version.
55
55
22
Version 54 or older didn't support parentheses-less one-argument version.
20
Disabled
Disabled From version 20: this feature is behind the layout.css.supports-rule.enabled preference. To change preferences in Firefox, visit about:config.
No 12.1 No
turn 66 No No No 53 No
vb No No No No No No
vh 66 No No No 53 No
vi No No No No No No
vmax 66 No No No 53 No
vw 66 No No No 53 No
wmin 66 No No No 53 No
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support 66 Yes Yes 22
22
20
Disabled
Disabled From version 20: this feature is behind the layout.css.supports-rule.enabled preference. To change preferences in Firefox, visit about:config.
12.1 No ?
ch 66 66 No No 53 No ?
cm 66 66 No No 53 No ?
deg 66 66 No No 53 No ?
dpcm 66 66 No No 53 No ?
dpi 66 66 No No 53 No ?
dppx 66 66 No No 53 No ?
em 66 66 No No 53 No ?
escape ? No ? 31 No No ?
ex 66 66 No No 53 No ?
fr 66 66 No No 53 No ?
grad 66 66 No No 53 No ?
Hz 66 66 No No 53 No ?
in 66 66 No No 53 No ?
ic No No No No No No No
kHz 66 66 No No 53 No ?
lh No No No No No No No
mm 66 66 No No 53 No ?
ms 66 66 No No 53 No ?
number 66 66 No No 53 No ?
paintWorklet Yes Yes No ? 52 No ?
pc 66 66 No No 53 No ?
percent 66 66 No No 53 No ?
pt 66 66 No No 53 No ?
px 66 66 No No 53 No ?
Q 66 66 No No 53 No ?
rad 66 66 No No 53 No ?
rlh No No No No No No No
rem 66 66 No No 53 No ?
s 66 66 No No 53 No ?
supports 61
61
37
Version 60 or older didn't support parentheses-less one-argument version.
61
61
28
Version 60 or older didn't support parentheses-less one-argument version.
Partial
Partial
Edge doesn't support parentheses-less one-argument version.
55
55
22
Version 54 or older didn't support parentheses-less one-argument version.
20
Disabled
Disabled From version 20: this feature is behind the layout.css.supports-rule.enabled preference. To change preferences in Firefox, visit about:config.
12.1 No ?
turn 66 66 No No 53 No ?
vb No No No No No No No
vh 66 66 No No 53 No ?
vi No No No No No No No
vmax 66 66 No No 53 No ?
vw 66 66 No No 53 No ?
wmin 66 66 No No 53 No ?

See Also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CSS