https://github.com/brandonhimpfen/gradient-css-generator
A package that helps generate CSS gradients.
https://github.com/brandonhimpfen/gradient-css-generator
css css-gradient gradient gradient-css
Last synced: 10 months ago
JSON representation
A package that helps generate CSS gradients.
- Host: GitHub
- URL: https://github.com/brandonhimpfen/gradient-css-generator
- Owner: brandonhimpfen
- License: mit
- Created: 2023-06-19T21:32:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-19T21:46:25.000Z (over 2 years ago)
- Last Synced: 2024-05-02T01:08:53.787Z (over 1 year ago)
- Topics: css, css-gradient, gradient, gradient-css
- Language: JavaScript
- Homepage: https://www.himpfen.com/gradient-css-generator/
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gradient-css-generator
A package that helps generate CSS gradients.
## Installation
Install the package using npm:
```
npm install gradient-css-generator
```
## Usage
```
const generateGradient = require('gradient-css-generator');
const cssGradient = generateGradient('#ff0000', '#00ff00', 'to right');
console.log(cssGradient);
```
The `generateGradient` function takes three parameters:
`startColor`: The starting color of the gradient in hex format.
`endColor`: The ending color of the gradient in hex format.
`direction`: The direction of the gradient (e.g., `'to top'`, `'to bottom'`, `'to left'`, `'to right'`). The default is `'to bottom'`.
The function returns a CSS gradient string that you can use in your stylesheets.