use <main>

This commit is contained in:
Adam Bradley
2013-08-24 20:48:37 -05:00
parent d9f1c23ee1
commit a1bc08b87e
6 changed files with 225 additions and 22 deletions

View File

@ -14,6 +14,29 @@ body {
a { a {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); } -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
ul {
margin: 0;
padding: 0; }
main {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: auto;
background-color: #fff;
-webkit-overflow-scrolling: touch; }
/* Hack to force all relatively and absolutely positioned elements still render while scrolling
Note: This is a bug for "-webkit-overflow-scrolling: touch" (via ratchet) */
main > * {
-webkit-transform: translateZ(0px);
transform: translateZ(0px); }
.content-padded {
padding: 10px; }
.button { .button {
position: relative; position: relative;
display: inline-block; display: inline-block;
@ -21,3 +44,194 @@ a {
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
margin: 0; } margin: 0; }
.button.button-borderless {
border: none; }
.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;
height: 50px;
/*
.title + .button:last-child,
.button + .button:last-child,
.button.pull-right {
position: absolute;
top: 5px;
right: 5px;
}
*/ }
.bar .title {
/*
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
*/
line-height: 30px;
margin: 0;
text-align: center;
white-space: nowrap;
font-size: 18px;
-webkit-box-flex: 3;
-moz-box-flex: 3;
box-flex: 3; }
.bar .title a {
color: inherit; }
.bar .button {
-webkit-box-flex: 0;
-moz-box-flex: 0;
box-flex: 0; }
.bar-header {
top: 0; }
.bar-footer {
bottom: 0; }
/* Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab.
Note: For these to work, content must come after both bars in the markup */
.bar ~ main {
top: 50px; }
.bar ~ main {
bottom: 50px; }
/* Bar docked to bottom used for primary app navigation */
.tabs {
right: 0;
left: 0;
bottom: 0;
height: 50px;
padding: 0;
box-sizing: border-box;
position: fixed; }
.tabs-inner {
display: -webkit-box;
display: box;
height: 100%;
list-style: none;
-webkit-box-orient: horizontal;
box-orient: horizontal; }
/* Navigational tab */
.tab-item {
height: 100%;
text-align: center;
box-sizing: border-box;
-webkit-box-flex: 1;
box-flex: 1; }
.tab-item a {
text-decoration: none;
display: block;
width: 100%;
height: 100%; }
/* Active state for tab */
.tab-item.active, .tab-item:active {
background-color: rgba(0, 0, 0, 0.2); }
/* Icon for tab */
.tab-item i {
display: block;
margin: 0 auto; }
/* Label for tab */
.tab-label {
margin-top: 1px;
font-size: 10px;
font-weight: bold;
color: #fff; }
.button-group {
position: relative;
display: inline-block;
vertical-align: middle; }
.button-group > .button {
position: relative;
float: left; }
.button-group > .button:hover, .button-group > .button:focus, .button-group > .button:active, .button-group > .button.active {
z-index: 2; }
.button-group > .button:focus {
outline: none; }
.button-group .button + .button,
.button-group .button + .button-group,
.button-group .button-group + .button,
.button-group .button-group + .button-group {
margin-left: -1px; }
.button-group > .button:not(:first-child):not(:last-child) {
border-radius: 0; }
.button-group > .button:first-child {
margin-left: 0; }
.button-group > .button:first-child:not(:last-child) {
border-bottom-right-radius: 0;
border-top-right-radius: 0; }
.button-group > .button:last-child:not(:first-child) {
border-bottom-left-radius: 0;
border-top-left-radius: 0; }
.button-group > .button-group {
float: left; }
.button-group > .button-group:not(:first-child):not(:last-child) > .button {
border-radius: 0; }
.button-group > .button-group:first-child > .button:last-child,
.button-group > .button-group:first-child > .dropdown-toggle {
border-bottom-right-radius: 0;
border-top-right-radius: 0; }
.button-group > .button-group:last-child > .button:first-child {
border-bottom-left-radius: 0;
border-top-left-radius: 0; }
.list {
margin-bottom: 20px;
padding-left: 0; }
.list-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
border: 1px solid #dddddd; }
.list-item:last-child {
margin-bottom: 0; }
.list-item > .badge {
float: right; }
.list-item > i:last-child {
float: right; }
.list-item > .badge + .badge {
margin-right: 5px; }
.list-item.active, .list-item.active:hover, .list-item.active:focus {
z-index: 2; }
.list-item.active .list-item-heading, .list-item.active:hover .list-item-heading, .list-item.active:focus .list-item-heading {
color: inherit; }
a.list-item {
text-decoration: none; }
a.list-item:hover, a.list-item:focus {
text-decoration: none; }
.list-divider {
padding: 5px 15px; }
.list-item-heading {
margin-top: 0;
margin-bottom: 5px; }
.list-item-text {
margin-bottom: 0;
line-height: 1.3; }

View File

@ -1,8 +0,0 @@
@charset "UTF-8";
.button {
color: #333333;
border-radius: 2px; }
.button-default {
background-color: #fff;
border: 1px solid #dddddd; }

View File

@ -58,11 +58,6 @@
<footer class="bar-footer"></footer> <footer class="bar-footer"></footer>
<script id="framework-globals" type="text/globals">
asdfasf
</script>
<script src="../js/jquery/jquery-1.10.2.js"></script> <script src="../js/jquery/jquery-1.10.2.js"></script>
<script src="../js/framework/framework-utilities.js"></script> <script src="../js/framework/framework-utilities.js"></script>
<script src="../js/framework/framework-navigation.js"></script> <script src="../js/framework/framework-navigation.js"></script>

View File

@ -27,7 +27,8 @@
<script src="app.js"></script> <script src="app.js"></script>
</head> </head>
<body ontouchstart=""> <body ontouchstart="">
<header class="bar bar-header bar-secondary">
<header class="bar bar-header bar-secondary framework-global" data-global-id="primary-header">
<a class="button button-previous" href="#"> <a class="button button-previous" href="#">
<i class="icon-arrow-left"></i> <i class="icon-arrow-left"></i>
</a> </a>
@ -36,7 +37,8 @@
<i class="icon-arrow-right"></i> <i class="icon-arrow-right"></i>
</a> </a>
</header> </header>
<div class="content">
<main>
<ul class="list"> <ul class="list">
<a href="#" class="list-item"> <a href="#" class="list-item">
Sasafras Sasafras
@ -96,11 +98,11 @@
Here is some content Here is some content
</p> </p>
<a class="button button-default">Click me</a> <a class="button button-default">Click me</a>
<form> </main>
</form>
</div>
<footer class="bar bar-footer bar-secondary"> <footer class="bar bar-footer bar-secondary">
<h1 class="title">Auf Wiedersehen</h1> <h1 class="title">Auf Wiedersehen</h1>
</footer> </footer>
</body> </body>
</html> </html>

View File

@ -75,9 +75,9 @@
/* Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab. /* Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab.
Note: For these to work, content must come after both bars in the markup */ Note: For these to work, content must come after both bars in the markup */
.bar ~ .content { .bar ~ main {
top: $barHeight; top: $barHeight;
} }
.bar ~ .content { .bar ~ main {
bottom: $barHeight; bottom: $barHeight;
} }

View File

@ -21,7 +21,7 @@ a {
ul { margin: 0; padding: 0; } ul { margin: 0; padding: 0; }
.content { main {
position: fixed; position: fixed;
top: 0; top: 0;
right: 0; right: 0;
@ -35,7 +35,7 @@ ul { margin: 0; padding: 0; }
/* Hack to force all relatively and absolutely positioned elements still render while scrolling /* Hack to force all relatively and absolutely positioned elements still render while scrolling
Note: This is a bug for "-webkit-overflow-scrolling: touch" (via ratchet) */ Note: This is a bug for "-webkit-overflow-scrolling: touch" (via ratchet) */
.content > * { main > * {
-webkit-transform: translateZ(0px); -webkit-transform: translateZ(0px);
transform: translateZ(0px); transform: translateZ(0px);
} }