Skip to content

Commit

Permalink
Added CSS3 filter() mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
parkr committed Jun 13, 2012
1 parent f562f48 commit b13cb08
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc-src/content/reference/compass/css3/filter.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Compass Filter
crumb: Filter
framework: compass
stylesheet: compass/css3/_filter.scss
meta_description: Specify the (image) filter for all browsers.
layout: core
classnames:
- reference
- core
- css3
---
- render 'reference' do
%p
The filter mixin is used to apply filters to images.
1 change: 1 addition & 0 deletions frameworks/compass/stylesheets/compass/_css3.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
@import "css3/appearance";
@import "css3/regions";
@import "css3/hyphenation";
@import "css3/filter";
24 changes: 24 additions & 0 deletions frameworks/compass/stylesheets/compass/css3/_filter.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Provides cross-browser support (Webkit, Mozilla, MSIE, and Opera)
// Each filter argument should adhere to the standard css3 syntax for the
// filter property.
@mixin filter (
$filter-1 : default,
$filter-2 : false,
$filter-3 : false,
$filter-4 : false,
$filter-5 : false,
$filter-6 : false,
$filter-7 : false,
$filter-8 : false,
$filter-9 : false,
$filter-10: false
) {
@if $filter-1 == default {
@warn "Using default filter: grayscale(100%)";
$filter-1: grayscale(100%);
}
$filter : compact($filter-1, $filter-2, $filter-3, $filter-4, $filter-5, $filter-6, $filter-7, $filter-8, $filter-9, $filter-10);
@include experimental(filter, $filter,
-moz, -webkit, -o, -ms, not -khtml, official
);
}

0 comments on commit b13cb08

Please sign in to comment.