Experimental book page layout.
[wolnelektury.git] / src / wolnelektury / static / 2021 / css / utils / bourbon / library / _shade.scss
diff --git a/src/wolnelektury/static/2021/css/utils/bourbon/library/_shade.scss b/src/wolnelektury/static/2021/css/utils/bourbon/library/_shade.scss
new file mode 100644 (file)
index 0000000..44b545b
--- /dev/null
@@ -0,0 +1,32 @@
+@charset "UTF-8";
+
+/// Mixes a color with black.
+///
+/// @argument {color} $color
+///
+/// @argument {number (percentage)} $percent
+///   The amount of black to be mixed in.
+///
+/// @return {color}
+///
+/// @example scss
+///   .element {
+///     background-color: shade(#ffbb52, 60%);
+///   }
+///
+///   // CSS Output
+///   .element {
+///     background-color: #664a20;
+///   }
+
+@function shade(
+  $color,
+  $percent
+) {
+  @if not _is-color($color) {
+    @error "`#{$color}` is not a valid color for the `$color` argument in " +
+           "the `shade` mixin.";
+  } @else {
+    @return mix(#000, $color, $percent);
+  }
+}