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

@servicetitan/tokens

Package Overview
Dependencies
Maintainers
6
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@servicetitan/tokens - npm Package Compare versions

Comparing version 11.5.3-develop.0 to 11.6.0

dist/Anvil.kt

74

package.json
{
"name": "@servicetitan/tokens",
"version": "11.5.3-develop.0",
"description": "",
"homepage": "https://anvil.servicetitan.com",
"repository": {
"type": "git",
"url": "github:servicetitan/pritchel"
},
"main": "build/web/index.js",
"scripts": {
"build": "run-s clean build:*",
"build:web": "node ./build-web.js",
"build:swift": "node ./build-swift.js",
"build:jetpack": "node ./build-kotlin.js",
"build:figma": "node ./build-figma.js",
"clean": "rm -rf build && echo \"Cleaning build folder\"",
"test": "echo \"Error: no test specified\" && exit 1",
"release": "auto shipit --dry-run && cli-confirm \"Are you sure the changes look correct?\" && npm run build && auto shipit"
},
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@auto-it/first-time-contributor": "^10.36.5",
"@auto-it/omit-release-notes": "^10.36.5",
"@auto-it/released": "^10.36.5",
"auto": "^10.36.5",
"cli-confirm": "^1.0.1",
"handlebars": "^4.7.7",
"lodash": "^4.17.21",
"npm-run-all": "^4.1.5",
"sass": "^1.50.1",
"style-dictionary": "latest",
"tinycolor2": "^1.4.2"
}
"name": "@servicetitan/tokens",
"version": "11.6.0",
"description": "",
"homepage": "https://anvil.servicetitan.com",
"repository": {
"type": "git",
"url": "github:servicetitan/anvil",
"directory": "packages/tokens"
},
"main": "./dist/tokens.js",
"scripts": {
"start": "npm-run-all watch --silent",
"build": "npm-run-all build:init build:style-dictionary --silent",
"build:init": "rimraf dist",
"build:style-dictionary": "npm-run-all build:variables build:typescript build:message",
"build:variables": "node ./build.js",
"build:typescript": "tsc",
"prebuild:message": "echo \" \"",
"build:message": "echo \"🎉 Anvil Tokens built\"",
"postbuild:message": "echo \" \"",
"watch": "chokidar \"src/**/*.*\" -c \"npm run build\""
},
"files": [
"dist",
"readme.md"
],
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@types/node": "16.9.1",
"chokidar-cli": "3.0.0",
"core-js": "3.17.3",
"npm-run-all": "4.1.5",
"rimraf": "3.0.2",
"style-dictionary": "3.0.2",
"typescript": "4.4.3"
},
"gitHead": "57bea051dfc1e6cdf2275352a0e17301ee22620f"
}

@@ -1,26 +0,44 @@

# Project information
https://servicetitan.atlassian.net/wiki/spaces/ADS/pages/2205188101/Pritchel
# Anvil Tokens
The design tokens project is available to use in developing custom components and UI that is also used in `@servicetitan/design-system`. It contains variables in SCSS, Less, and JS variables that can be imported into any type of project.
# How it works
## Installation
```
npm install @servicetitan/tokens --save
```
All of the design tokens and assets are in this package. This package has iOS(Swift), Android(Jetpack), and web code.
Within the packages `dist/` directory there are a few files that can be used.
To get started, run
| File | Description |
| ---------------- | ---------------------------------------- |
| tokens.common.js | JS object of variables as module.exports |
| tokens.less | Less variables |
| tokens.scss | SCSS variables |
## Using Less Tokens
```
$ npm install
$ npm run build
@import (reference) '~@servicetitan/tokens/dist/tokens.less';
div {
color: @color-blue;
}
```
The npm build task is what performs the style dictionary build steps to generate the files for each platform. Every time you change something in the style dictionary, like changing colors or adding design tokens, you will have to run this command again to generate the files.
## Using SCSS Tokens
# Adding new theme
```
@import 'node_modules/@servicetitan/tokens/dist/tokens';
Source of all that is generated is at `tokens/themes/<theme name>`. Copy a theme to base on and make changes to the values and that's all you have to do. Don't forget that we also have Figma assets that needs to be created for a new theme.
div {
color: $color-blue;
}
```
# Updating existing token
> Align with Anvil team before proceeding
## Using JS Tokens
1. Make a branch
2. Update the token object located under `tokens/themes/<theme name>` with the new value
3. run `npm run build` to build all assets
4. Make a PR
```
import tokens from '@servicetitan/tokens';
const Component = () => <div style={{backgroundColor: tokens.colorBlue}} />
```
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