From 8c37c75a5a2c480d6dff5acebb956760cb2328e1 Mon Sep 17 00:00:00 2001 From: SassNinja Date: Thu, 20 Jul 2017 14:29:51 +0200 Subject: [PATCH] Consider deprecated offcanvas size in user settings (apart from the warning) This preserves backwards compatibility. --- scss/components/_off-canvas.scss | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scss/components/_off-canvas.scss b/scss/components/_off-canvas.scss index 6f782d1eb..51c1eb40e 100644 --- a/scss/components/_off-canvas.scss +++ b/scss/components/_off-canvas.scss @@ -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; } -- 2.47.2