Socket
Socket
Sign inDemoInstall

@spscommerce/colors

Package Overview
Dependencies
0
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @spscommerce/colors

Design sanctioned colors for SPS Commerce libraries and applications compiled into various formats.


Version published
Weekly downloads
3
decreased by-81.25%
Maintainers
3
Install size
17.8 kB
Created
Weekly downloads
 

Readme

Source

@spscommerce/colors

Design approved colors distributed in various formats

SPS Commerce Version

I want to use existing colors, see availabe colors, or add or change colors.

Using Existing Colors

Ensure you have access to and have configured our private jFrog Artifactory npm registry.

npm install --save @spscommerce/colors

# OR

yarn add @spscommerce/colors

Finally, make sure that your CI environment is set up to be able to install from JFrog Artifactory. Your Jenkins user must have JFrog Artifactory permissions. Additionally you should have GH_TOKEN set in your jenkins so that builds can be pushed back to github. In order to do this we recommend setting up a github bot account. Make sure that the jenkins bot or jenkins bot group is added to all your new repos with write access. An example group is the Github group commerce-platform-bot-writable which contains a github user called jenkins-identity-service. This is required for it to create releases and to tag those releases back on Github. You can see our Dockerfile, run-build.sh (build a simple docker file), run-ci.sh (runs releases). We use semantic-release to release our builds. Other things to make sure that you do:

Add always-auth=true to your .npmrc file.

Here is our CI build step:

echo "About to remove old .npmrc file"
rm ~/.npmrc

# Dont show secrets in logs
set +x
JFROG_NPM_USERNAME='INSERT_JFROG_USER_HERE'
JFROG_NPM_PASSWORD='INSERT_JFROG_PASSWORD_HERE'
JFROG_NPM_EMAIL='webapps@spscommerce.com'
JFROG_NPM_PASSWORD_BASE64=$(echo $JFROG_NPM_PASSWORD | base64)
echo "Printing jfrog base64 pass"
echo $JFROG_NPM_PASSWORD_BASE64
GH_TOKEN="INSERT_GH_TOKEN_HERE"
cat >~/.npmrc <<EOL
init.author.name=SPS Commerce
init.author.email=webapps@spscommerce.com
init.author.url=https://www.spscommerce.com
init.license=UNLICENSED
always-auth=true
@spscommerce:registry=https://spscommerceinc.jfrog.io/spscommerceinc/api/npm/npm/
//spscommerceinc.jfrog.io/spscommerceinc/api/npm/npm/:_password=${JFROG_NPM_PASSWORD_BASE64}
//spscommerceinc.jfrog.io/spscommerceinc/api/npm/npm/:username=${JFROG_NPM_USERNAME}
//spscommerceinc.jfrog.io/spscommerceinc/api/npm/npm/:email=${JFROG_NPM_EMAIL}
//spscommerceinc.jfrog.io/spscommerceinc/api/npm/npm/:always-auth=true"
EOL
set -x
echo "Finished writing new .npmrc file"
./other/build-ci.sh
./other/run-ci.sh $GH_TOKEN $JFROG_NPM_USERNAME $JFROG_NPM_EMAIL

Note we don't pass any --build-arg or use the docker ENV directive because that would be stored in the docker history which is not good from a security perspective. The downside is that our build steps are a bit more complex.

Reusable instructions for your users

Before you actually use any color format in your package or application you will probably want to help developers understand how to use colors or add or change colors. You can do so by including the following instructions about @spscommerce/colors in your README.md:

### @spscommerce packages

This package uses the SPS Commerce private jFrog Artifactory NPM repository. You should make sure that you [have it configured](https://atlassian.spscommerce.com/wiki/display/STM/Getting+started+with+private+NPM+packages+in+jFrog+Artifactory) before using this package.

### Using colors

Colors in this project are sourced from [@spscommerce/colors](https://github.com/SPSCommerce/colors). See the [available colors](https://github.com/SPSCommerce/colors#available-colors).

### Adding or changing colors

If you would like to add or change a color then please follow the [@spscommerce/colors instructions](https://github.com/SPSCommerce/colors#adding-or-changing-colors). Once your color has been approved and @spscommerce/colors has been released to our private jFrog Artifactory NPM then come back here and upgrade to the latest version of @spscommerce/colors using `npm install --save @spscommerce/colors@latest` or `yarn add @spscommerce/colors@latest`. 

Now choose a format that you'd like to use. The following formats are available:

If you want more formats please open a pull request.

CommonJS

const colors, { red100 } = require('@spscommerce/colors');
console.log(colors.red100); // > #ffeaec
console.log(red100); // > #ffeaec

CSS Variables

@import 'path/to/node_modules/@spscommerce/colors/dist/colors.css';

.myclass {
    color: var(--gray400);
}

JSON

ln -s path/to/node_modules/@spscommerce/colors/dist/colors.json colors.json

Less

@import 'path/to/node_modules/@spscommerce/colors/dist/colors';

.myclass {
    color: @gray400;
}

SCSS

@import 'path/to/node_modules/@spscommerce/colors/dist/colors';

.myclass {
    color: $gray400;
}

YAML

ln -s path/to/node_modules/@spscommerce/colors/dist/colors.yml colors.yml

View this package on jFrog Artifactory on jFrog Artifactory

Available colors

white

white: #ffffff

black

black: #000000

gray100

gray100: #f6f6f6

gray200

gray200: #e8e9e9

gray300

gray300: #d2d4d5

gray400

gray400: #a5a9ab

gray500

gray500: #62686b

gray600

gray600: #1f282c

blue100

blue100: #d9f0fa

blue200

blue200: #00aae5

blue300

blue300: #0077aa

orange100

orange100: #fff4ea

orange200

orange200: #ff9632

orange300

orange300: #bf7025

yellow100

yellow100: #fff8e0

yellow200

yellow200: #fff0b3

yellow300

yellow300: #ffcc00

purple100

purple100: #f1e8ef

purple200

purple200: #883673

purple300

purple300: #743865

green100

green100: #eaf8f0

green200

green200: #32be6f

green300

green300: #258f53

red100

red100: #fce5ea

red200

red200: #eb0032

red300

red300: #b00025

Adding or Changing Colors

You can add a color using these steps:

  1. Fork and clone this repo then cd into it
  2. yarn or npm install
  3. Edit src/colors.json to add your color.
  4. Run yarn build or npm run build.
  5. You should now commit your changes using commitizen or the conventional-commit guidelines.
  6. Put in a pull request against the main repo. A new version of @spscommerce/colors should be released on merge.
  7. Finally, put in a new pull request to SPS-Styles to upgrade @spscommerce/colors to the latest version and to place the color in a color-group (if you added a new color).
  8. A new version should be released when your PR is merged into master. Voila!

Commands

yarn build  # Build files from src/ into dist/ and copies a markdown
            # representation of the colors into README.md's colors
            # section. You should commit README.md after this change.

yarn clean  # Delete all files in dist/

Keywords

FAQs

Last updated on 10 Dec 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc