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

# Interface CSSStyleDeclarationBase

The **`CSSStyleDeclaration`** interface is the base class for objects that represent CSS declaration blocks with different supported sets of CSS style information:

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

interface CSSStyleDeclarationBase {  
    [cssText](#csstext): string;  
    [length](#length): number;  
    [parentRule](#parentrule): [CSSRule](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSRule/) | null;  
    [getPropertyPriority](#getpropertypriority-1)(property: string): string;  
    [getPropertyValue](#getpropertyvalue-1)(property: string): string;  
    [item](#item-1)(index: number): string;  
    [removeProperty](#removeproperty-1)(property: string): string;  
    [setProperty](#setproperty-1)(  
        property: string,  
        value: string | null,  
        priority?: string,  
    ): void;  
    \[index: number\]: string;  
}

#### Hierarchy ([View Summary](https://docs.maptiler.com/sdk-js/api-reference/hierarchy/#Externals.CSSStyleDeclarationBase))

-   CSSStyleDeclarationBase
    -   [CSSStyleProperties](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleProperties/)

#### Indexable

-   \[index: number\]: string
    

##### Index

### Properties[](#properties)

[cssText](#csstext) [length](#length) [parentRule](#parentrule)

### Methods[](#methods)

[getPropertyPriority](#getpropertypriority) [getPropertyValue](#getpropertyvalue) [item](#item) [removeProperty](#removeproperty) [setProperty](#setproperty)

## Properties[](#properties-1)

### cssText[](#csstext)

cssText: string

The **`cssText`** property of the CSSStyleDeclaration interface returns or sets the text of the element's inline style declaration only.

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

### `Readonly`length[](#length)

length: number

The read-only property returns an integer that represents the number of style declarations in this CSS declaration block.

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

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

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

The **`CSSStyleDeclaration.parentRule`** read-only property returns a CSSRule that is the parent of this style block, e.g., a CSSStyleRule representing the style for a CSS selector.

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

## Methods[](#methods-1)

### getPropertyPriority[](#getpropertypriority)

-   getPropertyPriority(property: string): string[](#getpropertypriority-1)
    
    The **`CSSStyleDeclaration.getPropertyPriority()`** method interface returns a string that provides all explicitly set priorities on the CSS property.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyPriority)
    
    #### Parameters
    
    -   property: string
    
    #### Returns string
    

### getPropertyValue[](#getpropertyvalue)

-   getPropertyValue(property: string): string[](#getpropertyvalue-1)
    
    The **`CSSStyleDeclaration.getPropertyValue()`** method interface returns a string containing the value of a specified CSS property.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyValue)
    
    #### Parameters
    
    -   property: string
    
    #### Returns string
    

### item[](#item)

-   item(index: number): string[](#item-1)
    
    The **`CSSStyleDeclaration.item()`** method interface returns a CSS property name from a CSSStyleDeclaration by index.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/item)
    
    #### Parameters
    
    -   index: number
    
    #### Returns string
    

### removeProperty[](#removeproperty)

-   removeProperty(property: string): string[](#removeproperty-1)
    
    The **`CSSStyleDeclaration.removeProperty()`** method interface removes a property from a CSS style declaration object.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/removeProperty)
    
    #### Parameters
    
    -   property: string
    
    #### Returns string
    

### setProperty[](#setproperty)

-   setProperty(property: string, value: string | null, priority?: string): void[](#setproperty-1)
    
    The **`CSSStyleDeclaration.setProperty()`** method interface sets a new value for a property on a CSS style declaration object.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/setProperty)
    
    #### Parameters
    
    -   property: string
    -   value: string | null
    -   `Optional`priority: string
    
    #### Returns void
