Filters
Apply Instagram-like filter effects to images.
import { filter } from '@skeletonlabs/skeleton';
Demo
Add each filter you plan to use within the scope of your filtered elements. To use globally throughout your application, add this to your application's root layout. Avoid importing filters you are not using.
Applying a Filter
Use either of the two methods below to apply your desired filter. The hash mark is required.
Use the following Svelte action to filter any element. Pass the filter name as the only parameter.
import { filter } from '@skeletonlabs/skeleton';
<img src={myImageSrc} use:filter={'#BlueNight'}>
How It Works
This feature is enabled by the use of native browser SVG filters via feColorMatrix transformations.
Create a Custom Filter
Use this tool by Rik Schennink to easily generate your own custom filters.
Browser Support
Please be aware that browser support varies for this feature. Some filters are not functional in Safari, while Firefox is not supported at all. For non-supported browsers the filter will not be present but the image will still display, which allows for progressive enhancement.