Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
home-assistant-styles-manager
Advanced tools
Manage Home Assistant styles per DOM elements
npm install home-assistant-styles-manager
yarn add home-assistant-styles-manager
pnpm add home-assistant-styles-manager
The HomeAssistantStylesManager
class can be instantiated sending an optional options object.
new HomeAssistantStylesManager([options])
Parameter | Optional | Default | Description |
---|---|---|---|
prefix | yes | ha-styles-manager | prefix that will be used for the styles ids |
namespace | yes | home-assistant-styles-manager | namespace that will be used for the warnings |
throwWarnings | yes | true | indicates if the library should throw warnings |
Given an HTMLElement
or a ShadowRoot
element, returns the style element associated with it.
getStyleElement(root: HTMLElement | ShadowRoot): HTMLStyleElement | null
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 | CSSInJs | (string | CSSInJs)[],
root: HTMLElement | ShadowRoot
): void
The css
property can be a CSS string but also a CSS-in-JS object or an array of CSS-in-JS objects and strings. Any rule with a false
value will get hidden.
For eaxample, the next CSS-in-JS object:
{
'.some-rule': {
backgroundColor: 'red',
SomeVariable: '10px'
},
'.hide-rule': false
}
Will be compiled to:
.some-rule {
background-color: red;
--some-variable: 10px;
}
.hide-rule {
display: none !important;
}
Given an HTMLElement
or a ShadowRoot
element, it removes the style element associated to it (if it exists).
removeStyle(root: HTMLElement | ShadowRoot): void
FAQs
Manage Home Assistant styles per DOM elements
The npm package home-assistant-styles-manager receives a total of 18 weekly downloads. As such, home-assistant-styles-manager popularity was classified as not popular.
We found that home-assistant-styles-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.