Skip to content

Commit

Permalink
Removal of comments for release of v3
Browse files Browse the repository at this point in the history
  • Loading branch information
nicetransition committed May 1, 2015
1 parent 3d10802 commit 22736bb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# Unit Space

**NOTE:** STILL A LOT OF WORK TO DO FOR README. I still need to do details on using the `@mixin` and cleaning this up for use.

======


When creating an interface one of the most parts is spacing (`margin` and `padding`). Consistent units are vital for unity, balance, rhythm of your web applications. *Unit Space* is a foundation to generate create consistent spacing for your projects, no matter how many variations may be required in your system.


*Unit Space* is built in Sass 3.3.x to provide you the most flexibility and ease of maintainability.

* **View demos**: [http://codepen.io/kevinmack18/pen/OVVxpO](http://codepen.io/kevinmack18/pen/OVVxpO)

----


Expand Down Expand Up @@ -144,7 +140,6 @@ Ouput the compiled CSS properties from a map object into another selector.
````
.some-selector-name {
@include units($property: "padding", $version: "default", $variations: (base: false, top: false, right: false, bottom: true, left: false));
}
````

Expand Down Expand Up @@ -210,7 +205,7 @@ Each variation (including defaults) have a %placeholder selector that aligns wit

The MIT License (MIT)

Copyright (c) 2014 Kevin Mack
Copyright (c) 2015 Kevin Mack

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
4 changes: 2 additions & 2 deletions _unit_space__variables.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Spacing/Unit Variables and Objects

$units__default-unit: 1.250em;
$units__default-unit: 20px;
$default-unit: $units__default-unit;
$units__default-breakpoint: 31.250em;
$units__default-breakpoint: 500px;
$units__include-box-sizing: true;

// OPTIONS:
Expand Down
30 changes: 12 additions & 18 deletions unit-space.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
// * Released under the MIT license
// * https://github.com/kevinmack18/SASS-Margin-and-Padding-Starter/blob/master/LICENSE
// * Version: v3.0.0
// * Date: 2014-08-25
// * Date: 2015-04-30

@import "unit_space__variables";


@if ( $units__include-box-sizing ) {
*, *:before, *:after {
box-sizing: border-box;
Expand All @@ -27,7 +28,7 @@
$media-query-max: if(map-has-key($values, "media-query-max"),map-get($values, "media-query-max"),false);
$unit--media-query-max: if(map-has-key($values, "unit--media-query-max"),map-get($values, "unit--media-query-max"),$unit);
$units-are-controlled-by-breakpoints: ($media-query-min != false and $media-query-max != false);


@each $variation, $boolean in $variations {

Expand All @@ -39,7 +40,7 @@
// Check to see if both have breakpoints
@if ($units-are-controlled-by-breakpoints == false) {
%#{$selector-base}-#{$variation}#{$selector-suffix}#{$id} {
#{$property}-#{$variation}: unquote($unit);
#{$property}-#{$variation}: $unit;
}
}

Expand All @@ -52,25 +53,17 @@
@if ($media-query-min) {
@media screen and (min-width: $media-query-min) {
%#{$selector-base}-#{$variation}#{$selector-suffix}#{$id} {
#{$property}-#{$variation}: unquote($unit--media-query-min);
#{$property}-#{$variation}: $unit--media-query-min;
}
}
}
@if ($media-query-max) {
@media screen and (max-width: $media-query-max) {
%#{$selector-base}-#{$variation}#{$selector-suffix}#{$id} {
#{$property}-#{$variation}: unquote($unit--media-query-max);
#{$property}-#{$variation}: $unit--media-query-max;
}
}
}

// Verify variables (for testing)
// $media-query-min: #{$media-query-min}
// $unit--media-query-min: #{$unit--media-query-min}
// $media-query-max: #{$media-query-max}
// $unit--media-query-max: #{$unit--media-query-max}
// Both have breakpoints: #{$units-are-controlled-by-breakpoints}

}

@if( $variation == "base" ) {
Expand All @@ -82,14 +75,14 @@
@if ($media-query-min) {
@media screen and (min-width: $media-query-min) {
%#{$selector-base}#{$selector-suffix} {
#{$property}: unquote($unit--media-query-min);
#{$property}: $unit--media-query-min;
}
}
}
@if ($media-query-max) {
@media screen and (max-width: $media-query-max) {
%#{$selector-base}#{$selector-suffix} {
#{$property}: unquote($unit--media-query-max);
#{$property}: $unit--media-query-max;
}
}
}
Expand All @@ -111,7 +104,7 @@
}

// output specific properites only
@mixin units($property: "padding", $version: "default", $variations: (base: true, top: true, right: true, bottom: true, left: true)) {
@mixin units($property: "padding", $version: "default", $variation: (base: true, top: true, right: true, bottom: true, left: true)) {
$variation-controls: $variation;
$versions: map-get($units, $property);
$values: map-get($versions, $version);
Expand All @@ -124,7 +117,7 @@
$media-query-max: if(map-has-key($values, "media-query-max"),map-get($values, "media-query-max"),false);
$unit--media-query-max: if(map-has-key($values, "unit--media-query-max"),map-get($values, "unit--media-query-max"),$unit);
$units-are-controlled-by-breakpoints: ($media-query-min != false and $media-query-max != false);

@each $variation, $boolean in $variation-controls {

$includeVariation: map-get($variation-controls, $variation);
Expand All @@ -150,6 +143,8 @@
}
}
}


@if ($media-query-max) {
@media screen and (max-width: $media-query-max) {
@if ( $baseDoesNotOveride ) {
Expand All @@ -174,4 +169,3 @@

}
}

0 comments on commit 22736bb

Please sign in to comment.