1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 04:50:55 +01:00
phorge-phorge/webroot/rsrc/css/phui/phui-button.css

353 lines
6.5 KiB
CSS
Raw Normal View History

2011-01-25 20:31:40 +01:00
/**
* @provides phui-button-css
2011-01-25 20:31:40 +01:00
*/
button,
a.button {
font: {$basefont};
-webkit-font-smoothing: antialiased;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
button.phabricator-action-view-item {
-webkit-font-smoothing: auto;
}
button::-moz-focus-inner {
padding: 0;
border: 0;
}
2011-01-25 20:31:40 +01:00
button,
a.button,
a.button:visited,
Add a basic multipage form Summary: Ref T2232. Very busy day on IRC so I feel like I've made 20 minutes of progress in 1-minute spurts here, but this adds the basics for a form that can have multiple pages and automatically handle pagination and reading to/from the request, objects and responses. The UIExample is reasonably instructive. Basically, you make a form, add pages to the form, and add controls to the pages. The core flow control looks like this: if ($request->isFormPost()) { $form->readFromRequest($request); // (1) if ($form->isComplete()) { // (2) $response = $form->writeToResponse($response); // (3) // Process result here. // (4) } } else { $form->readFromObject($object); // (5) } The key parts are: # This reads the form state from the request, including reading all the inactive pages. # This tests if all pages are valid and the user just clicked "Done" on the last page. # This produces a "response", which might be writing to an object (for simpler forms) or creating a transaction record (for more complex forms). # Here, we would save the object or apply the transactions. # When the user views the form for the first time, we preload all the values from some object (which might just be empty). Ultimate goal here is to fix repository creation to not be a terrible pit of awfulness. There are probably a lot of rough edges and missing features still, but this seems to not be totally crazy. I'm using two submit buttons with different names which doesn't work on IE7 or something, but we can JS our way out of that if we need to. Test Plan: Paged forward and backward through the form. Reviewers: btrahan, chad Reviewed By: btrahan CC: aran Maniphest Tasks: T2232 Differential Revision: https://secure.phabricator.com/D6003
2013-05-23 23:39:01 +02:00
input[type="submit"] {
background-color: #3477ad;
color: white;
border: 1px solid #19558D;
2011-01-25 20:31:40 +01:00
cursor: pointer;
font-weight: bold;
font-size: 13px;
display: inline-block;
padding: 3px 12px 4px;
2011-01-25 20:31:40 +01:00
text-align: center;
white-space: nowrap;
border-radius: 3px;
background-image: linear-gradient(to bottom, #3b86c4, #2b628f);
background-image: -webkit-linear-gradient(top, #3b86c4, #2b628f);
2011-01-25 20:31:40 +01:00
}
/* Buttons with images (full size only) */
button.icon,
a.icon,
a.icon:visited {
padding-left: 0;
position: relative;
text-indent: 29px;
}
button.black,
a.black,
a.black:visited {
background-color: #383838;
background-image: linear-gradient(to bottom, #505d65, #2d373c);
background-image: -webkit-linear-gradient(top, #505d65, #2d373c);
border: 1px solid {$darkgreytext};
border-bottom-color: #000;
}
2011-01-25 20:31:40 +01:00
button.green,
a.green,
a.green:visited {
background-color: #348e20;
background-image: linear-gradient(to bottom, #4e9b33, #158009);
background-image: -webkit-linear-gradient(top, #4e9b33, #158009);
2011-01-25 20:31:40 +01:00
border: 1px solid #3b6e22;
border-bottom-color: #2c5a15;
}
button.grey,
Add a basic multipage form Summary: Ref T2232. Very busy day on IRC so I feel like I've made 20 minutes of progress in 1-minute spurts here, but this adds the basics for a form that can have multiple pages and automatically handle pagination and reading to/from the request, objects and responses. The UIExample is reasonably instructive. Basically, you make a form, add pages to the form, and add controls to the pages. The core flow control looks like this: if ($request->isFormPost()) { $form->readFromRequest($request); // (1) if ($form->isComplete()) { // (2) $response = $form->writeToResponse($response); // (3) // Process result here. // (4) } } else { $form->readFromObject($object); // (5) } The key parts are: # This reads the form state from the request, including reading all the inactive pages. # This tests if all pages are valid and the user just clicked "Done" on the last page. # This produces a "response", which might be writing to an object (for simpler forms) or creating a transaction record (for more complex forms). # Here, we would save the object or apply the transactions. # When the user views the form for the first time, we preload all the values from some object (which might just be empty). Ultimate goal here is to fix repository creation to not be a terrible pit of awfulness. There are probably a lot of rough edges and missing features still, but this seems to not be totally crazy. I'm using two submit buttons with different names which doesn't work on IE7 or something, but we can JS our way out of that if we need to. Test Plan: Paged forward and backward through the form. Reviewers: btrahan, chad Reviewed By: btrahan CC: aran Maniphest Tasks: T2232 Differential Revision: https://secure.phabricator.com/D6003
2013-05-23 23:39:01 +02:00
input[type="submit"].grey,
2011-01-25 20:31:40 +01:00
a.grey,
a.grey:visited {
background-color: {$lightgreybackground};
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
border-color: {$lightgreyborder};
color: {$darkgreytext};
border-bottom-color: {$greyborder};
2011-01-25 20:31:40 +01:00
}
button.simple,
input[type="submit"].simple,
a.simple,
a.simple:visited {
background-color: transparent;
background-image: none;
border: 1px solid transparent;
color: {$bluetext};
border: 1px solid {$lightblueborder};
}
2011-01-25 20:31:40 +01:00
a.disabled,
button.disabled,
button[disabled] {
2011-01-25 20:31:40 +01:00
filter:alpha(opacity=50);
-moz-opacity: 0.5;
2011-01-25 20:31:40 +01:00
-khtml-opacity: 0.5;
opacity: 0.5;
}
body button:active,
body a.button:active {
box-shadow: inset 0 0 8px rgba(0,0,0,.6);
2011-01-25 20:31:40 +01:00
}
button.grey:active,
a.grey:active,
button.grey_active,
a.button.phuix-dropdown-open {
background-color: #7d7d7d;
box-shadow: inset 0 0 4px rgba(0,0,0,.2);
}
a.phuix-dropdown-open {
color: {$greytext};
2011-01-25 20:31:40 +01:00
}
a.button:hover,
button:hover {
2011-01-25 20:31:40 +01:00
text-decoration: none;
box-shadow: inset 0 0 5px rgba(0,0,0,.4);
}
a.button.simple:hover,
button.simple:hover {
background-color: #fff;
border: 1px solid {$lightgreyborder};
background-image: none;
border-bottom: 1px solid {$greyborder};
box-shadow: none;
}
a.button.simple.phuix-dropdown-open {
background-color: #fff;
box-shadow: none;
}
a.button.grey:hover,
button.grey:hover {
text-decoration: none;
box-shadow: inset 0 0 4px rgba(0,0,0,.2);
}
body a.button.disabled:hover,
body button.disabled:hover,
body a.button.disabled:active,
body button.disabled:active {
box-shadow: none;
2011-01-25 20:31:40 +01:00
}
button.small,
a.small,
a.small:visited {
padding: 2px 8px;
2011-01-25 20:31:40 +01:00
height: auto;
font-size: 11px;
line-height: 16px;
}
button.link {
display: inline;
border: none;
background: transparent;
font-weight: normal;
padding: 0;
margin: 0;
font-size: inherit;
border-bottom: none;
text-decoration: none;
color: #19558D;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
2011-01-25 20:31:40 +01:00
button.link:hover {
text-decoration: underline;
}
.phuix-dropdown-menu {
position: absolute;
width: 240px;
background: #fff;
margin-top: -1px;
padding: 5px 0;
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
border: 1px solid {$lightgreyborder};
border-bottom: 1px solid {$greyborder};
border-radius: 3px;
margin-bottom: 16px;
}
.phuix-dropdown-menu a:focus {
/* We automatically focus links in dropdown menus for assistive devices, but
this is distracting for visual user agents. */
outline: none;
}
a.policy-control {
width: 240px;
text-align: left;
}
a.policy-control .caret {
float: right;
}
a.toggle {
display: inline-block;
padding: 4px 8px;
font-size: 12px;
font-weight: bold;
color: #555;
text-decoration: none;
white-space: nowrap;
vertical-align: baseline;
background-color: {$lightgreybackground};
margin: 0 6px 0 0;
border-radius: 3px;
box-shadow: inset 0 0 3px rgba(0,0,0,.4);
}
a.toggle:hover {
background-color: #14568e;
color: #fff
}
a.toggle-selected {
background-color: #14568e;
color: #fff
}
a.toggle-fixed {
cursor: default;
}
.caret {
display: inline-block;
width: 0;
height: 0;
vertical-align: top;
border-top: 5px solid #fff;
border-right: 5px solid transparent;
border-left: 5px solid transparent;
content: "";
}
.caret-right {
display: inline-block;
width: 0;
height: 0;
vertical-align: middle;
border-left: 7px solid {$greytext};
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
content: "";
margin-bottom: 4px;
}
.caret-left {
display: inline-block;
width: 0;
height: 0;
vertical-align: middle;
border-right: 7px solid {$greytext};
border-bottom: 5px solid transparent;
border-top: 5px solid transparent;
content: "";
margin-bottom: 4px;
}
.dropdown .caret {
margin-top: 7px;
margin-left: 4px;
}
.small.dropdown .caret {
margin-top: 6px;
}
.grey.dropdown .caret {
border-top-color: #000;
}
/* Icons */
.button.has-icon {
position: relative;
}
.button .phui-icon-view {
display: inline-block;
position: absolute;
top: 5px;
left: 10px;
}
.phui-button-bar .button .phui-icon-view {
left: 12px;
}
.button.has-icon .phui-button-text {
margin-left: 16px;
}
/* Login Buttons */
.button.big.has-icon {
padding: 6px 20px 6px 12px;
border-radius: 4px;
text-align: left;
}
.button.big.has-icon .phui-button-text {
margin-left: 40px;
font-size: 14px;
display: block;
}
.button.big.has-icon .phui-button-subtext {
color: {$lightgreytext};
font-size: 12px;
line-height: 15px;
font-weight: normal;
}
/* PHUI Button Bar */
.phui-button-bar a.button {
display: inline-block;
height: 16px;
width: 12px;
}
.phui-button-bar .phui-button-bar-first {
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
}
.phui-button-bar .phui-button-bar-middle {
border-radius: 0;
border-left: none;
}
.phui-button-bar .phui-button-bar-last {
border-left: none;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}