Skip to content

Commit

Permalink
Make align reset go back to position: static
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Simmons committed Apr 13, 2015
1 parent b29bb78 commit bfe2bd2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
20 changes: 13 additions & 7 deletions less/lost.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Lost Grid v5.1.5 - https://github.com/corysimmons/lost
// Lost Grid v5.1.6 - https://github.com/corysimmons/lost

@gutter: 30px;
@rtl: false;
Expand Down Expand Up @@ -136,12 +136,12 @@
& when (@flex = false) {
position: relative;
> * {
position: absolute;
top: 50%;
right: auto;
bottom: auto;
left: 50%;
transform: translate3d(-50%, -50%, 0);
& when (@location = reset) {
position: static;
}
& when not (@location = reset) {
position: absolute;
}
& when (@location = reset) {
top: auto;
right: auto;
Expand Down Expand Up @@ -190,6 +190,12 @@
bottom: auto;
left: auto;
transform: translate3d(0, -50%, 0);
} & when (@location = middle-center) {
top: 50%;
right: auto;
bottom: auto;
left: 50%;
transform: translate3d(-50%, -50%, 0);
} & when (@location = right) {
top: 50%;
right: 0;
Expand Down
8 changes: 6 additions & 2 deletions scss/lost.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Lost Grid v5.1.5 - https://github.com/corysimmons/lost
// Lost Grid v5.1.6 - https://github.com/corysimmons/lost

$gutter: 30px !default;
$rtl: false !default;
Expand Down Expand Up @@ -125,7 +125,11 @@ $flexbox: false !default;
@if ($flex == false) {
position: relative;
> * {
position: absolute;
@if ($location == reset) {
position: static;
} @else {
position: absolute;
}
@if ($location == reset) {
top: auto;
right: auto;
Expand Down
7 changes: 5 additions & 2 deletions stylus/lost.styl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Lost Grid v5.1.5 - https://github.com/corysimmons/lost
// Lost Grid v5.1.6 - https://github.com/corysimmons/lost

$gutter = 30px
$rtl = false
Expand Down Expand Up @@ -116,7 +116,10 @@ align($location = middle-center, $flex = $flexbox)
if $flex is false
position: relative
> *
position: absolute
if $location is reset
position: static
else
position: absolute
if $location is reset
top: auto
right: auto
Expand Down

0 comments on commit bfe2bd2

Please sign in to comment.