Skip to content

Commit

Permalink
Tests updated
Browse files Browse the repository at this point in the history
  • Loading branch information
bcinarli committed Feb 17, 2015
1 parent 4ac6bcf commit a9b7b39
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/mixins/_position.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* Vertical Center
*/
@mixin center-vertical(){
position: absolute;
top: 50%;
@include transform(translateY(-50%));
}
Expand All @@ -32,6 +33,7 @@
*/
@mixin center-horizontal($type: absolute){
@if $type == absolute {
position: absolute;
left: 50%;
@include transform(translateX(-50%));
}
Expand Down
50 changes: 50 additions & 0 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
border: 1px solid #ccc;
border-radius: 3px;
}

.centering {
position: relative;
width: 100%;
height: 150px;
background: #fafafa;
}
</style>
</head>

Expand Down Expand Up @@ -103,6 +110,49 @@ <h3 class="test-heading">Radial Gradient</h3>
</article>
</section>

<section class="tests">
<h2 class="tests-heading">Position Mixins</h2>

<article class="test">
<h3 class="test-heading">Center</h3>

<pre>
.center {
@include center();
}
</pre>
<p class="single-test centering">
<span class="center">This element should be centered both vertical and horizontal</span>
</p>
</article>

<article class="test">
<h3 class="test-heading">Vertical Center</h3>

<pre>
.center-vertical {
@include center-vertical();
}
</pre>
<p class="single-test centering">
<span class="center-vertical">This element should be centered vertically</span>
</p>
</article>

<article class="test">
<h3 class="test-heading">Horizontal Center</h3>

<pre>
.center-horizontal {
@include center-horizontal();
}
</pre>
<p class="single-test centering">
<span class="center-horizontal">This element should be centered horizontally</span>
</p>
</article>
</section>

<section class="tests">
<h2 class="tests-heading">Text Mixins</h2>

Expand Down
2 changes: 1 addition & 1 deletion tests/tests.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions tests/tests.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,21 @@
}
}

// @mixin center()
.center {
@include center();
}

// @mixin center-vertical()
.center-vertical {
@include center-vertical();
}

// @mixin center-horizontal()
.center-horizontal {
@include center-horizontal();
}

// @mixin arrow($color, $size, $direction, $el)
.arrow-top {
@include arrow(lightblue, 10px);
Expand Down

0 comments on commit a9b7b39

Please sign in to comment.