---
title: "CSSRule | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Interface CSSRule

The **`CSSRule`** interface represents a single CSS rule. There are several types of rules which inherit properties from CSSRule.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule)

interface CSSRule {  
    [CHARSET\_RULE](#charset_rule): 2;  
    [COUNTER\_STYLE\_RULE](#counter_style_rule): 11;  
    [cssText](#csstext): string;  
    [FONT\_FACE\_RULE](#font_face_rule): 5;  
    [FONT\_FEATURE\_VALUES\_RULE](#font_feature_values_rule): 14;  
    [IMPORT\_RULE](#import_rule): 3;  
    [KEYFRAME\_RULE](#keyframe_rule): 8;  
    [KEYFRAMES\_RULE](#keyframes_rule): 7;  
    [MARGIN\_RULE](#margin_rule): 9;  
    [MEDIA\_RULE](#media_rule): 4;  
    [NAMESPACE\_RULE](#namespace_rule): 10;  
    [PAGE\_RULE](#page_rule): 6;  
    [parentRule](#parentrule): CSSRule | null;  
    [parentStyleSheet](#parentstylesheet): [CSSStyleSheet](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleSheet/) | null;  
    [STYLE\_RULE](#style_rule): 1;  
    [SUPPORTS\_RULE](#supports_rule): 12;  
    [type](#type): number;  
}

##### Index

### Properties[](#properties)

[CHARSET\_RULE](#charset_rule) [COUNTER\_STYLE\_RULE](#counter_style_rule) [cssText](#csstext) [FONT\_FACE\_RULE](#font_face_rule) [FONT\_FEATURE\_VALUES\_RULE](#font_feature_values_rule) [IMPORT\_RULE](#import_rule) [KEYFRAME\_RULE](#keyframe_rule) [KEYFRAMES\_RULE](#keyframes_rule) [MARGIN\_RULE](#margin_rule) [MEDIA\_RULE](#media_rule) [NAMESPACE\_RULE](#namespace_rule) [PAGE\_RULE](#page_rule) [parentRule](#parentrule) [parentStyleSheet](#parentstylesheet) [STYLE\_RULE](#style_rule) [SUPPORTS\_RULE](#supports_rule) [type](#type)

## Properties[](#properties-1)

### `Readonly`CHARSET\_RULE[](#charset_rule)

CHARSET\_RULE: 2

### `Readonly`COUNTER\_STYLE\_RULE[](#counter_style_rule)

COUNTER\_STYLE\_RULE: 11

### cssText[](#csstext)

cssText: string

The **`cssText`** property of the CSSRule interface returns the actual text of a CSSStyleSheet style-rule.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/cssText)

### `Readonly`FONT\_FACE\_RULE[](#font_face_rule)

FONT\_FACE\_RULE: 5

### `Readonly`FONT\_FEATURE\_VALUES\_RULE[](#font_feature_values_rule)

FONT\_FEATURE\_VALUES\_RULE: 14

### `Readonly`IMPORT\_RULE[](#import_rule)

IMPORT\_RULE: 3

### `Readonly`KEYFRAME\_RULE[](#keyframe_rule)

KEYFRAME\_RULE: 8

### `Readonly`KEYFRAMES\_RULE[](#keyframes_rule)

KEYFRAMES\_RULE: 7

### `Readonly`MARGIN\_RULE[](#margin_rule)

MARGIN\_RULE: 9

### `Readonly`MEDIA\_RULE[](#media_rule)

MEDIA\_RULE: 4

### `Readonly`NAMESPACE\_RULE[](#namespace_rule)

NAMESPACE\_RULE: 10

### `Readonly`PAGE\_RULE[](#page_rule)

PAGE\_RULE: 6

### `Readonly`parentRule[](#parentrule)

parentRule: CSSRule | null

The **`parentRule`** property of the CSSRule interface returns the containing rule of the current rule if this exists, or otherwise returns null.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/parentRule)

### `Readonly`parentStyleSheet[](#parentstylesheet)

parentStyleSheet: [CSSStyleSheet](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleSheet/) | null

The **`parentStyleSheet`** property of the CSSRule interface returns the StyleSheet object in which the current rule is defined.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/parentStyleSheet)

### `Readonly`STYLE\_RULE[](#style_rule)

STYLE\_RULE: 1

### `Readonly`SUPPORTS\_RULE[](#supports_rule)

SUPPORTS\_RULE: 12

### `Readonly`type[](#type)

type: number

The read-only **`type`** property of the CSSRule interface is a deprecated property that returns an integer indicating which type of rule the CSSRule represents.

#### Deprecated[](#deprecated)

[MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRule/type)
