Skip to content

Commit

Permalink
Legacy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Snugug committed Aug 24, 2014
1 parent 0826c78 commit b0bc8b0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
27 changes: 4 additions & 23 deletions stylesheets/_breakpoint.scss
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
//////////////////////////////
// Default Variables
//////////////////////////////
// Default Features
$breakpoint-default-media: all !default;
$breakpoint-default-feature: min-width !default;
$breakpoint-default-pair: width !default;

// Default Transforms
$breakpoint-force-media-all: false !default;
$breakpoint-to-ems: false !default;
$breakpoint-resolutions: true !default;

// Default No Query Options
$breakpoint-no-queries: false !default;
$breakpoint-no-query-fallbacks: false !default;

// Deftault Base Font Size
$breakpoint-base-font-size: 16px !default;

// Legacy Syntax Support
$breakpoint-legacy-syntax: false !default;

//////////////////////////////
// Map Settings
//////////////////////////////
$Breakpoint-Settings: (
'default media': all,
'default feature': min-width,
Expand Down Expand Up @@ -54,11 +31,15 @@ $breakpoint: () !default;

@import 'breakpoint/respond-to';

@import "breakpoint/legacy-settings";

//////////////////////////////
// Breakpoint Mixin
//////////////////////////////

@mixin breakpoint($query, $no-query: false) {
@include legacy-settings-warning;

// Reset contexts
@include private-breakpoint-reset-contexts();

Expand Down
19 changes: 19 additions & 0 deletions stylesheets/breakpoint/_legacy-settings.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@mixin legacy-settings-warning {
$legacyVars: (
'default-media': 'default media',
'default-feature': 'default feature',
'force-media-all': 'force all media type',
'to-ems': 'to ems',
'resolutions': 'transform resolutions',
'no-queries': 'no queries',
'no-query-fallbacks': 'no query fallbacks',
'base-font-size': 'base font size',
'legacy-syntax': 'legacy syntax'
);

@each $legacy, $new in $legacyVars {
@if global-variable-exists('breakpoint-' + $legacy) {
@warn "In order to avoid variable namspace collisions, we have updated the way to change settings for Breakpoint. Please change all instances of `$breakpoint-#{$legacy}: {{setting}}` to `@include breakpoint-set('#{$new}', {{setting}})`. This warning will be deprecated in a future release."
}
}
}

0 comments on commit b0bc8b0

Please sign in to comment.