Some more bar styles

This commit is contained in:
Max Lynch
2013-08-23 14:07:29 -05:00
parent 4586851e42
commit fc645bfa8d
5 changed files with 122 additions and 4 deletions

View File

@ -14,6 +14,33 @@ body {
a {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
.bar {
position: fixed;
right: 0;
left: 0;
z-index: 10;
display: -webkit-box;
display: box;
-webkit-box-orient: horizontal;
box-orient: horizontal;
box-sizing: border-box; }
.bar .title {
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
text-align: center;
white-space: nowrap; }
.bar .title a {
color: inherit; }
.bar-header {
top: 0; }
.bar-footer {
bottom: 0; }
.button {
position: relative;
display: inline-block;
@ -22,6 +49,20 @@ a {
cursor: pointer;
margin: 0; }
.bar {
background-color: white;
border-bottom: 1px solid #dddddd;
padding: 10px; }
@media screen and (orientation: landscape) {
.bar {
padding: 5px; } }
.bar.bar-default {
background-color: white;
border-bottom: 1px solid #dddddd; }
.bar.bar-secondary {
background-color: whitesmoke;
border-bottom: 1px solid #cccccc; }
.button {
color: #222222;
border-radius: 2px;

View File

@ -22,7 +22,7 @@
<script src="app.js"></script>
</head>
<body ontouchstart="">
<header class="bar-header">
<header class="bar bar-header bar-secondary">
<a class="button-prev" href="#">
Previous
</a>
@ -36,7 +36,7 @@
<form>
</form>
</div>
<footer class="bar-footer">
<footer class="bar bar-footer">
</footer>
</body>
</html>

View File

@ -1,3 +1,44 @@
// Use Flexbox for our header and footer bars
.bar {
}
position: fixed;
right: 0;
left: 0;
z-index: 10;
display: -webkit-box;
display: box;
-webkit-box-orient: horizontal;
box-orient: horizontal;
box-sizing: border-box;
// Title inside of a bar is centered
.title {
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
text-align: center;
white-space: nowrap;
}
.title a {
color: inherit;
}
}
// Header at top
.bar-header {
top: 0;
}
// Footer at bottom
.bar-footer {
bottom: 0;
}

View File

@ -0,0 +1,20 @@
.bar {
background-color: $barBackground;
border-bottom: $barBorderBottom;
padding: $barPaddingPortrait;
@media screen and (orientation : landscape) {
padding: $barPaddingLandscape;
}
&.bar-default {
background-color: $barDefaultBackground;
border-bottom: $barDefaultBorderBottom;
}
&.bar-secondary {
background-color: $barSecondaryBackground;
border-bottom: $barSecondaryBorderBottom;
}
}

View File

@ -1,3 +1,4 @@
//
// Buttons
$buttonColor: #222;
$buttonPadding: 10px 10px;
@ -8,3 +9,18 @@ $buttonDefaultBackground: #fff;
$buttonDefaultBackgroundActive: #eee;
$buttonDefaultBorder: #ddd;
//
// Bars
$barPaddingPortrait: 10px;
$barPaddingLandscape : 5px;
$barBackground: white;
$barBorderBottom: 1px solid #ddd;
// Bar variations
$barDefaultBackground: #fff;
$barDefaultBorderBottom: 1px solid #ddd;
$barSecondaryBackground: #f5f5f5;
$barSecondaryBorderBottom: 1px solid #ccc;