Skip to content

Commit

Permalink
Merge pull request #151 from eduardoboucas/1.4.9
Browse files Browse the repository at this point in the history
v1.4.9
  • Loading branch information
eduardoboucas committed Nov 14, 2016
2 parents 5069cf1 + 987f9f2 commit 0347e40
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "include-media",
"version": "1.4.8",
"version": "1.4.9",
"homepage": "https://github.com/eduardoboucas/import-media",
"authors": [
"Eduardo Boucas <mail@eduardoboucas.com>"
Expand Down
26 changes: 13 additions & 13 deletions dist/_include-media.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// |_|_| |_|\___|_|\__,_|\__,_|\___| |_| |_| |_|\___|\__,_|_|\__,_|
//
// Simple, elegant and maintainable media queries in Sass
// v1.4.8
// v1.4.9
//
// http://include-media.com
//
Expand Down Expand Up @@ -185,7 +185,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
///
/// @param {String} $message - Message to log
///
@function log($message) {
@function im-log($message) {
@if feature-exists('at-error') {
@error $message;
} @else {
Expand All @@ -199,14 +199,14 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;

///
/// Wrapper mixin for the log function so it can be used with a more friendly
/// API than `@if log('..') {}` or `$_: log('..')`. Basically, use the function
/// API than `@if im-log('..') {}` or `$_: im-log('..')`. Basically, use the function
/// within functions because it is not possible to include a mixin in a function
/// and use the mixin everywhere else because it's much more elegant.
///
/// @param {String} $message - Message to log
///
@mixin log($message) {
@if log($message) {}
@if im-log($message) {}
}


Expand All @@ -227,7 +227,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
$no-media-breakpoint-value: map-get($breakpoints, $im-no-media-breakpoint);

@if not $no-media-breakpoint-value {
@if log('`#{$im-no-media-breakpoint}` is not a valid breakpoint.') {}
@if im-log('`#{$im-no-media-breakpoint}` is not a valid breakpoint.') {}
}

@each $condition in $conditions {
Expand Down Expand Up @@ -271,11 +271,11 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
}

// It is not possible to include a mixin inside a function, so we have to
// rely on the `log(..)` function rather than the `log(..)` mixin. Because
// rely on the `im-log(..)` function rather than the `log(..)` mixin. Because
// functions cannot be called anywhere in Sass, we need to hack the call in
// a dummy variable, such as `$_`. If anybody ever raise a scoping issue with
// Sass 3.3, change this line in `@if log(..) {}` instead.
$_: log('No operator found in `#{$expression}`.');
// Sass 3.3, change this line in `@if im-log(..) {}` instead.
$_: im-log('No operator found in `#{$expression}`.');
}


Expand Down Expand Up @@ -334,11 +334,11 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;

@if not $interval {
// It is not possible to include a mixin inside a function, so we have to
// rely on the `log(..)` function rather than the `log(..)` mixin. Because
// rely on the `im-log(..)` function rather than the `log(..)` mixin. Because
// functions cannot be called anywhere in Sass, we need to hack the call in
// a dummy variable, such as `$_`. If anybody ever raise a scoping issue with
// Sass 3.3, change this line in `@if log(..) {}` instead.
$_: log('Unknown unit `#{unit($value)}`.');
// Sass 3.3, change this line in `@if im-log(..) {}` instead.
$_: im-log('Unknown unit `#{unit($value)}`.');
}

@if $operator == '>' {
Expand Down Expand Up @@ -416,7 +416,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
@if type-of($value) == 'number' {
@return $value;
} @else if type-of($value) != 'string' {
$_: log('Value for `to-number` should be a number or a string.');
$_: im-log('Value for `to-number` should be a number or a string.');
}

$first-character: str-slice($value, 1, 1);
Expand Down Expand Up @@ -463,7 +463,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
$units: ('px': 1px, 'cm': 1cm, 'mm': 1mm, '%': 1%, 'ch': 1ch, 'pc': 1pc, 'in': 1in, 'em': 1em, 'rem': 1rem, 'pt': 1pt, 'ex': 1ex, 'vw': 1vw, 'vh': 1vh, 'vmin': 1vmin, 'vmax': 1vmax);

@if not index(map-keys($units), $unit) {
$_: log('Invalid unit `#{$unit}`.');
$_: im-log('Invalid unit `#{$unit}`.');
}

@return $value * map-get($units, $unit);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "include-media",
"name": "include-media",
"version": "1.4.8",
"version": "1.4.9",
"description": "Simple, elegant and maintainable media queries in Sass",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/_no-media.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-///
///
/// Determines whether a list of conditions is intercepted by the static breakpoint.
///
/// @param {Arglist} $conditions - Media query conditions
Expand Down

0 comments on commit 0347e40

Please sign in to comment.