]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Consider deprecated offcanvas size in user settings (apart from the warning) 10428/head
authorSassNinja <kai.falkowski@gmail.com>
Thu, 20 Jul 2017 12:29:51 +0000 (14:29 +0200)
committerSassNinja <kai.falkowski@gmail.com>
Thu, 20 Jul 2017 12:29:51 +0000 (14:29 +0200)
This preserves backwards compatibility.

scss/components/_off-canvas.scss

index 6f782d1ebce8716687844e3d4658f5c2be419b46..51c1eb40efd05e1a30c55c1f8c3efc202c2c0299 100644 (file)
@@ -6,14 +6,6 @@
 /// @group off-canvas
 ////
 
-/// Deprecated settings warning
-@if variable-exists(offcanvas-size) {
-  @warn '$offcanvas-size is deprecated and not used anymore! Please update your settings and use the map $offcanvas-sizes instead';
-}
-@if variable-exists(offcanvas-vertical-size) {
-  @warn '$offcanvas-vertical-size is deprecated and not used anymore! Please update your settings and use the map $offcanvas-vertical-sizes instead';
-}
-
 /// Width map of a left/right off-canvas panel.
 /// @type Map
 $offcanvas-sizes: (
@@ -82,6 +74,16 @@ $maincontent-class: 'off-canvas-content' !default;
 /// Adds baseline styles for off-canvas. This CSS is required to make the other pieces work.
 @mixin off-canvas-basics {
 
+  /// Transform deprecated size settings into map & show warning
+  @if variable-exists(offcanvas-size) {
+    $offcanvas-sizes: (small: $offcanvas-size, medium: $offcanvas-size) !global;
+    @warn '$offcanvas-size is deprecated and not used anymore! Please update your settings and use the map $offcanvas-sizes instead';
+  }
+  @if variable-exists(offcanvas-vertical-size) {
+    $offcanvas-vertical-sizes: (small: $offcanvas-vertical-size, medium: $offcanvas-vertical-size) !global;
+    @warn '$offcanvas-vertical-size is deprecated and not used anymore! Please update your settings and use the map $offcanvas-vertical-sizes instead';
+  }
+
   // Checks the z-indexes and increase them due to backwards compatibility.
   // This is necessary because the overlay's z-index is new since v6.4 and may be identical to the user custom settings of the push z-index.
   @if $offcanvas-push-zindex <= $offcanvas-overlay-zindex { $offcanvas-push-zindex: $offcanvas-overlay-zindex + 1 !global; }