GithubHelp home page GithubHelp logo

sgl0v / cssgram Goto Github PK

View Code? Open in Web Editor NEW

This project forked from una/cssgram

0.0 3.0 0.0 3.19 MB

CSS library for Instagram filters

Home Page: http://una.im/CSSgram/

License: MIT License

JavaScript 4.27% HTML 19.70% CSS 76.03%

cssgram's Introduction

CSSgram

Instagram filter library in Sass and CSS.

What is This?

Simply put, CSSgram is a library for editing your images with Instagram-like filters directly in CSS. What we're doing here is adding filters to the images as well as applying color and/or gradient overlays via various blending techniques to mimic these effects. This means less manual image processing and more fun filter effects on the web!

We are using pseudo-elements (i.e. :after) to create the filter effects, so you must apply these filters on a containing element (i.e. not a content-block like <img>. The recommendation is to wrap your images in a <figure> tag. More about the tag here.

Browser Support

This library uses CSS Filters and CSS Blend Modes. This features are supported in the following browsers:

Chrome logo Firefox logo Internet Explorer logo Opera logo Safari logo
43+ ✔ 38+ ✔ Nope ✘ 32+ ✔ 8+ ✔

For more information, check on Can I Use.

Usage

There are currently 2 ways to consume this library:

Use CSS classes

When using CSS classes, you can simply add the class with the filter name to the element containing your image.

  1. Download the CSSgram Library
  • Link to the CSSgram library within your project: <link rel="stylesheet" href="css/vendor/cssgram.min.css">
  • Add a class to your image element with the name of the filter you would like to use

For example:

<!-- HTML -->
<figure class="aden">
  <img src="../img.png">
</figure>

Alternatively, you can just download and link to any individual css file: <link rel="stylesheet" href="css/vendor/aden.min.css">, if you're just using one of the styles.

Available Classes

For use in HTML markup:

  • Aden: class="aden"
  • Reyes: class="reyes"
  • Perpetua: class="perpetua"
  • Inkwell: class="inkwell"
  • Toaster: class="toaster"
  • Walden: class="walden"
  • Hudson: class="hudson"
  • Gingham: class="gingham"
  • Mayfair: class="mayfair"
  • Lo-fi: class="lofi"
  • X-Pro II: class="xpro2"
  • 1977: class="_1977"
  • Brooklyn: class="brooklyn"

Use Sass @extends

If 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 😊.

  1. Download the /scss folder contents
  • Include a link to scss/cssgram.scss via an import statement in your Sass manifest file (i.e. main.scss). It may look like: @import 'vendor/cssgram';
  • Extend the silent placeholder selector @extend %aden; in your element.

For example:

<!-- HTML -->
<figure class="viz--beautiful">
  <img src="../img.png">
</figure>
// Sass
.viz--beautiful {
  @extend %aden;
}

Alternatively, you can just download and link any individual .scss file in your Sass manifest: (i.e. scss/aden.scss), if you're just using one of the styles.

Available Extends

For use in Sass elements:

  • Aden: @extend %aden;
  • Reyes: @extend %reyes;
  • Perpetua: @extend %perpetua;
  • Inkwell: @extend %inkwell;
  • Toaster: @extend %toaster;
  • Walden: @extend %walden;
  • Hudson: @extend %hudson;
  • Gingham: @extend %gingham;
  • Mayfair: @extend %mayfair;
  • Lo-fi: @extend %lofi;
  • X-Pro II: @extend %xpro2;
  • 1977: @extend %_1977;
  • Brooklyn: @extend %brooklyn;

Contributing

  1. Create an issue Issues temporarily shut down due to a spam attack
  2. Fork this repo
  3. Clone the fork onto your system
  4. npm install dependancies (must have Node installed)
  5. Run gulp to compile CSS and the site
  6. Make changes (see file structure outline below)
  7. Submit a PR referencing the issue with a smile 😄

File Structure Outline

  • 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
  • source/scss/ contains the source files for individual classes and placeholder selectors you can use to extend CSS classes in Sass
  • site is the public facing website

Note: this will also have mixin options and a PostCSS Component.

cssgram's People

Contributors

bennettfeely avatar fernahh avatar mislav avatar theknarf avatar una avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.