Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

home-assistant-styles-manager

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

home-assistant-styles-manager

Manage Home Assistant styles per DOM elements

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27
decreased by-63.51%
Maintainers
0
Weekly downloads
 
Created
Source

home-assistant-styles-manager

Manage Home Assistant styles per DOM elements

Deployment Status Tests Coverage Status npm version downloads

Install

npm
npm install home-assistant-styles-manager
yarn
yarn add home-assistant-styles-manager
PNPM
pnpm add home-assistant-styles-manager

API

Class instantiation

The HomeAssistantStylesManager class can be instantiated sending an optional options object.

new HomeAssistantStylesManager([options])
Options object
ParameterOptionalDescription
prefixyesprefix that will be used for the styles ids
delayyesnamespace that will be used for the warnings

Public methods

getStyleElement

Given an HTMLElement or a ShadowRoot element, returns the style element associated with it.

getStyleElement(root: HTMLElement | ShadowRoot): HTMLStyleElement | null
addStyle

Given a CSS string or a CSS object and an HTMLElement or a ShadowRoot element, it adds a style element containing the CSS string or replace its content with the CSS string if it already exists.

addStyle(
  css: string | Record<string, Record<string, string> | false>,
  root: HTMLElement | ShadowRoot
): void
removeStyle

Given an HTMLElement or a ShadowRoot element, it removes the style element associated to it (if it exists).

removeStyle(root: HTMLElement | ShadowRoot): void

Keywords

FAQs

Package last updated on 06 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc