Skip to content

Commit

Permalink
Using Singularity Setting for Mobile First
Browse files Browse the repository at this point in the history
Bad contexts become -1px, but default is also -1px, should we pick another number, like -100px?
  • Loading branch information
Snugug committed Dec 23, 2013
1 parent 32f7296 commit c33f057
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions stylesheets/singularitygs/language/_parse-add.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
$parse-find: ();
$parse-mq: null;
$parse-mq-find: false;
$Mobile-First: singularity-get-setting('mobile first');

@each $item in $definition {
@if $item != 'at' and $parse-mq-find != true {
Expand All @@ -26,27 +27,27 @@

@if $parse-mq {
@if not function-exists(breakpoint) {
@warn "Responsive contexts require Breakpoint (https://github.com/Team-Sass/breakpoint). Please ensure that Breakpoint is imported and available for Singularity to use. Context set to 1px.";
$parse-mq: 1px;
@warn "Responsive contexts require Breakpoint (https://github.com/Team-Sass/breakpoint). Please ensure that Breakpoint is imported and available for Singularity to use. Context set to -1px.";
$parse-mq: -1px;
}
@else {
$breakpoint-parse: breakpoint($parse-mq);
$breakpoint-parse: map-get($breakpoint-parse, 'context holder');
$breakpoint-mq: null;
@if $mobile-first {
@if $Mobile-First {
$breakpoint-mq: map-get($breakpoint-parse, 'min-width');
}
@else {
$breakpoint-mq: map-get($breakpoint-parse, 'max-width');
}

@if length($breakpoint-mq) > 1 {
@warn "Responsive contexts are not available for `or` queries as which query to use is ambiguous. Please only use single context queries. Context set to 1px.";
@warn "Responsive contexts are not available for `or` queries as which query to use is ambiguous. Please only use single context queries. Context set to -1px.";
$parse-mq: 1px;

This comment has been minimized.

Copy link
@agraboso

agraboso Oct 7, 2014

Contributor

I believe this line should be changed to the following:
$parse-mq: -1px;

}
@else if length($breakpoint-mq) < 1 {
@warn "No " + if($mobile-first, 'min-width', 'max-width') + ' context found. Please use a media query with the correct context. Context set to 1px.';
$parse-mq: 1px;
@warn "No " + if($Mobile-First, 'min-width', 'max-width') + ' context found. Please use a media query with the correct context. Context set to -1px.';
$parse-mq: -1px;
}
@else {
$parse-mq: nth($breakpoint-mq, 1);
Expand Down

0 comments on commit c33f057

Please sign in to comment.