Skip to content

juliandreas/vue-styled-shadows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c0d7ed9 · Sep 4, 2021

History

28 Commits
Jan 4, 2021
Aug 26, 2020
Aug 28, 2020
Aug 27, 2020
Aug 26, 2020
Aug 28, 2020
Aug 26, 2020
Aug 27, 2020
Sep 4, 2021
Sep 4, 2021
Aug 28, 2020
Aug 27, 2020
Aug 27, 2020
Aug 26, 2020

Repository files navigation

Vue Styled Shadows

Styled shadows for images. Supports SSR and IE11!

Demo

Installation

npm i vue-styled-shadows

Import

import Vue from 'vue';
import VueStyledShadows from 'vue-styled-shadows';

Vue.component('VueStyledShadows', VueStyledShadows);

SSR import (Nuxt for example)

import Vue from 'vue';
import VueStyledShadows from 'vue-styled-shadows/dist/vue-styled-shadows.ssr';
import 'vue-styled-shadows/dist/vue-styled-shadows.ssr.css';

Vue.component('VueStyledShadows', VueStyledShadows);

Usage

You can use the library without any props and it will use the default settings (see properties below).

<VueStyledShadows>
  <img />
</VueStyledShadows>

Options

You can also add more props to customize things like type, color and size etc.

<VueStyledShadows type="lines" position="bottomRight" margin="50" patternSize="3">
  <img />
</VueStyledShadows>

Properties

Name Type Default Description
type String dots Type of pattern [dots, lines, diagonal]
position String bottomLeft Shadow position [bottomLeft, bottomRight, topLeft, topRight]
margin [String, Number] 50 Margin between image and shadow
bgSize [String, Number] 40 Background size
patternSize [String, Number] 3 Pattern size
color1 String #504D2E Main color of pattern
color2 String transparent Secondary color of pattern (Only valid for dots and lines)
bgColor String transparent Background color
degree [String, Number] 45 Degree (Only valid for diagonal)
reverse Boolean false Reverse z-index between pattern and image
vssid String null Sets an id-attribute on the shadow (Useful for animations i.e.)
vssclass String null Sets a class-attribute on the shadow (Useful for animations i.e.)

License

MIT

About

Styled shadows for images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published