CSS library for Instagram filters
See the code
CSSGram is an Instagram filter library written in Sass and CSS.
Simply put, CSSgram is a library for editing your images with Instagram-like filters directly using CSS. What we're doing is adding filters to the images, as well as applying color and/or gradient overlays via various blending techniques to mimic filter effects. This means less manual image processing and more fun filter effects on the web!
We're using pseudo-elements (i.e. ::before and ::after) to create the filter effects, so you must apply these filters on a containing element (i.e. not a replaced element like <img>). The recommendation is to wrap your images in a <figure> tag. More about the tag here.
This library uses CSS Filters and CSS Blend Modes. These features are supported in the following browsers:
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|---|---|---|---|---|---|
| 43+ ✔ | 38+ ✔ | Nope ✘ | 13 ✔ | 32+ ✔ | 8+ ✔ |
For more information, check on Can I Use.
There are currently 2 ways to consume this library:
When using CSS classes, you can simply add the class with the filter name to the element containing your image.
<head> tag: <link rel="stylesheet" href="https://cssgram-cssgram.netdna-ssl.com/cssgram.min.css">. We're also on CDNJS which means another option is <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cssgram/0.1.10/cssgram.min.css"><link rel="stylesheet" href="css/vendor/cssgram.min.css">For example:
<!-- HTML -->
<figure class="aden">
<img src="../img.png">
</figure>
Alternatively, you can just download and link to any individual css file (e.g. <link rel="stylesheet" href="css/vendor/aden.min.css">) if you're using only one of the styles.
For use in HTML markup:
class="_1977"class="aden"class="amaro"class="brannan"class="brooklyn"class="clarendon"class="gingham"class="hudson"class="inkwell"class="kelvin"class="lark"class="lofi"class="mayfair"class="moon"class="nashville"class="perpetua"class="reyes"class="rise"class="slumber"class="stinson"class="toaster"class="valencia"class="walden"class="willow"class="xpro2"@extend or @mixinIf you use custom naming in your CSS architecture, you can add the .scss files for the provided styles within your project and then @extend the filter effects within your style definitions. If you think extends are stupid, I will fight you 😊.
scss/cssgram.scss via an @import statement in your Sass manifest file (i.e. main.scss). It may look like: @import 'vendor/cssgram'@extend %aden or using mixins @include aden()) in your element.For example:
<!-- HTML -->
<figure class="viz--beautiful">
<img src="../img.png">
</figure>
// Sass
.viz--beautiful {
@extend %aden;
}
or using mixins (more flexible)
// Sass (without adding new CSS3 filters)
.viz--beautiful {
@include aden();
}
// Sass (adding new CSS3 filters)
.viz--beautiful {
@include aden(blur(2px) /*...*/);
}
Alternatively, if you're using only one of the styles, you can download and link any individual .scss file in your Sass manifest (i.e. scss/aden.scss).
For use in Sass stylesheets:
Extends
@extend %_1977@extend %aden@extend %amaro@extend %brannan@extend %brooklyn@extend %clarendon@extend %gingham@extend %hudson@extend %inkwell@extend %kelvin@extend %lark@extend %lofi@extend %mayfair@extend %moon@extend %nashville@extend %perpetua@extend %reyes@extend %rise@extend %slumber@extend %stinson@extend %toaster@extend %valencia@extend %walden@extend %willow@extend %xpro2Mixins (You can add more CSS3 filters as arguments)
@include _1977()@include aden()@include amaro()@include brannan()@include brooklyn()@include clarendon()@include gingham()@include hudson()@include inkwell()@include kelvin()@include lark()@include lofi()@include mayfair()@include moon()@include nashville()@include perpetua()@include reyes()@include rise()@include slumber()@include stinson()@include toaster()@include valencia()@include walden()@include willow()@include xpro2()Either:
Or:
npm install dependencies (must have Node installed)gulp to compile CSS and the test siteFilters are really fun to create! Reference photos created by Miles Croxford can be found here.
source/css/cssgram.css contains each of the CSS classes you can apply to your <img> to give it the filter. You should use source/css/cssgram.min.css for production if you want access to all of the librarysource/scss/ contains the source files for individual classes and placeholder selectors you can use to extend CSS classes in Sasssite/ is the public facing websitesite/test is how you test filters if you're developing, remember to change is_done for the filter you are creating in site/filters.json.Note: This will also have mixin options and a PostCSS Component.
Overall
Maintained
Code review
npm
Latest release
Releases this year
(top 24 of 29)
1,678 followers · starred Oct 2015
650 followers · starred Nov 2015
11,400 followers · starred Nov 2015
3,009 followers · starred Oct 2015
CSS library for Instagram filters
See the code
CSSGram is an Instagram filter library written in Sass and CSS.
Simply put, CSSgram is a library for editing your images with Instagram-like filters directly using CSS. What we're doing is adding filters to the images, as well as applying color and/or gradient overlays via various blending techniques to mimic filter effects. This means less manual image processing and more fun filter effects on the web!
We're using pseudo-elements (i.e. ::before and ::after) to create the filter effects, so you must apply these filters on a containing element (i.e. not a replaced element like <img>). The recommendation is to wrap your images in a <figure> tag. More about the tag here.
This library uses CSS Filters and CSS Blend Modes. These features are supported in the following browsers:
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|---|---|---|---|---|---|
| 43+ ✔ | 38+ ✔ | Nope ✘ | 13 ✔ | 32+ ✔ | 8+ ✔ |
For more information, check on Can I Use.
There are currently 2 ways to consume this library:
When using CSS classes, you can simply add the class with the filter name to the element containing your image.
<head> tag: <link rel="stylesheet" href="https://cssgram-cssgram.netdna-ssl.com/cssgram.min.css">. We're also on CDNJS which means another option is <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cssgram/0.1.10/cssgram.min.css"><link rel="stylesheet" href="css/vendor/cssgram.min.css">For example:
<!-- HTML -->
<figure class="aden">
<img src="../img.png">
</figure>
Alternatively, you can just download and link to any individual css file (e.g. <link rel="stylesheet" href="css/vendor/aden.min.css">) if you're using only one of the styles.
For use in HTML markup:
class="_1977"class="aden"class="amaro"class="brannan"class="brooklyn"class="clarendon"class="gingham"class="hudson"class="inkwell"class="kelvin"class="lark"class="lofi"class="mayfair"class="moon"class="nashville"class="perpetua"class="reyes"class="rise"class="slumber"class="stinson"class="toaster"class="valencia"class="walden"class="willow"class="xpro2"@extend or @mixinIf you use custom naming in your CSS architecture, you can add the .scss files for the provided styles within your project and then @extend the filter effects within your style definitions. If you think extends are stupid, I will fight you 😊.
scss/cssgram.scss via an @import statement in your Sass manifest file (i.e. main.scss). It may look like: @import 'vendor/cssgram'@extend %aden or using mixins @include aden()) in your element.For example:
<!-- HTML -->
<figure class="viz--beautiful">
<img src="../img.png">
</figure>
// Sass
.viz--beautiful {
@extend %aden;
}
or using mixins (more flexible)
// Sass (without adding new CSS3 filters)
.viz--beautiful {
@include aden();
}
// Sass (adding new CSS3 filters)
.viz--beautiful {
@include aden(blur(2px) /*...*/);
}
Alternatively, if you're using only one of the styles, you can download and link any individual .scss file in your Sass manifest (i.e. scss/aden.scss).
For use in Sass stylesheets:
Extends
@extend %_1977@extend %aden@extend %amaro@extend %brannan@extend %brooklyn@extend %clarendon@extend %gingham@extend %hudson@extend %inkwell@extend %kelvin@extend %lark@extend %lofi@extend %mayfair@extend %moon@extend %nashville@extend %perpetua@extend %reyes@extend %rise@extend %slumber@extend %stinson@extend %toaster@extend %valencia@extend %walden@extend %willow@extend %xpro2Mixins (You can add more CSS3 filters as arguments)
@include _1977()@include aden()@include amaro()@include brannan()@include brooklyn()@include clarendon()@include gingham()@include hudson()@include inkwell()@include kelvin()@include lark()@include lofi()@include mayfair()@include moon()@include nashville()@include perpetua()@include reyes()@include rise()@include slumber()@include stinson()@include toaster()@include valencia()@include walden()@include willow()@include xpro2()Either:
Or:
npm install dependencies (must have Node installed)gulp to compile CSS and the test siteFilters are really fun to create! Reference photos created by Miles Croxford can be found here.
source/css/cssgram.css contains each of the CSS classes you can apply to your <img> to give it the filter. You should use source/css/cssgram.min.css for production if you want access to all of the librarysource/scss/ contains the source files for individual classes and placeholder selectors you can use to extend CSS classes in Sasssite/ is the public facing websitesite/test is how you test filters if you're developing, remember to change is_done for the filter you are creating in site/filters.json.Note: This will also have mixin options and a PostCSS Component.
Overall
Maintained
Code review
npm
Latest release
Releases this year
(top 24 of 29)
1,678 followers · starred Oct 2015
650 followers · starred Nov 2015
11,400 followers · starred Nov 2015
3,009 followers · starred Oct 2015