Socket
Socket
Sign inDemoInstall

@gradient-js/css

Package Overview
Dependencies
2
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @gradient-js/css

Gradient-js css generation module


Version published
Maintainers
1
Created

Readme

Source

@gradient-js/css

gradient-js module for css gradient generation

License: MIT

Installation

CLI

Yarn
yarn add @gradient-js/css
Npm
npm install --save @gradient-js/css

CDN

<script src="https://unpkg.com/gradient-js/css@x.x.x/css.js">

Usage

import { Css } from '@gradient-js/css';

const css = new Css();
const gradient = css.get(colors, config);

Inputs

In order to create a gradient you will need to pass an array of colors and an options object to the Css' get method. colors should be an array of strings in any valid css format (rgb(a), hex or hsl(a)). options object consists of the CoreOptions and following properties:

type CssOptions = CoreOptions & {
  type: 'linear' | 'radial';
  angle?: number;
  left?: number;
  top?: number;
  shape?: 'ellipse' | 'circle';
  extentKeyword?: 'none' | 'closest-side' | 'closest-corner' | 'farthest-side' | 'farthest-corner';
};

Where each property can be described as it follows:

OptionTypeDescription
type'linear' or 'radial'CSS gradient type - linear or radial
anglenumberApplied to linear gradients only
leftnumberApplied to radial gradients only
topnumberApplied to radial gradients only
shape'ellipse' or 'circle'Applied to radial gradients only
extentKeyword'none' or 'closest-side' or 'closest-corner' or 'farthest-side' or 'farthest-corner'Applied to radial gradients only

Keywords

FAQs

Last updated on 01 Aug 2020

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