Skip to content

Commit fd37b68

Browse files
author
Jeff Escalante
committed
Merge pull request #204 from jenius/rule
add horizontal rule
2 parents 3251525 + 1960659 commit fd37b68

File tree

5 files changed

+29
-2
lines changed

5 files changed

+29
-2
lines changed

axis/layout.styl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@ ratio-box(ratio = 1/1)
113113
height: 0
114114
padding-top: (1 / ratio) * 100%
115115

116+
// Mixin: Horizontal Rule
117+
//
118+
// Clean reset for divider lines.
119+
//
120+
// ex: rule()
121+
// ex rule(blue)
122+
123+
rule($color = rgba(#000, .15), $spacing = 1.5em)
124+
border: 0
125+
border-bottom: 1px solid $color
126+
height: 0
127+
padding: 0
128+
margin: $spacing 0
116129

117130
// Mixin: Table Layout
118131
//

test/fixtures/layout/rule.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
hr {
2+
border: 0;
3+
border-bottom: 1px solid rgba(0,0,0,0.15);
4+
height: 0;
5+
padding: 0;
6+
margin: 1.5em 0;
7+
}

test/fixtures/layout/rule.styl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
hr
2+
rule()

test/test.coffee

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,14 @@ describe 'layout', ->
164164
it 'ratio-box', (done) ->
165165
compile_and_match(path.join(@path, 'ratio-box.styl'), done)
166166

167+
it 'rule', (done) ->
168+
compile_and_match(path.join(@path, 'rule.styl'), done)
169+
167170
it 'vertical-align', (done) ->
168171
compile_and_match(path.join(@path, 'vertical-align.styl'), done)
169172

170173
it 'table-layout', (done) ->
171-
compile_and_match(path.join(@path, 'table-layout.styl'), done)
174+
compile_and_match(path.join(@path, 'table-layout.styl'), done)
172175

173176
describe 'print', ->
174177

test/visual.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@
4848
<link rel='stylesheet' href='fixtures/layout/inline-block.css' >
4949
<link rel='stylesheet' href='fixtures/layout/media.css' >
5050
<link rel='stylesheet' href='fixtures/layout/ratio-box.css' >
51+
<link rel='stylesheet' href='fixtures/layout/rule.css' >
5152
<link rel='stylesheet' href='fixtures/layout/vertical-align.css' >
52-
<link rel='stylesheet' href='fixtures/layout/table-layout.css' >
53+
<link rel='stylesheet' href='fixtures/layout/table-layout.css' >
5354

5455
<!-- tables -->
5556
<link rel='stylesheet' href='fixtures/tables/table.css' >
@@ -250,6 +251,7 @@ <h1>layout</h1>
250251
<iframe width="1280" height="720" src="https://www.youtube.com/embed/o0xr1JRZOb4" frameborder="0" allowfullscreen></iframe>
251252
</div>
252253

254+
<hr>
253255
<div class="vertical-align">
254256
<div class='inner-div'>vertically aligned</div>
255257
</div>

0 commit comments

Comments
 (0)