Shady
🌒 Customizable vignettes for your images
Install
npm install --save sass-shady
Usage
Shady is intended to be used as a semantic mixin on media containers. It works by wrapping the media with a pseudo-element that holds the vignette as a CSS3 Gradient. The markup needed should look somewhat like this (semantics and class-names are up to you):
<!--The image-container will have position:relative applied to it and work as an achor for vignette--> <!-- The caption will be staying readable no matter what when positioned ontop of the vignette--> Shady Test Caption
Mixin
// Basic example // This will apply the vignette referenced as "bottom" in $shady-presets .vignette-container // Default vignette // This will apply the vignette defined .vignette-container // Custom vignette // You can apply custom vignettes that are not defined in a preset by using @content and passing "custom" to the mixin .vignette-container
Options
/// Color used in the default presets /// @property {String} ; /// Available presets /// @property {Map} ; /// Default preset /// @property {String} ; /// Shady can expose each preset as a class /// By default, the class will be named: .shady--{preset} /// @property {Boolean} ;
Presets
The default presets are defined in ./scss/shady/_presets
. They are gradients bound to variables grouped under the $shady-preset
namespace. You can supply your own presets by specifying them in the mentioned file or before shady is imported.
// Sample preset ;
Default Presets:
bottom
: Bottom shadedbottomTop
: Bottom & Top shadedfull
: Fully shadedtop
: Top Shaded
Build:
You can develop shady locally by using the supplied gulpfile and the test-folder. You can build a sassdoc-reference for this repository by running gulp sassdoc
.