├── README.md ├── .editorconfig ├── bower.json ├── .gitignore ├── _mixins.breakpoint.scss └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | mixins.breakpoint 2 | ================= 3 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 2 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "spacelab-mixins.breakpoint", 3 | "version": "0.1.0", 4 | "authors": [ 5 | "Axel Salder", 6 | "Daniel Blomeyer" 7 | ], 8 | "description": "here be a description", 9 | "main": "_mixins.breakpoint.scss", 10 | "keywords": [ 11 | "spacelab", 12 | "css" 13 | ], 14 | "license": "MIT", 15 | "homepage": "https://github.com/spacelab/mixins.breakpoint", 16 | "private": true, 17 | "ignore": [ 18 | "**/.*", 19 | "node_modules", 20 | "bower_components", 21 | "test", 22 | "tests" 23 | ], 24 | "dependencies": { 25 | "spacelab-settings.defaults": "spacelab/settings.defaults" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directory 23 | # Commenting this out is preferred by some people, see 24 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 25 | node_modules 26 | 27 | # Users Environment Variables 28 | .lock-wscript 29 | .DS_Store 30 | -------------------------------------------------------------------------------- /_mixins.breakpoint.scss: -------------------------------------------------------------------------------- 1 | $default-breakpoint: root; 2 | $current-breakpoint: $default-breakpoint; 3 | 4 | @mixin bp($breakpoint) { 5 | // Get the width from the keyword `$breakpoint` 6 | // Or `null` if the keyword doesn't exist in `$breakpoints` map 7 | $value: map-get($breakpoints, $breakpoint); 8 | 9 | // If `$breakpoint` exists as a key in `$breakpoints` 10 | @if $value != null { 11 | // Update `$current-breakpoint` 12 | $current-breakpoint: $breakpoint !global; 13 | 14 | // Open a media query block 15 | @media #{$value} { 16 | // Let the user dump content 17 | @content; 18 | } 19 | 20 | // Then reset `$current-breakpoint` to `$default-breakpoint` (root) 21 | $current-breakpoint: $default-breakpoint !global; 22 | } 23 | 24 | // If `$breakpoint` doesn't exist in `$breakpoints`, 25 | // Warn the user and do nothing 26 | @else { 27 | @warn "Could not find breakpoint with the name `#{$breakpoint}`."; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Daniel Blomeyer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | --------------------------------------------------------------------------------