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

@vonage/vvd-context

Package Overview
Dependencies
Maintainers
45
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vonage/vvd-context

> TODO: description

  • 2.43.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
399
decreased by-20.2%
Maintainers
45
Weekly downloads
 
Created
Source

Introduction

Vivid components are fully taking care of their styling. Yet there are also a simple native HTML elements, that should also comply with the Vivid Design System.

For this reason we are providing Vivid Context service, responsible of mounting the Vivid styling into a document.

The service is optional, but most likely will be needed in any Vonage application.

Attention! vvd-context uses internally vvd-core, which sets up the core services like theming and typography, thus vvd-context user may safely omit any own setup of the core.

API

Attention! As an initial step, to provide smoother migration and lesser friction with an existing systems (especially those heavily dependent on Volta's legacy), we are scoping most of the Vivid context impact by special class: vivid-scope.

Please, put vivid-scope class at the root of the DOM tree, that is ready to be styled by Vivid.

Any new application should just safely put that class on the application DOM root (usually body).

mount(target)

Description:

Mounts Vivid context (styles) into the target scope / document. Default target is the document visible in the current scope. The API is idempotent, the style/s will be mounted only once, even if API called multiple times.

Params:

  • target - Document or DocumentFragment (including ShadowRoot); optional; defaults to document

Throws:

  • if the provided target argument is null or not of a type Document or DocumentFragment

Examples

Import
import vvdContext from '@vonage/vvd-context';
Mount context into the current document scope
vvdContext.mount();
Mount context into a document of choice
const shadowRoot = someElement.shadowRoot;
vvdContext.mount(shadowRoot);

FAQs

Package last updated on 10 Aug 2023

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