From 688c0d5edc628377e94f8fe4c5ee6ad2d3376aba Mon Sep 17 00:00:00 2001 From: Niko Sams Date: Sun, 31 Aug 2014 18:07:26 +0200 Subject: [PATCH] add very basic implementation of opposite-position function this is implemented in compass as ruby code --- lib/compass/_functions.scss | 1 + lib/compass/functions/_constants.scss | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 lib/compass/functions/_constants.scss diff --git a/lib/compass/_functions.scss b/lib/compass/_functions.scss index e57e52f..5b722d4 100644 --- a/lib/compass/_functions.scss +++ b/lib/compass/_functions.scss @@ -1 +1,2 @@ @import "functions/lists"; +@import "functions/constants"; diff --git a/lib/compass/functions/_constants.scss b/lib/compass/functions/_constants.scss new file mode 100644 index 0000000..322f79c --- /dev/null +++ b/lib/compass/functions/_constants.scss @@ -0,0 +1,18 @@ +/* + * A partial implementation of the Ruby constants functions from Compass: + * https://github.com/Compass/compass/blob/stable/lib/compass/sass_extensions/functions/constants.rb + */ + +@function opposite-position($from) { + @if ($from == top) { + @return bottom; + } @else if ($from == bottom) { + @return top; + } @else if ($from == left) { + @return right; + } @else if ($from == right) { + @return left; + } @else if ($from == center) { + @return center; + } +}