All Projects → larsenwork → Postcss Easing Gradients

larsenwork / Postcss Easing Gradients

Licence: mit
PostCSS plugin to create smooth linear-gradients that approximate easing functions.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Postcss Easing Gradients

postcss-gtk
Processes GTK+ CSS into browser CSS
Stars: ✭ 23 (-96.66%)
Mutual labels:  postcss, postcss-plugin
postcss-define-function
PostCSS plugin for Sass-like function directive
Stars: ✭ 25 (-96.37%)
Mutual labels:  postcss, postcss-plugin
postcss-font-pack
PostCSS plugin to simplify font declarations by validating only configured font packs are used and adding fallbacks.
Stars: ✭ 18 (-97.39%)
Mutual labels:  postcss, postcss-plugin
postcss-purgecss
PostCSS plugin for purgecss
Stars: ✭ 92 (-86.65%)
Mutual labels:  postcss, postcss-plugin
postcss-relaxed-unit
🍮Postcss-relaxed-unit is a postcss plugin for unit tranformation and make write css easier with custom unit.
Stars: ✭ 44 (-93.61%)
Mutual labels:  postcss, postcss-plugin
postcss-prefixwrap
A PostCSS plugin that is used to wrap css styles with a css selector to constrain their affect on parent elements in a page.
Stars: ✭ 54 (-92.16%)
Mutual labels:  postcss, postcss-plugin
postcss-clean
PostCss plugin to minify your CSS with clean-css
Stars: ✭ 41 (-94.05%)
Mutual labels:  postcss, postcss-plugin
postcss-styl
PostCSS parser plugin for converting Stylus syntax to PostCSS AST.
Stars: ✭ 15 (-97.82%)
Mutual labels:  postcss, postcss-plugin
postcss-sort-media-queries
PostCSS plugin for combine and sort CSS media queries with mobile first or desktop first methods.
Stars: ✭ 118 (-82.87%)
Mutual labels:  postcss, postcss-plugin
postcss-aspect-ratio
A PostCSS plugin to fix an element's dimensions to an aspect ratio.
Stars: ✭ 38 (-94.48%)
Mutual labels:  postcss, postcss-plugin
postcss
No description or website provided.
Stars: ✭ 59 (-91.44%)
Mutual labels:  postcss, postcss-plugin
Postcss Responsive Type
Automagical responsive typography, built on PostCSS
Stars: ✭ 363 (-47.31%)
Mutual labels:  postcss, postcss-plugin
postcss-rename
Replace class names based on a customizable renaming scheme.
Stars: ✭ 77 (-88.82%)
Mutual labels:  postcss, postcss-plugin
postcss-windicss
PostCSS integrations for Windi CSS
Stars: ✭ 33 (-95.21%)
Mutual labels:  postcss, postcss-plugin
postcss-critical-css
PostCSS plugin to define and output critical CSS using custom atRules, and/or custom CSS properties. Critical CSS may be output to one or more files, as defined within the plugin options or within the CSS.
Stars: ✭ 84 (-87.81%)
Mutual labels:  postcss, postcss-plugin
postcss-lazyimagecss
A PostCSS plugin that generates images's CSS width & height properties automatically.
Stars: ✭ 38 (-94.48%)
Mutual labels:  postcss, postcss-plugin
postcss-import-url
PostCSS plugin inlines remote files.
Stars: ✭ 47 (-93.18%)
Mutual labels:  postcss, postcss-plugin
postcss-inline-media
Media queries shortcut, built on PostCSS, example: font-size: 20px @1200 18px @480 16px;
Stars: ✭ 47 (-93.18%)
Mutual labels:  postcss, postcss-plugin
postcss-typed-css-classes
PostCSS plugin that generates typed entities from CSS classes for chosen programming language.
Stars: ✭ 12 (-98.26%)
Mutual labels:  postcss, postcss-plugin
postcss-momentum-scrolling
PostCSS plugin add 'momentum' style scrolling behavior (-webkit-overflow-scrolling: touch) for elements with overflow (scroll, auto) on iOS
Stars: ✭ 69 (-89.99%)
Mutual labels:  postcss, postcss-plugin

PostCSS Easing Gradients

NPM Version NPM Monthly Downloads Build Status Dependency status
MIT License Code Style: Prettier Follow Larsenwork on Twitter

PostCSS plugin to create smooth linear-gradients that approximate easing functions. Visual examples and online editor on larsenwork.com/easing-gradients

Code Examples

.cubic-bezier {
  background: linear-gradient(to bottom, black, cubic-bezier(0.48, 0.3, 0.64, 1), transparent);
  /* => */
  background: linear-gradient(
    to bottom,
    hsl(0, 0%, 0%),
    hsla(0, 0%, 0%, 0.94505) 7.9%,
    hsla(0, 0%, 0%, 0.88294) 15.3%,
    hsla(0, 0%, 0%, 0.81522) 22.2%,
    hsla(0, 0%, 0%, 0.7426) 28.7%,
    hsla(0, 0%, 0%, 0.66692) 34.8%,
    hsla(0, 0%, 0%, 0.58891) 40.6%,
    hsla(0, 0%, 0%, 0.50925) 46.2%,
    hsla(0, 0%, 0%, 0.42866) 51.7%,
    hsla(0, 0%, 0%, 0.34817) 57.2%,
    hsla(0, 0%, 0%, 0.2693) 62.8%,
    hsla(0, 0%, 0%, 0.19309) 68.7%,
    hsla(0, 0%, 0%, 0.12126) 75.2%,
    hsla(0, 0%, 0%, 0.05882) 82.6%,
    hsla(0, 0%, 0%, 0.01457) 91.2%,
    hsla(0, 0%, 0%, 0)
  );
}

.ease {
  background: linear-gradient(green, ease, red);
  /* => */
  background: linear-gradient(
    hsl(120, 100%, 25.1%),
    hsl(88.79, 100%, 24.28%) 7.8%,
    hsl(69.81, 100%, 23.14%) 13.2%,
    hsl(53.43, 100%, 24.55%) 17.6%,
    hsl(42.52, 100%, 28.9%) 21.7%,
    hsl(34.96, 100%, 32.64%) 25.8%,
    hsl(29.1, 100%, 35.96%) 30.2%,
    hsl(24.26, 100%, 38.94%) 35.1%,
    hsl(20.14, 100%, 41.56%) 40.6%,
    hsl(16.47, 100%, 43.87%) 46.9%,
    hsl(13.13, 100%, 45.83%) 54.1%,
    hsl(10.07, 100%, 47.42%) 62.2%,
    hsl(7.23, 100%, 48.62%) 71.1%,
    hsl(4.6, 100%, 49.43%) 80.6%,
    hsl(2.16, 100%, 49.87%) 90.5%,
    hsl(0, 100%, 50%)
  );
}

.steps {
  background: linear-gradient(to right, green, steps(4, skip-none), red);
  /* => */
  background: linear-gradient(
    to right,
    hsl(120, 100%, 25.1%),
    hsl(120, 100%, 25.1%) 25%,
    hsl(42.59, 100%, 28.87%) 25%,
    hsl(42.59, 100%, 28.87%) 50%,
    hsl(21.3, 100%, 40.82%) 50%,
    hsl(21.3, 100%, 40.82%) 75%,
    hsl(0, 100%, 50%) 75%,
    hsl(0, 100%, 50%)
  );
}

.radial {
  background: radial-gradient(circle at top right, red, ease-in-out, blue);
  /* => */
  background: radial-gradient(
    circle at top right,
    hsl(0, 100%, 50%),
    hsl(353.5, 100%, 49.71%) 7.7%,
    hsl(347.13, 100%, 48.89%) 14.8%,
    hsl(341.1, 100%, 47.69%) 21%,
    hsl(335.24, 100%, 46.22%) 26.5%,
    hsl(329.48, 100%, 44.57%) 31.4%,
    hsl(323.63, 100%, 42.76%) 35.9%,
    hsl(317.56, 100%, 40.82%) 40.1%,
    hsl(310.92, 100%, 38.7%) 44.2%,
    hsl(303.81, 100%, 36.49%) 48.1%,
    hsl(296, 100%, 36.55%) 52%,
    hsl(288.73, 100%, 38.81%) 56%,
    hsl(282.14, 100%, 40.92%) 60.1%,
    hsl(276.09, 100%, 42.84%) 64.3%,
    hsl(270.27, 100%, 44.64%) 68.8%,
    hsl(264.54, 100%, 46.28%) 73.7%,
    hsl(258.7, 100%, 47.74%) 79.2%,
    hsl(252.68, 100%, 48.92%) 85.4%,
    hsl(246.32, 100%, 49.72%) 92.5%,
    hsl(240, 100%, 50%)
  );
}

Syntax

Currently a subset of the full syntax is supported:

linear-gradient(
  [ <direction>,]?
  <color>,
  <animation-timing-function>,
  <color>
)

The steps syntax is also being figured out and currently this is supported.


Usage

postcss([require('postcss-easing-gradients')])

See PostCSS Usage docs for examples for your environment.


Options

colorStops: 15

is the default. A lower number creates a more "low poly" gradient with less code but a higher risk of banding.

alphaDecimals: 5

is the default. A lower number can result in banding.

colorMode: 'lrgb'

is the default color space used for interpolation and is closest to what most browsers use. Other options are 'rgb', 'hsl', 'lab' and 'lch' as per chromajs documentation

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].