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
21bebe77
Commit
21bebe77
authored
Jan 30, 2012
by
Mark Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor buttons.less
parent
155047c3
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
471 additions
and
460 deletions
+471
-460
docs/assets/bootstrap.zip
docs/assets/bootstrap.zip
+0
-0
docs/assets/css/bootstrap.css
docs/assets/css/bootstrap.css
+86
-86
docs/assets/css/docs.css
docs/assets/css/docs.css
+1
-1
docs/index.html
docs/index.html
+136
-139
docs/templates/pages/index.mustache
docs/templates/pages/index.mustache
+130
-133
less/buttons.less
less/buttons.less
+118
-101
No files found.
docs/assets/bootstrap.zip
View file @
21bebe77
No preview for this file type
docs/assets/css/bootstrap.css
View file @
21bebe77
...
@@ -1653,6 +1653,92 @@ table .span12 {
...
@@ -1653,6 +1653,92 @@ table .span12 {
filter
:
alpha
(
opacity
=
40
);
filter
:
alpha
(
opacity
=
40
);
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.btn
{
display
:
inline-block
;
padding
:
4px
10px
4px
;
font-size
:
13px
;
line-height
:
18px
;
color
:
#333333
;
text-align
:
center
;
text-shadow
:
0
1px
1px
rgba
(
255
,
255
,
255
,
0.75
);
background-color
:
#fafafa
;
background-image
:
-webkit-gradient
(
linear
,
0
0
,
0
100%
,
from
(
#ffffff
),
color-stop
(
25%
,
#ffffff
),
to
(
#e6e6e6
));
background-image
:
-webkit-linear-gradient
(
#ffffff
,
#ffffff
25%
,
#e6e6e6
);
background-image
:
-moz-linear-gradient
(
top
,
#ffffff
,
#ffffff
25%
,
#e6e6e6
);
background-image
:
-ms-linear-gradient
(
#ffffff
,
#ffffff
25%
,
#e6e6e6
);
background-image
:
-o-linear-gradient
(
#ffffff
,
#ffffff
25%
,
#e6e6e6
);
background-image
:
linear-gradient
(
#ffffff
,
#ffffff
25%
,
#e6e6e6
);
background-repeat
:
no-repeat
;
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
startColorstr
=
'#ffffff'
,
endColorstr
=
'#e6e6e6'
,
GradientType
=
0
);
border
:
1px
solid
#ccc
;
border-bottom-color
:
#bbb
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;
-webkit-box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
-moz-box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
cursor
:
pointer
;
*
margin-left
:
.3em
;
}
.btn
:first-child
{
*
margin-left
:
0
;
}
.btn
:hover
{
color
:
#333333
;
text-decoration
:
none
;
background-color
:
#e6e6e6
;
background-position
:
0
-15px
;
-webkit-transition
:
background-position
0.1s
linear
;
-moz-transition
:
background-position
0.1s
linear
;
-ms-transition
:
background-position
0.1s
linear
;
-o-transition
:
background-position
0.1s
linear
;
transition
:
background-position
0.1s
linear
;
}
.btn
:focus
{
outline
:
thin
dotted
;
outline
:
5px
auto
-webkit-focus-ring-color
;
outline-offset
:
-2px
;
}
.btn.active
,
.btn
:active
{
background-image
:
none
;
-webkit-box-shadow
:
inset
0
2px
4px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
-moz-box-shadow
:
inset
0
2px
4px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
inset
0
2px
4px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
background-color
:
#e6e6e6
;
background-color
:
#d9d9d9
\
9
;
color
:
rgba
(
0
,
0
,
0
,
0.5
);
outline
:
0
;
}
.btn.disabled
,
.btn
[
disabled
]
{
cursor
:
default
;
background-image
:
none
;
background-color
:
#e6e6e6
;
opacity
:
0.65
;
filter
:
alpha
(
opacity
=
65
);
-webkit-box-shadow
:
none
;
-moz-box-shadow
:
none
;
box-shadow
:
none
;
}
.btn.large
{
padding
:
9px
14px
;
font-size
:
15px
;
line-height
:
normal
;
-webkit-border-radius
:
5px
;
-moz-border-radius
:
5px
;
border-radius
:
5px
;
}
.btn.large
.icon
{
margin-top
:
1px
;
}
.btn.small
{
padding
:
5px
9px
;
font-size
:
11px
;
line-height
:
16px
;
}
.btn.small
.icon
{
margin-top
:
-1px
;
}
.btn.primary
,
.btn.primary
,
.btn.primary
:hover
,
.btn.primary
:hover
,
.btn.warning
,
.btn.warning
,
...
@@ -1793,92 +1879,6 @@ table .span12 {
...
@@ -1793,92 +1879,6 @@ table .span12 {
.btn.info
:active
,
.btn.info.active
{
.btn.info
:active
,
.btn.info.active
{
background-color
:
#24748c
\
9
;
background-color
:
#24748c
\
9
;
}
}
.btn
{
display
:
inline-block
;
padding
:
4px
10px
4px
;
font-size
:
13px
;
line-height
:
18px
;
color
:
#333333
;
text-align
:
center
;
text-shadow
:
0
1px
1px
rgba
(
255
,
255
,
255
,
0.75
);
background-color
:
#fafafa
;
background-image
:
-webkit-gradient
(
linear
,
0
0
,
0
100%
,
from
(
#ffffff
),
color-stop
(
25%
,
#ffffff
),
to
(
#e6e6e6
));
background-image
:
-webkit-linear-gradient
(
#ffffff
,
#ffffff
25%
,
#e6e6e6
);
background-image
:
-moz-linear-gradient
(
top
,
#ffffff
,
#ffffff
25%
,
#e6e6e6
);
background-image
:
-ms-linear-gradient
(
#ffffff
,
#ffffff
25%
,
#e6e6e6
);
background-image
:
-o-linear-gradient
(
#ffffff
,
#ffffff
25%
,
#e6e6e6
);
background-image
:
linear-gradient
(
#ffffff
,
#ffffff
25%
,
#e6e6e6
);
background-repeat
:
no-repeat
;
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
startColorstr
=
'#ffffff'
,
endColorstr
=
'#e6e6e6'
,
GradientType
=
0
);
border
:
1px
solid
#ccc
;
border-bottom-color
:
#bbb
;
-webkit-border-radius
:
4px
;
-moz-border-radius
:
4px
;
border-radius
:
4px
;
-webkit-box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
-moz-box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
inset
0
1px
0
rgba
(
255
,
255
,
255
,
0.2
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
cursor
:
pointer
;
*
margin-left
:
.3em
;
}
.btn
:first-child
{
*
margin-left
:
0
;
}
.btn
:hover
{
color
:
#333333
;
text-decoration
:
none
;
background-color
:
#e6e6e6
;
background-position
:
0
-15px
;
-webkit-transition
:
background-position
0.1s
linear
;
-moz-transition
:
background-position
0.1s
linear
;
-ms-transition
:
background-position
0.1s
linear
;
-o-transition
:
background-position
0.1s
linear
;
transition
:
background-position
0.1s
linear
;
}
.btn
:focus
{
outline
:
thin
dotted
;
outline
:
5px
auto
-webkit-focus-ring-color
;
outline-offset
:
-2px
;
}
.btn.active
,
.btn
:active
{
background-image
:
none
;
-webkit-box-shadow
:
inset
0
2px
4px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
-moz-box-shadow
:
inset
0
2px
4px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
inset
0
2px
4px
rgba
(
0
,
0
,
0
,
0.15
),
0
1px
2px
rgba
(
0
,
0
,
0
,
0.05
);
background-color
:
#e6e6e6
;
background-color
:
#d9d9d9
\
9
;
color
:
rgba
(
0
,
0
,
0
,
0.5
);
outline
:
0
;
}
.btn.disabled
,
.btn
[
disabled
]
{
cursor
:
default
;
background-image
:
none
;
background-color
:
#e6e6e6
;
opacity
:
0.65
;
filter
:
alpha
(
opacity
=
65
);
-webkit-box-shadow
:
none
;
-moz-box-shadow
:
none
;
box-shadow
:
none
;
}
.btn.large
{
padding
:
9px
14px
;
font-size
:
15px
;
line-height
:
normal
;
-webkit-border-radius
:
5px
;
-moz-border-radius
:
5px
;
border-radius
:
5px
;
}
.btn.large
.icon
{
margin-top
:
1px
;
}
.btn.small
{
padding
:
5px
9px
;
font-size
:
11px
;
line-height
:
16px
;
}
.btn.small
.icon
{
margin-top
:
-1px
;
}
button
.btn
,
input
[
type
=
"submit"
]
.btn
{
button
.btn
,
input
[
type
=
"submit"
]
.btn
{
*
padding-top
:
2px
;
*
padding-top
:
2px
;
*
padding-bottom
:
2px
;
*
padding-bottom
:
2px
;
...
...
docs/assets/css/docs.css
View file @
21bebe77
...
@@ -73,7 +73,7 @@ hr.soften {
...
@@ -73,7 +73,7 @@ hr.soften {
line-height
:
36px
;
line-height
:
36px
;
color
:
#333
;
color
:
#333
;
}
}
.jumbotron
.btn
-large
{
.jumbotron
.btn
{
font-size
:
20px
;
font-size
:
20px
;
font-weight
:
normal
;
font-weight
:
normal
;
padding
:
14px
24px
;
padding
:
14px
24px
;
...
...
docs/index.html
View file @
21bebe77
This diff is collapsed.
Click to expand it.
docs/templates/pages/index.mustache
View file @
21bebe77
This diff is collapsed.
Click to expand it.
less/buttons.less
View file @
21bebe77
...
@@ -2,57 +2,11 @@
...
@@ -2,57 +2,11 @@
// -------------
// -------------
// Colors
// ------
.btn {
// Set text color
&.primary,
&.primary:hover,
&.warning,
&.warning:hover,
&.danger,
&.danger:hover,
&.success,
&.success:hover,
&.info,
&.info:hover {
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
color: @white
}
&.primary.active,
&.warning.active,
&.danger.active,
&.success.active,
&.info.active {
color: rgba(255,255,255,.75);
}
&.primary {
.buttonBackground(@primaryButtonBackground, spin(@primaryButtonBackground, 20));
}
// Warning appears are orange
&.warning {
.buttonBackground(lighten(@orange, 15%), @orange);
}
// Danger and error appear as red
&.danger {
.buttonBackground(#ee5f5b, #bd362f);
}
// Success appears as green
&.success {
.buttonBackground(#62c462, #51a351);
}
// Info appears as a neutral blue
&.info {
.buttonBackground(#5bc0de, #2f96b4);
}
}
// Base styles
// Base styles
// -----------
// -----------
---------------------------------------
// Core
.btn {
.btn {
// Button Base
display: inline-block;
display: inline-block;
padding: 4px 10px 4px;
padding: 4px 10px 4px;
font-size: @baseFontSize;
font-size: @baseFontSize;
...
@@ -68,70 +22,133 @@
...
@@ -68,70 +22,133 @@
.box-shadow(@shadow);
.box-shadow(@shadow);
cursor: pointer;
cursor: pointer;
// Give IE7 some love
.ie7-restore-left-whitespace();
.ie7-restore-left-whitespace();
}
&:hover {
// Hover state
color: @grayDark;
.btn:hover {
text-decoration: none;
color: @grayDark;
background-color: darken(@white, 10%);
text-decoration: none;
background-position: 0 -15px;
background-color: darken(@white, 10%);
background-position: 0 -15px;
// transition is only when going to hover, otherwise the background
// transition is only when going to hover, otherwise the background
// behind the gradient (there for IE<=9 fallback) gets mismatched
// behind the gradient (there for IE<=9 fallback) gets mismatched
.transition(background-position .1s linear);
.transition(background-position .1s linear);
}
}
// Focus state for keyboard and accessibility
// Focus state for keyboard and accessibility
&
:focus {
.btn
:focus {
.tab-focus();
.tab-focus();
}
}
// Active and Disabled states
// Active state
&.active,
.btn.active,
&:active {
.btn:active {
background-image: none;
background-image: none;
@shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
@shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
.box-shadow(@shadow);
.box-shadow(@shadow);
background-color: darken(@white, 10%);
background-color: darken(@white, 10%);
background-color: darken(@white, 15%) e("\9");
background-color: darken(@white, 15%) e("\9");
color: rgba(0,0,0,.5);
color: rgba(0,0,0,.5);
outline: 0;
outline: 0;
}
}
&.disabled,
&[disabled] {
cursor: default;
background-image: none;
background-color: darken(@white, 10%);
.opacity(65);
.box-shadow(none);
}
// Button Sizes
// Disabled state
&.large {
.btn.disabled,
padding: 9px 14px;
.btn[disabled] {
font-size: @baseFontSize + 2px;
cursor: default;
line-height: normal;
background-image: none;
.border-radius(5px);
background-color: darken(@white, 10%);
}
.opacity(65);
&.large .icon {
.box-shadow(none);
margin-top: 1px;
}
}
&.small {
padding: 5px 9px;
// Button Sizes
font-size: @baseFontSize - 2px;
// --------------------------------------------------
line-height: @baseLineHeight - 2px;
}
// Large
&.small .icon {
.btn.large {
margin-top: -1px;
padding: 9px 14px;
}
font-size: @baseFontSize + 2px;
line-height: normal;
.border-radius(5px);
}
.btn.large .icon {
margin-top: 1px;
}
// Small
.btn.small {
padding: 5px 9px;
font-size: @baseFontSize - 2px;
line-height: @baseLineHeight - 2px;
}
.btn.small .icon {
margin-top: -1px;
}
// Alternate buttons
// --------------------------------------------------
// Set text color
// -------------------------
.btn.primary,
.btn.primary:hover,
.btn.warning,
.btn.warning:hover,
.btn.danger,
.btn.danger:hover,
.btn.success,
.btn.success:hover,
.btn.info,
.btn.info:hover {
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
color: @white
}
// Provide *some* extra contrast for those who can get it
.btn.primary.active,
.btn.warning.active,
.btn.danger.active,
.btn.success.active,
.btn.info.active {
color: rgba(255,255,255,.75);
}
// Set the backgrounds
// -------------------------
.btn.primary {
.buttonBackground(@primaryButtonBackground, spin(@primaryButtonBackground, 20));
}
}
// Warning appears are orange
.btn.warning {
.buttonBackground(lighten(@orange, 15%), @orange);
}
// Danger and error appear as red
.btn.danger {
.buttonBackground(#ee5f5b, #bd362f);
}
// Success appears as green
.btn.success {
.buttonBackground(#62c462, #51a351);
}
// Info appears as a neutral blue
.btn.info {
.buttonBackground(#5bc0de, #2f96b4);
}
// Cross-browser Jank
// --------------------------------------------------
// Help Firefox not be a jerk about adding extra padding to buttons
button.btn,
button.btn,
input[type="submit"].btn {
input[type="submit"].btn {
&::-moz-focus-inner {
&::-moz-focus-inner {
padding: 0;
padding: 0;
border: 0;
border: 0;
}
}
// IE7 has some default padding on button controls
// IE7 has some default padding on button controls
...
...
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