2.1.1 • Published 12 months ago
@kaizen/hosted-assets v2.1.1
Kaizen Hosted Assets
Hosted assets used in 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-assetsrepo. 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
@kaizen/hosted-assetspackage is in your repo'spackage.json. This package provides you theassetUrlfunction that translates the path to the file in thekaizen-design-system-assetsrepo into its equivalent CloudFront URL. - Import the
@kaizen/hosted-assetspackage and you can access the image through theassetUrl/asset-urlfunction:
import { assetUrl } from "@kaizen/hosted-assets";
<SomeComponent
image={assetUrl("illustrations/plant-based-ham-substitute.png")}
/>// SCSS
@import "~@kaizen/hosted-assets/index";
.coolpic {
background-image: url(asset-url(
"illustrations/plant-based-ham-substitute.png"
));
}See also
2.1.1
12 months ago
2.1.0
1 year ago
0.0.0-canary-pnpm-20231212210008
2 years ago
2.0.3
3 years ago
2.0.2
3 years ago
2.0.1
3 years ago
2.0.0
4 years ago
1.2.0
4 years ago
1.1.1
5 years ago
1.1.1-canary.0
5 years ago
1.0.4-canary.87
5 years ago
1.1.0
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
6 years ago
1.0.0
6 years ago