Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.98 KB

index.md

File metadata and controls

57 lines (40 loc) · 1.98 KB
title slug page-type tags browser-compat
CSS
Web/API/CSS
web-api-interface
API
CSSOM
Interface
Painting
Reference
api.CSS

{{APIRef("CSSOM")}}

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.

Static properties

  • {{DOMxRef("CSS.highlights")}} {{Experimental_Inline}}
    • : Provides access to the HighlightRegistry used to style arbitrary text ranges using the {{domxref("css_custom_highlight_api", "CSS Custom Highlight API", "", "nocode")}}.
  • {{DOMxRef("CSS.paintWorklet")}} {{Experimental_Inline}} {{SecureContext_Inline}}
    • : Provides access to the Worklet responsible for all the classes related to painting.

Instance 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 methods

No inherited static methods.

  • {{DOMxRef("CSS.registerProperty()")}} {{Experimental_Inline}}

    • : Registers {{cssxref('--*', 'custom properties')}}, allowing for property type checking, default values, and properties that do or do not inherit their value.
  • {{DOMxRef("CSS.supports()")}}

    • : Returns a boolean value indicating if the pair property-value, or the condition, given in parameter is supported.
  • {{DOMxRef("CSS.escape()")}}

    • : Can be used to escape a string mostly for use as part of a CSS selector.
  • {{DOMxRef("CSS.factory_functions", '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"}

Instance methods

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}