🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@cultureamp/kaizen-binary-assets

Package Overview
Dependencies
Maintainers
6
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cultureamp/kaizen-binary-assets

Binary asset management for Culture Amp's Kaizen Design System.

1.2.1
latest
Source
npm
Version published
Weekly downloads
1
-83.33%
Maintainers
6
Weekly downloads
 
Created
Source

Kaizen Binary Assets

Binary asset management for Culture Amp's Kaizen Design System.

API

assetUrl(path)

Returns the full URL of the asset at path managed by the kaizen-design-system-assets service.

TypeScript/JavaScript

assetUrl("some/blob.png") // -> "https://<origin>/some/blob.png"

SCSS

asset-url("some/blob.png") // -> "https://<origin>/some/blob.png"

If you want to use an image

  • Make sure the image exists in the kaizen-design-system-assets repo. If it doesn't, make a PR to add it (ask the Design Systems team for review). Images in this repo will be automatically uploaded and made available via a CloudFront distribution.
  • Make sure that the @cultureamp/kaizen-binary-assets package is in your repo's package.json. This package provides you the assetUrl function that translates the path to the file in the kaizen-design-system-assets repo into its equivalent CloudFront URL.
  • Import the index.ts or index.scss file and you can access the image through the assetUrl/asset-url function:
// JS
import assetUrl from "@cultureamp/kaizen-binary-assets/lib/index.ts";

<SomeComponent image={assetUrl("illustrations/ham.png")} />
// SCSS
@import "~@cultureamp/kaizen-binary-assets/lib/index.scss";

.coolpic {
  background-image: url(asset-url("illustrations/ham.png"));
}

See also

FAQs

Package last updated on 19 Dec 2019

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