Permalink
Browse files

Add docs from Touch for color-by-background.

  • Loading branch information...
1 parent 6af980f commit 5045395147164a6fbe2db7457dbf72dd6af90348 @davidkaneda davidkaneda committed Feb 29, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 stylesheets/recipes/_color.scss
@@ -135,6 +135,21 @@
}
}
+/**
+ * Colors the text of an element based on lightness of its background.
+ *
+ * .my-element {
+ * @include color-by-background(#fff); // Colors text black.
+ * }
+ *
+ * .my-element {
+ * @include color-by-background(#fff, 40%); // Colors text gray.
+ * }
+ *
+ * @param {color} $bg-color Background color of element.
+ * @param {percent} $contrast Contrast of text color to its background.
+ *
+ */
@mixin color-by-background($bg-color, $contrast: $default-text-contrast, $default-color: false, $inset-text: false) {
@if $default-color {
color: color-by-background(hsla(hue($default-color), saturation($default-color), lightness($bg-color), opacity($bg-color)), $contrast);

1 comment on commit 5045395

@MoOx
MoOx commented on 5045395 Aug 2, 2012

You should use // comment to remove useless output when importing.
I've replace all comment on the current version.

Please sign in to comment.