Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
532ee082
Commit
532ee082
authored
Sep 20, 2012
by
Mark Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #5150: add btn-group support to input groups
parent
443c43f6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
300 additions
and
24 deletions
+300
-24
docs/assets/css/bootstrap.css
docs/assets/css/bootstrap.css
+22
-1
docs/base-css.html
docs/base-css.html
+131
-11
docs/templates/pages/base-css.mustache
docs/templates/pages/base-css.mustache
+131
-11
less/forms.less
less/forms.less
+16
-1
No files found.
docs/assets/css/bootstrap.css
View file @
532ee082
...
...
@@ -1648,8 +1648,17 @@ select:focus:required:invalid:focus {
border-radius
:
4px
0
0
4px
;
}
.input-append
input
+
.btn-group
.btn
,
.input-append
select
+
.btn-group
.btn
,
.input-append
.uneditable-input
+
.btn-group
.btn
{
-webkit-border-radius
:
0
4px
4px
0
;
-moz-border-radius
:
0
4px
4px
0
;
border-radius
:
0
4px
4px
0
;
}
.input-append
.add-on
,
.input-append
.btn
{
.input-append
.btn
,
.input-append
.btn-group
{
margin-left
:
-1px
;
}
...
...
@@ -1668,6 +1677,14 @@ select:focus:required:invalid:focus {
border-radius
:
0
;
}
.input-prepend.input-append
input
+
.btn-group
.btn
,
.input-prepend.input-append
select
+
.btn-group
.btn
,
.input-prepend.input-append
.uneditable-input
+
.btn-group
.btn
{
-webkit-border-radius
:
0
4px
4px
0
;
-moz-border-radius
:
0
4px
4px
0
;
border-radius
:
0
4px
4px
0
;
}
.input-prepend.input-append
.add-on
:first-child
,
.input-prepend.input-append
.btn
:first-child
{
margin-right
:
-1px
;
...
...
@@ -1684,6 +1701,10 @@ select:focus:required:invalid:focus {
border-radius
:
0
4px
4px
0
;
}
.input-prepend.input-append
.btn-group
:first-child
{
margin-left
:
0
;
}
input
.search-query
{
padding-right
:
14px
;
padding-right
:
4px
\
9
;
...
...
docs/base-css.html
View file @
532ee082
...
...
@@ -1131,20 +1131,22 @@ For example, <code><section></code> should be wrapped as inlin
<form
class=
"bs-docs-example"
>
<div
class=
"input-prepend"
>
<span
class=
"add-on"
>
@
</span>
<input
class=
"span2"
id=
"prependedInput"
size=
"16"
type=
"text"
placeholder=
"Username"
>
<input
class=
"span2"
id=
"prependedInput"
type=
"text"
placeholder=
"Username"
>
</div>
<br>
<div
class=
"input-append"
>
<input
class=
"span2"
id=
"appendedInput"
size=
"16"
type=
"text"
>
<input
class=
"span2"
id=
"appendedInput"
type=
"text"
>
<span
class=
"add-on"
>
.00
</span>
</div>
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-prepend"
>
<
span class="add-on"
>
@
<
/span
><
input class="span2" id="prependedInput" size="16" type="text" placeholder="Username"
>
<
span class="add-on"
>
@
<
/span
>
<
input class="span2" id="prependedInput" type="text" placeholder="Username"
>
<
/div
>
<
div class="input-append"
>
<
input class="span2" id="appendedInput" size="16" type="text"
><
span class="add-on"
>
.00
<
/span
>
<
input class="span2" id="appendedInput" type="text"
>
<
span class="add-on"
>
.00
<
/span
>
<
/div
>
</pre>
...
...
@@ -1153,13 +1155,15 @@ For example, <code><section></code> should be wrapped as inlin
<form
class=
"bs-docs-example form-inline"
>
<div
class=
"input-prepend input-append"
>
<span
class=
"add-on"
>
$
</span>
<input
class=
"span2"
id=
"appendedPrependedInput"
size=
"16"
type=
"text"
>
<input
class=
"span2"
id=
"appendedPrependedInput"
type=
"text"
>
<span
class=
"add-on"
>
.00
</span>
</div>
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-prepend input-append"
>
<
span class="add-on"
>
$
<
/span
><
input class="span2" id="appendedPrependedInput" size="16" type="text"
><
span class="add-on"
>
.00
<
/span
>
<
span class="add-on"
>
$
<
/span
>
<
input class="span2" id="appendedPrependedInput" type="text"
>
<
span class="add-on"
>
.00
<
/span
>
<
/div
>
</pre>
...
...
@@ -1167,23 +1171,139 @@ For example, <code><section></code> should be wrapped as inlin
<p>
Instead of a
<code>
<
span
>
</code>
with text, use a
<code>
.btn
</code>
to attach a button (or two) to an input.
</p>
<form
class=
"bs-docs-example"
>
<div
class=
"input-append"
>
<input
class=
"span2"
id=
"appendedInputButton"
size=
"16"
type=
"text"
>
<input
class=
"span2"
id=
"appendedInputButton"
type=
"text"
>
<button
class=
"btn"
type=
"button"
>
Go!
</button>
</div>
<br>
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-append"
>
<
input class="span2" id="appendedInputButton" type="text"
>
<
button class="btn" type="button"
>
Go!
<
/button
>
<
/div
>
</pre>
<form
class=
"bs-docs-example"
>
<div
class=
"input-append"
>
<input
class=
"span2"
id=
"appendedInputButtons"
size=
"16"
type=
"text"
>
<input
class=
"span2"
id=
"appendedInputButtons"
type=
"text"
>
<button
class=
"btn"
type=
"button"
>
Search
</button>
<button
class=
"btn"
type=
"button"
>
Options
</button>
</div>
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-append"
>
<
input class="span2" id="appendedInputButton" size="16" type="text"
><
button class="btn" type="button"
>
Go!
<
/button
>
<
input class="span2" id="appendedInputButtons" type="text"
>
<
button class="btn" type="button"
>
Search
<
/button
>
<
button class="btn" type="button"
>
Options
<
/button
>
<
/div
>
</pre>
<h4>
Button dropdowns
</h4>
<p></p>
<form
class=
"bs-docs-example"
>
<div
class=
"input-append"
>
<input
class=
"span2"
id=
"appendedDropdownButton"
type=
"text"
>
<div
class=
"btn-group"
>
<button
class=
"btn dropdown-toggle"
data-toggle=
"dropdown"
>
Action
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
>
Action
</a></li>
<li><a
href=
"#"
>
Another action
</a></li>
<li><a
href=
"#"
>
Something else here
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
>
Separated link
</a></li>
</ul>
</div>
<!-- /btn-group -->
</div>
<!-- /input-append -->
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-append"
>
<
input class="span2" id="appendedInputButtons" size="16" type="text"
><
button class="btn" type="button"
>
Search
<
/button
><
button class="btn" type="button"
>
Options
<
/button
>
<
input class="span2" id="appendedDropdownButton" type="text"
>
<
div class="btn-group"
>
<
button class="btn dropdown-toggle" data-toggle="dropdown"
>
Action
<
span class="caret"
><
/span
>
<
/button
>
<
ul class="dropdown-menu"
>
...
<
/ul
>
<
/div
>
<
/div
>
</pre>
<form
class=
"bs-docs-example"
>
<div
class=
"input-prepend"
>
<div
class=
"btn-group"
>
<button
class=
"btn dropdown-toggle"
data-toggle=
"dropdown"
>
Action
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
>
Action
</a></li>
<li><a
href=
"#"
>
Another action
</a></li>
<li><a
href=
"#"
>
Something else here
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
>
Separated link
</a></li>
</ul>
</div>
<!-- /btn-group -->
<input
class=
"span2"
id=
"prependedDropdownButton"
type=
"text"
>
</div>
<!-- /input-prepend -->
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-prepend"
>
<
div class="btn-group"
>
<
button class="btn dropdown-toggle" data-toggle="dropdown"
>
Action
<
span class="caret"
><
/span
>
<
/button
>
<
ul class="dropdown-menu"
>
...
<
/ul
>
<
/div
>
<
input class="span2" id="prependedDropdownButton" type="text"
>
<
/div
>
</pre>
<form
class=
"bs-docs-example"
>
<div
class=
"input-prepend input-append"
>
<div
class=
"btn-group"
>
<button
class=
"btn dropdown-toggle"
data-toggle=
"dropdown"
>
Action
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
>
Action
</a></li>
<li><a
href=
"#"
>
Another action
</a></li>
<li><a
href=
"#"
>
Something else here
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
>
Separated link
</a></li>
</ul>
</div>
<!-- /btn-group -->
<input
class=
"span2"
id=
"appendedPrependedDropdownButton"
type=
"text"
>
<div
class=
"btn-group"
>
<button
class=
"btn dropdown-toggle"
data-toggle=
"dropdown"
>
Action
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
>
Action
</a></li>
<li><a
href=
"#"
>
Another action
</a></li>
<li><a
href=
"#"
>
Something else here
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
>
Separated link
</a></li>
</ul>
</div>
<!-- /btn-group -->
</div>
<!-- /input-prepend input-append -->
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-prepend input-append"
>
<
div class="btn-group"
>
<
button class="btn dropdown-toggle" data-toggle="dropdown"
>
Action
<
span class="caret"
><
/span
>
<
/button
>
<
ul class="dropdown-menu"
>
...
<
/ul
>
<
/div
>
<
input class="span2" id="appendedPrependedDropdownButton" type="text"
>
<
div class="btn-group"
>
<
button class="btn dropdown-toggle" data-toggle="dropdown"
>
Action
<
span class="caret"
><
/span
>
<
/button
>
<
ul class="dropdown-menu"
>
...
<
/ul
>
<
/div
>
<
/div
>
</pre>
...
...
docs/templates/pages/base-css.mustache
View file @
532ee082
...
...
@@ -1068,20 +1068,22 @@
<form
class=
"bs-docs-example"
>
<div
class=
"input-prepend"
>
<span
class=
"add-on"
>
@
</span>
<input
class=
"span2"
id=
"prependedInput"
size=
"16"
type=
"text"
placeholder=
"
{{
_i
}}
Username
{{/
i
}}
"
>
<input
class=
"span2"
id=
"prependedInput"
type=
"text"
placeholder=
"
{{
_i
}}
Username
{{/
i
}}
"
>
</div>
<br>
<div
class=
"input-append"
>
<input
class=
"span2"
id=
"appendedInput"
size=
"16"
type=
"text"
>
<input
class=
"span2"
id=
"appendedInput"
type=
"text"
>
<span
class=
"add-on"
>
.00
</span>
</div>
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-prepend"
>
<
span class="add-on"
>
@
<
/span
><
input class="span2" id="prependedInput" size="16" type="text" placeholder="
{{
_i
}}
Username
{{/
i
}}
"
>
<
span class="add-on"
>
@
<
/span
>
<
input class="span2" id="prependedInput" type="text" placeholder="
{{
_i
}}
Username
{{/
i
}}
"
>
<
/div
>
<
div class="input-append"
>
<
input class="span2" id="appendedInput" size="16" type="text"
><
span class="add-on"
>
.00
<
/span
>
<
input class="span2" id="appendedInput" type="text"
>
<
span class="add-on"
>
.00
<
/span
>
<
/div
>
</pre>
...
...
@@ -1090,13 +1092,15 @@
<form
class=
"bs-docs-example form-inline"
>
<div
class=
"input-prepend input-append"
>
<span
class=
"add-on"
>
$
</span>
<input
class=
"span2"
id=
"appendedPrependedInput"
size=
"16"
type=
"text"
>
<input
class=
"span2"
id=
"appendedPrependedInput"
type=
"text"
>
<span
class=
"add-on"
>
.00
</span>
</div>
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-prepend input-append"
>
<
span class="add-on"
>
$
<
/span
><
input class="span2" id="appendedPrependedInput" size="16" type="text"
><
span class="add-on"
>
.00
<
/span
>
<
span class="add-on"
>
$
<
/span
>
<
input class="span2" id="appendedPrependedInput" type="text"
>
<
span class="add-on"
>
.00
<
/span
>
<
/div
>
</pre>
...
...
@@ -1104,23 +1108,139 @@
<p>
{{
_i
}}
Instead of a
<code>
<
span
>
</code>
with text, use a
<code>
.btn
</code>
to attach a button (or two) to an input.
{{/
i
}}
</p>
<form
class=
"bs-docs-example"
>
<div
class=
"input-append"
>
<input
class=
"span2"
id=
"appendedInputButton"
size=
"16"
type=
"text"
>
<input
class=
"span2"
id=
"appendedInputButton"
type=
"text"
>
<button
class=
"btn"
type=
"button"
>
Go!
</button>
</div>
<br>
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-append"
>
<
input class="span2" id="appendedInputButton" type="text"
>
<
button class="btn" type="button"
>
Go!
<
/button
>
<
/div
>
</pre>
<form
class=
"bs-docs-example"
>
<div
class=
"input-append"
>
<input
class=
"span2"
id=
"appendedInputButtons"
size=
"16"
type=
"text"
>
<input
class=
"span2"
id=
"appendedInputButtons"
type=
"text"
>
<button
class=
"btn"
type=
"button"
>
Search
</button>
<button
class=
"btn"
type=
"button"
>
Options
</button>
</div>
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-append"
>
<
input class="span2" id="appendedInputButton" size="16" type="text"
><
button class="btn" type="button"
>
Go!
<
/button
>
<
input class="span2" id="appendedInputButtons" type="text"
>
<
button class="btn" type="button"
>
Search
<
/button
>
<
button class="btn" type="button"
>
Options
<
/button
>
<
/div
>
</pre>
<h4>
{{
_i
}}
Button dropdowns
{{/
i
}}
</h4>
<p>
{{
_i
}}{{/
i
}}
</p>
<form
class=
"bs-docs-example"
>
<div
class=
"input-append"
>
<input
class=
"span2"
id=
"appendedDropdownButton"
type=
"text"
>
<div
class=
"btn-group"
>
<button
class=
"btn dropdown-toggle"
data-toggle=
"dropdown"
>
{{
_i
}}
Action
{{/
i
}}
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
>
{{
_i
}}
Action
{{/
i
}}
</a></li>
<li><a
href=
"#"
>
{{
_i
}}
Another action
{{/
i
}}
</a></li>
<li><a
href=
"#"
>
{{
_i
}}
Something else here
{{/
i
}}
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
>
{{
_i
}}
Separated link
{{/
i
}}
</a></li>
</ul>
</div>
<!-- /btn-group -->
</div>
<!-- /input-append -->
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-append"
>
<
input class="span2" id="appendedInputButtons" size="16" type="text"
><
button class="btn" type="button"
>
Search
<
/button
><
button class="btn" type="button"
>
Options
<
/button
>
<
input class="span2" id="appendedDropdownButton" type="text"
>
<
div class="btn-group"
>
<
button class="btn dropdown-toggle" data-toggle="dropdown"
>
{{
_i
}}
Action
{{/
i
}}
<
span class="caret"
><
/span
>
<
/button
>
<
ul class="dropdown-menu"
>
...
<
/ul
>
<
/div
>
<
/div
>
</pre>
<form
class=
"bs-docs-example"
>
<div
class=
"input-prepend"
>
<div
class=
"btn-group"
>
<button
class=
"btn dropdown-toggle"
data-toggle=
"dropdown"
>
{{
_i
}}
Action
{{/
i
}}
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
>
{{
_i
}}
Action
{{/
i
}}
</a></li>
<li><a
href=
"#"
>
{{
_i
}}
Another action
{{/
i
}}
</a></li>
<li><a
href=
"#"
>
{{
_i
}}
Something else here
{{/
i
}}
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
>
{{
_i
}}
Separated link
{{/
i
}}
</a></li>
</ul>
</div>
<!-- /btn-group -->
<input
class=
"span2"
id=
"prependedDropdownButton"
type=
"text"
>
</div>
<!-- /input-prepend -->
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-prepend"
>
<
div class="btn-group"
>
<
button class="btn dropdown-toggle" data-toggle="dropdown"
>
{{
_i
}}
Action
{{/
i
}}
<
span class="caret"
><
/span
>
<
/button
>
<
ul class="dropdown-menu"
>
...
<
/ul
>
<
/div
>
<
input class="span2" id="prependedDropdownButton" type="text"
>
<
/div
>
</pre>
<form
class=
"bs-docs-example"
>
<div
class=
"input-prepend input-append"
>
<div
class=
"btn-group"
>
<button
class=
"btn dropdown-toggle"
data-toggle=
"dropdown"
>
{{
_i
}}
Action
{{/
i
}}
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
>
{{
_i
}}
Action
{{/
i
}}
</a></li>
<li><a
href=
"#"
>
{{
_i
}}
Another action
{{/
i
}}
</a></li>
<li><a
href=
"#"
>
{{
_i
}}
Something else here
{{/
i
}}
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
>
{{
_i
}}
Separated link
{{/
i
}}
</a></li>
</ul>
</div>
<!-- /btn-group -->
<input
class=
"span2"
id=
"appendedPrependedDropdownButton"
type=
"text"
>
<div
class=
"btn-group"
>
<button
class=
"btn dropdown-toggle"
data-toggle=
"dropdown"
>
{{
_i
}}
Action
{{/
i
}}
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"#"
>
{{
_i
}}
Action
{{/
i
}}
</a></li>
<li><a
href=
"#"
>
{{
_i
}}
Another action
{{/
i
}}
</a></li>
<li><a
href=
"#"
>
{{
_i
}}
Something else here
{{/
i
}}
</a></li>
<li
class=
"divider"
></li>
<li><a
href=
"#"
>
{{
_i
}}
Separated link
{{/
i
}}
</a></li>
</ul>
</div>
<!-- /btn-group -->
</div>
<!-- /input-prepend input-append -->
</form>
<pre
class=
"prettyprint linenums"
>
<
div class="input-prepend input-append"
>
<
div class="btn-group"
>
<
button class="btn dropdown-toggle" data-toggle="dropdown"
>
{{
_i
}}
Action
{{/
i
}}
<
span class="caret"
><
/span
>
<
/button
>
<
ul class="dropdown-menu"
>
...
<
/ul
>
<
/div
>
<
input class="span2" id="appendedPrependedDropdownButton" type="text"
>
<
div class="btn-group"
>
<
button class="btn dropdown-toggle" data-toggle="dropdown"
>
{{
_i
}}
Action
{{/
i
}}
<
span class="caret"
><
/span
>
<
/button
>
<
ul class="dropdown-menu"
>
...
<
/ul
>
<
/div
>
<
/div
>
</pre>
...
...
less/forms.less
View file @
532ee082
...
...
@@ -466,6 +466,7 @@ select:focus:required:invalid {
border-color: @green;
}
}
.input-prepend {
.add-on,
.btn {
...
...
@@ -473,17 +474,23 @@ select:focus:required:invalid {
}
.add-on:first-child,
.btn:first-child {
// FYI, `.btn:first-child` accounts for a button group that's prepended
.border-radius(@inputBorderRadius 0 0 @inputBorderRadius);
}
}
.input-append {
input,
select,
.uneditable-input {
.border-radius(@inputBorderRadius 0 0 @inputBorderRadius);
+ .btn-group .btn {
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
}
}
.add-on,
.btn {
.btn,
.btn-group {
margin-left: -1px;
}
.add-on:last-child,
...
...
@@ -491,12 +498,16 @@ select:focus:required:invalid {
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
}
}
// Remove all border-radius for inputs with both prepend and append
.input-prepend.input-append {
input,
select,
.uneditable-input {
.border-radius(0);
+ .btn-group .btn {
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
}
}
.add-on:first-child,
.btn:first-child {
...
...
@@ -508,10 +519,14 @@ select:focus:required:invalid {
margin-left: -1px;
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
}
.btn-group:first-child {
margin-left: 0;
}
}
// SEARCH FORM
// -----------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment