Icon-only buttons and rightside button groups

This commit is contained in:
Max Lynch
2013-09-10 10:45:13 -05:00
parent 30718279a5
commit 7a57d2d1c5
7 changed files with 89 additions and 12 deletions

28
dist/ionic.css vendored
View File

@ -465,15 +465,18 @@ a {
box-flex: 1;
-webkit-box-flex: 0;
-moz-box-flex: 0;
background-color: transparent;
line-height: 23px;
font-size: 12px; }
font-size: 12px;
padding: 4px 12px; }
.bar .button-bar {
line-height: 18px; }
.bar .button-bar + .button, .bar .button + .button-bar {
margin-left: 5px; }
.bar .title + .button:last-child,
.bar > .button + .button:last-child,
.bar > .button.pull-right {
.bar > .button.pull-right,
.bar .title + .buttons {
position: absolute;
top: 5px;
right: 5px; }
@ -508,6 +511,9 @@ a {
text-align: center;
cursor: pointer;
margin: 0; }
.button.button-icon {
background: none;
border: none; }
.button.button-block {
margin: 10px 0 10px 0;
display: block;
@ -601,6 +607,16 @@ a {
.button-bar > .button:last-child {
border-right-width: 1px; }
.buttons {
display: -webkit-box;
display: box;
box-flex: 1;
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-orient: horizontal;
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal; }
form {
margin: 0 0 1.42857; }
@ -1974,6 +1990,10 @@ main {
box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.12);
border-color: black; }
.bar .button-icon {
background-color: transparent;
border: 1px solid transparent; }
.button {
color: #222222;
border-radius: 2px;
@ -2069,10 +2089,6 @@ main {
background-color: #303030;
box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.12);
border-color: black; }
.button.button-clear {
background: none;
border: none;
padding: 10px 0px; }
a.button {
text-decoration: none; }

View File

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="/vendor/font-awesome/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" href="../../dist/ionic.css">
<style>
</style>
</head>
<body>
<section>
<header class="bar bar-header bar-primary">
<a href="#" class="button">Back</a>
<h1 class="title">Twitter</h1>
<div class="buttons">
<a href="#" class="button button-icon"><i class="icon-search"></i></a>
<a href="#" class="button button-icon"><i class="icon-search"></i></a>
<a href="#" class="button button-icon"><i class="icon-search"></i></a>
<a href="#" class="button button-icon"><i class="icon-search"></i></a>
</div>
</header>
<main class="content content-padded has-header">
<form class="form-horizontal">
<label class="input-wrapper row-fluid">
<span class="input-label span3">Full name</span>
<input class="span9" type="text" placeholder="">
</label>
<label class="input-wrapper row-fluid">
<span class="input-label span3">Email</span>
<input class="span9" type="email" placeholder="">
</label>
<label class="input-wrapper row-fluid">
<span class="input-label span3">Password</span>
<input class="span9" type="password" placeholder="">
</label>
<button class="button button-info button-block">Sign up</button>
</form>
<button id="login" class="button button-default button-block">Log in</button>
</main>
</section>
</body>
</html>

View File

@ -49,8 +49,10 @@
.button {
@include box-flex(0);
background-color: transparent;
line-height: $barButtonLineHeight;
font-size: 12px;
padding: 4px 12px;
}
.button-bar {
@ -64,7 +66,8 @@
// Place the last button in a bar on the right of the bar
.title + .button:last-child,
> .button + .button:last-child,
> .button.pull-right {
> .button.pull-right,
.title + .buttons {
position: absolute;
top: 5px;
right: 5px;

View File

@ -93,3 +93,13 @@
border-right-width: 1px;
}
}
// Buttons are used to group a set of buttons, useful
// to pull a set of buttons to the right side of a header
// bar, for example.
.buttons {
display: -webkit-box;
display: box;
@include box-flex(1);
@include box-orient(horizontal);
}

View File

@ -6,6 +6,11 @@
cursor: pointer;
margin: 0;
&.button-icon {
background: none;
border: none;
}
&.button-block {
margin: $buttonBlockMargin;
display: block;

View File

@ -131,3 +131,7 @@
}
}
.bar .button-icon {
background-color: transparent;
border: 1px solid transparent;
}

View File

@ -30,11 +30,6 @@
&.button-dark {
@include button-style($buttonDarkBackground, $buttonDarkBorder, $lightColor);
}
&.button-clear {
background: none;
border: none;
padding: $buttonClearPadding;
}
}
a.button {