1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00

CSS gradient buttons

Summary: Creates CSS Gradients for buttons. Also tweaked hover and active styles. "Fixed" disabled state (this may require follow up diffs to correct around site)

Test Plan: Tested Maniphest and UI Examples in Chrome and IE10/9/8

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5624
This commit is contained in:
Chad Little 2013-04-08 15:00:55 -07:00
parent 1e2b6faadd
commit d1daf80d0d
14 changed files with 91 additions and 169 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

View file

@ -1,31 +1,11 @@
{
"version" : 1,
"sprites" : {
"gradient-black-dark" : {
"name" : "gradient-black-dark",
"rule" : ".gradient-black-dark, button.black, a.black, a.black:visited",
"hash" : "17425d8c9c53672ab2edbd236e6efd7a"
},
"gradient-black-light" : {
"name" : "gradient-black-light",
"rule" : ".gradient-black-light, button.black:active, a.black:active",
"hash" : "c4fb2231553d2894fd2c97beaa8bfe39"
},
"gradient-blue-dark" : {
"name" : "gradient-blue-dark",
"rule" : ".gradient-blue-dark, button, a.button, a.button:visited, input.inputsubmit",
"hash" : "f467612edcdbf984672287c6086492c4"
},
"gradient-blue-header" : {
"name" : "gradient-blue-header",
"rule" : ".gradient-blue-header",
"hash" : "dd82b6d737f9f683c0d6e70eff59e872"
},
"gradient-blue-light" : {
"name" : "gradient-blue-light",
"rule" : ".gradient-blue-light, button:active, a.button:active",
"hash" : "471d47c102def6db46b345310aac5a03"
},
"gradient-breadcrumbs" : {
"name" : "gradient-breadcrumbs",
"rule" : ".gradient-breadcrumbs",
@ -36,36 +16,16 @@
"rule" : ".gradient-dark-menu-label, .phabricator-dark-menu .phabricator-menu-item-type-label",
"hash" : "e0d4a455142f9c4745d36ad8b7dd3f78"
},
"gradient-green-dark" : {
"name" : "gradient-green-dark",
"rule" : ".gradient-green-dark, button.green, a.green, a.green:visited",
"hash" : "a6719fe55b2b0e527ed32985691eab34"
},
"gradient-green-header" : {
"name" : "gradient-green-header",
"rule" : ".gradient-green-header",
"hash" : "d61297d23aa31fa1de51e2b9b5974554"
},
"gradient-green-light" : {
"name" : "gradient-green-light",
"rule" : ".gradient-green-light, button.green:active, a.green:active",
"hash" : "124969cc7805bbd754005bc702e24c54"
},
"gradient-grey-dark" : {
"name" : "gradient-grey-dark",
"rule" : ".gradient-grey-dark, button.grey, input.inputaux, a.grey, a.grey:visited, a.button.disabled, button[disabled], button.disabled",
"hash" : "fac28a773098fc62bf571e12b843f71a"
},
"gradient-grey-header" : {
"name" : "gradient-grey-header",
"rule" : ".gradient-grey-header",
"hash" : "f1453896068a8dd0d7885457c8e371bc"
},
"gradient-grey-light" : {
"name" : "gradient-grey-light",
"rule" : ".gradient-grey-light, button.grey:active, a.grey:active, button.grey_active, a.dropdown-open",
"hash" : "83c6128f59fc2e426c912c2f73f5b92b"
},
"gradient-menu-hover" : {
"name" : "gradient-menu-hover",
"rule" : ".gradient-menu-hover, .device-desktop .phabricator-side-menu a.phabricator-menu-item-type-link:hover, .phabricator-filetree a.phabricator-filetree-item:hover",
@ -95,6 +55,6 @@
"scales" : [
1
],
"header" : "\/**\n * @provides sprite-gradient-css\n * @generated\n *\/\n\n.sprite-gradient, button, a.button, a.button:visited, input.inputsubmit, .phabricator-dark-menu .phabricator-menu-item-type-label, .phabricator-side-menu .phabricator-menu-item-type-label, .device-desktop .phabricator-side-menu a.phabricator-menu-item-type-link:hover, .phabricator-side-menu .phabricator-menu-item-selected, .device-desktop .phabricator-side-menu a.phabricator-menu-item-selected:hover, .phabricator-filetree a.phabricator-filetree-item:hover, .phabricator-filetree a.phabricator-active-nav-focus {\n background-image: url(\/rsrc\/image\/sprite-gradient.png);\n background-repeat: repeat-x;\n}\n\n\n",
"header" : "\/**\n * @provides sprite-gradient-css\n * @generated\n *\/\n\n.sprite-gradient, .phabricator-dark-menu .phabricator-menu-item-type-label, .phabricator-side-menu .phabricator-menu-item-type-label, .device-desktop .phabricator-side-menu a.phabricator-menu-item-type-link:hover, .phabricator-side-menu .phabricator-menu-item-selected, .device-desktop .phabricator-side-menu a.phabricator-menu-item-selected:hover, .phabricator-filetree a.phabricator-filetree-item:hover, .phabricator-filetree a.phabricator-active-nav-focus {\n background-image: url(\/rsrc\/image\/sprite-gradient.png);\n background-repeat: repeat-x;\n}\n\n\n",
"type" : "repeat-x"
}

View file

@ -590,8 +590,8 @@ celerity_register_resource_map(array(
),
'/rsrc/image/sprite-gradient.png' =>
array(
'hash' => 'df1e8e0d09bbbabdd6015d3467dec11a',
'uri' => '/res/df1e8e0d/rsrc/image/sprite-gradient.png',
'hash' => '72614b1679a3c69fcef9766c0f2be53d',
'uri' => '/res/72614b16/rsrc/image/sprite-gradient.png',
'disk' => '/rsrc/image/sprite-gradient.png',
'type' => 'png',
),
@ -2903,7 +2903,7 @@ celerity_register_resource_map(array(
),
'phabricator-core-buttons-css' =>
array(
'uri' => '/res/4e6b94c8/rsrc/css/core/buttons.css',
'uri' => '/res/da2e42df/rsrc/css/core/buttons.css',
'type' => 'css',
'requires' =>
array(
@ -3819,7 +3819,7 @@ celerity_register_resource_map(array(
),
'sprite-gradient-css' =>
array(
'uri' => '/res/0d784d61/rsrc/css/sprite-gradient.css',
'uri' => '/res/5bce353e/rsrc/css/sprite-gradient.css',
'type' => 'css',
'requires' =>
array(
@ -3901,7 +3901,7 @@ celerity_register_resource_map(array(
), array(
'packages' =>
array(
'30e5f188' =>
'75db5fb7' =>
array(
'name' => 'core.pkg.css',
'symbols' =>
@ -3943,7 +3943,7 @@ celerity_register_resource_map(array(
34 => 'phabricator-object-item-list-view-css',
35 => 'global-drag-and-drop-css',
),
'uri' => '/res/pkg/30e5f188/core.pkg.css',
'uri' => '/res/pkg/75db5fb7/core.pkg.css',
'type' => 'css',
),
'bf16b308' =>
@ -4133,16 +4133,16 @@ celerity_register_resource_map(array(
'reverse' =>
array(
'aphront-attached-file-view-css' => '6b1fccc6',
'aphront-dialog-view-css' => '30e5f188',
'aphront-error-view-css' => '30e5f188',
'aphront-form-view-css' => '30e5f188',
'aphront-list-filter-view-css' => '30e5f188',
'aphront-pager-view-css' => '30e5f188',
'aphront-panel-view-css' => '30e5f188',
'aphront-table-view-css' => '30e5f188',
'aphront-tokenizer-control-css' => '30e5f188',
'aphront-tooltip-css' => '30e5f188',
'aphront-typeahead-control-css' => '30e5f188',
'aphront-dialog-view-css' => '75db5fb7',
'aphront-error-view-css' => '75db5fb7',
'aphront-form-view-css' => '75db5fb7',
'aphront-list-filter-view-css' => '75db5fb7',
'aphront-pager-view-css' => '75db5fb7',
'aphront-panel-view-css' => '75db5fb7',
'aphront-table-view-css' => '75db5fb7',
'aphront-tokenizer-control-css' => '75db5fb7',
'aphront-tooltip-css' => '75db5fb7',
'aphront-typeahead-control-css' => '75db5fb7',
'differential-changeset-view-css' => '8aaacd1b',
'differential-core-view-css' => '8aaacd1b',
'differential-inline-comment-editor' => 'e96b08f8',
@ -4156,7 +4156,7 @@ celerity_register_resource_map(array(
'differential-table-of-contents-css' => '8aaacd1b',
'diffusion-commit-view-css' => 'c8ce2d88',
'diffusion-icons-css' => 'c8ce2d88',
'global-drag-and-drop-css' => '30e5f188',
'global-drag-and-drop-css' => '75db5fb7',
'inline-comment-summary-css' => '8aaacd1b',
'javelin-aphlict' => 'bf16b308',
'javelin-behavior' => 'a2f94024',
@ -4228,47 +4228,47 @@ celerity_register_resource_map(array(
'javelin-util' => 'a2f94024',
'javelin-vector' => 'a2f94024',
'javelin-workflow' => 'a2f94024',
'lightbox-attachment-css' => '30e5f188',
'lightbox-attachment-css' => '75db5fb7',
'maniphest-task-summary-css' => '6b1fccc6',
'maniphest-transaction-detail-css' => '6b1fccc6',
'phabricator-busy' => 'bf16b308',
'phabricator-content-source-view-css' => '8aaacd1b',
'phabricator-core-buttons-css' => '30e5f188',
'phabricator-core-css' => '30e5f188',
'phabricator-crumbs-view-css' => '30e5f188',
'phabricator-directory-css' => '30e5f188',
'phabricator-core-buttons-css' => '75db5fb7',
'phabricator-core-css' => '75db5fb7',
'phabricator-crumbs-view-css' => '75db5fb7',
'phabricator-directory-css' => '75db5fb7',
'phabricator-drag-and-drop-file-upload' => 'e96b08f8',
'phabricator-dropdown-menu' => 'bf16b308',
'phabricator-file-upload' => 'bf16b308',
'phabricator-filetree-view-css' => '30e5f188',
'phabricator-flag-css' => '30e5f188',
'phabricator-form-view-css' => '30e5f188',
'phabricator-header-view-css' => '30e5f188',
'phabricator-jump-nav' => '30e5f188',
'phabricator-filetree-view-css' => '75db5fb7',
'phabricator-flag-css' => '75db5fb7',
'phabricator-form-view-css' => '75db5fb7',
'phabricator-header-view-css' => '75db5fb7',
'phabricator-jump-nav' => '75db5fb7',
'phabricator-keyboard-shortcut' => 'bf16b308',
'phabricator-keyboard-shortcut-manager' => 'bf16b308',
'phabricator-main-menu-view' => '30e5f188',
'phabricator-main-menu-view' => '75db5fb7',
'phabricator-menu-item' => 'bf16b308',
'phabricator-nav-view-css' => '30e5f188',
'phabricator-nav-view-css' => '75db5fb7',
'phabricator-notification' => 'bf16b308',
'phabricator-notification-css' => '30e5f188',
'phabricator-notification-menu-css' => '30e5f188',
'phabricator-object-item-list-view-css' => '30e5f188',
'phabricator-notification-css' => '75db5fb7',
'phabricator-notification-menu-css' => '75db5fb7',
'phabricator-object-item-list-view-css' => '75db5fb7',
'phabricator-object-selector-css' => '8aaacd1b',
'phabricator-prefab' => 'bf16b308',
'phabricator-project-tag-css' => '6b1fccc6',
'phabricator-remarkup-css' => '30e5f188',
'phabricator-remarkup-css' => '75db5fb7',
'phabricator-shaped-request' => 'e96b08f8',
'phabricator-side-menu-view-css' => '30e5f188',
'phabricator-standard-page-view' => '30e5f188',
'phabricator-side-menu-view-css' => '75db5fb7',
'phabricator-standard-page-view' => '75db5fb7',
'phabricator-textareautils' => 'bf16b308',
'phabricator-tooltip' => 'bf16b308',
'phabricator-transaction-view-css' => '30e5f188',
'phabricator-zindex-css' => '30e5f188',
'sprite-apps-large-css' => '30e5f188',
'sprite-gradient-css' => '30e5f188',
'sprite-icon-css' => '30e5f188',
'sprite-menu-css' => '30e5f188',
'syntax-highlighting-css' => '30e5f188',
'phabricator-transaction-view-css' => '75db5fb7',
'phabricator-zindex-css' => '75db5fb7',
'sprite-apps-large-css' => '75db5fb7',
'sprite-gradient-css' => '75db5fb7',
'sprite-icon-css' => '75db5fb7',
'sprite-menu-css' => '75db5fb7',
'syntax-highlighting-css' => '75db5fb7',
),
));

View file

@ -418,28 +418,7 @@ final class CeleritySpriteGenerator {
'grey-header' => 70
);
// Reorder the sprites so less-specific rules generate earlier in the sheet.
// Otherwise we end up with blue "a.black" buttons because the blue rules
// have the same specificity but appear later.
$gradients = array_fuse($gradients);
$gradients = array_select_keys(
$gradients,
array(
'blue-dark',
'blue-light',
)) + $gradients;
$extra_css = array(
'black-dark' => ', button.black, a.black, a.black:visited',
'black-light' => ', button.black:active, a.black:active',
'blue-dark' => ', button, a.button, a.button:visited, input.inputsubmit',
'blue-light' => ', button:active, a.button:active',
'grey-dark' => ', button.grey, input.inputaux, a.grey, a.grey:visited, '.
'a.button.disabled, button[disabled], button.disabled',
'grey-light' => ', button.grey:active, a.grey:active, '.
'button.grey_active, a.dropdown-open',
'green-dark' => ', button.green, a.green, a.green:visited',
'green-light' => ', button.green:active, a.green:active',
'dark-menu-label' =>
', .phabricator-dark-menu .phabricator-menu-item-type-label',
'menu-label' =>
@ -472,8 +451,7 @@ final class CeleritySpriteGenerator {
'gradient',
false,
PhutilSpriteSheet::TYPE_REPEAT_X,
', button, a.button, a.button:visited, input.inputsubmit, '.
'.phabricator-dark-menu .phabricator-menu-item-type-label, '.
', .phabricator-dark-menu .phabricator-menu-item-type-label, '.
'.phabricator-side-menu .phabricator-menu-item-type-label, '.
'.device-desktop .phabricator-side-menu '.
'a.phabricator-menu-item-type-link:hover, '.

View file

@ -7,10 +7,9 @@ button,
a.button,
a.button:visited,
input.inputsubmit {
background-color: #19558D;
background-color: #3477ad;
color: white;
text-shadow: 0 -1px #19558D;
text-shadow: 0 -1px rgba(0,0,0,0.75);
border: 1px solid #19558D;
cursor: pointer;
font-weight: bold;
@ -19,10 +18,9 @@ input.inputsubmit {
padding: 3px 10px 4px;
text-align: center;
white-space: nowrap;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
background-image: linear-gradient(to bottom, #3b86c4, #2b628f);
background-image: -webkit-linear-gradient(top, #3b86c4, #2b628f);
}
/* Buttons with images (full size only) */
@ -34,37 +32,33 @@ a.icon:visited {
text-indent: 29px;
}
button:active,
a.button:active {
background-color: #19558D;
}
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 #333;
text-shadow: 0 -1px #000;
border-bottom-color: #000;
}
button.green,
a.green,
a.green:visited {
background-color: #006600;
background-color: #348e20;
background-image: linear-gradient(to bottom, #4e9b33, #158009);
background-image: -webkit-linear-gradient(top, #4e9b33, #158009);
border: 1px solid #3b6e22;
text-shadow: 0 -1px #006600;
border-bottom-color: #2c5a15;
}
button.grey,
input.inputaux,
a.grey,
a.grey:visited,
a.button.disabled,
button[disabled], /* Set by JX.Workflow. */
button.disabled {
a.grey:visited {
background-color: #f7f7f7;
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
border-color: #aaa;
color: #333;
border-bottom-color: #999;
@ -72,11 +66,17 @@ button.disabled {
}
a.disabled,
button.disabled {
button.disabled,
button[disabled] {
filter:alpha(opacity=50);
-moz-opacity:0.5;
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
opacity: 0.5 !important;
}
body button:active,
body a.button:active {
box-shadow: inset 0 0 8px rgba(0,0,0,.6);
}
button.grey:active,
@ -84,11 +84,27 @@ a.grey:active,
button.grey_active,
a.dropdown-open {
background-color: #7d7d7d;
box-shadow: inset 0 0 4px rgba(0,0,0,.2);
color: #777;
}
a.button:hover {
a.button:hover,
button:hover {
text-decoration: none;
box-shadow: inset 0 0 5px rgba(0,0,0,.4);
}
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;
}
button.small,

View file

@ -3,7 +3,7 @@
* @generated
*/
.sprite-gradient, button, a.button, a.button:visited, input.inputsubmit, .phabricator-dark-menu .phabricator-menu-item-type-label, .phabricator-side-menu .phabricator-menu-item-type-label, .device-desktop .phabricator-side-menu a.phabricator-menu-item-type-link:hover, .phabricator-side-menu .phabricator-menu-item-selected, .device-desktop .phabricator-side-menu a.phabricator-menu-item-selected:hover, .phabricator-filetree a.phabricator-filetree-item:hover, .phabricator-filetree a.phabricator-active-nav-focus {
.sprite-gradient, .phabricator-dark-menu .phabricator-menu-item-type-label, .phabricator-side-menu .phabricator-menu-item-type-label, .device-desktop .phabricator-side-menu a.phabricator-menu-item-type-link:hover, .phabricator-side-menu .phabricator-menu-item-selected, .device-desktop .phabricator-side-menu a.phabricator-menu-item-selected:hover, .phabricator-filetree a.phabricator-filetree-item:hover, .phabricator-filetree a.phabricator-active-nav-focus {
background-image: url(/rsrc/image/sprite-gradient.png);
background-repeat: repeat-x;
}
@ -11,60 +11,28 @@
.gradient-blue-dark, button, a.button, a.button:visited, input.inputsubmit {
background-position: 0px -51px;
}
.gradient-blue-light, button:active, a.button:active {
background-position: 0px -78px;
}
.gradient-black-dark, button.black, a.black, a.black:visited {
background-position: 0px -105px;
}
.gradient-black-light, button.black:active, a.black:active {
background-position: 0px -132px;
}
.gradient-blue-header {
background-position: 0px -357px;
background-position: 0px -141px;
}
.gradient-breadcrumbs {
background-position: 0px -325px;
background-position: 0px -109px;
}
.gradient-dark-menu-label, .phabricator-dark-menu .phabricator-menu-item-type-label {
background-position: 0px -25px;
}
.gradient-green-dark, button.green, a.green, a.green:visited {
background-position: 0px -159px;
}
.gradient-green-header {
background-position: 0px -428px;
}
.gradient-green-light, button.green:active, a.green:active {
background-position: 0px -186px;
}
.gradient-grey-dark, button.grey, input.inputaux, a.grey, a.grey:visited, a.button.disabled, button[disabled], button.disabled {
background-position: 0px -213px;
background-position: 0px -212px;
}
.gradient-grey-header {
background-position: 0px -499px;
}
.gradient-grey-light, button.grey:active, a.grey:active, button.grey_active, a.dropdown-open {
background-position: 0px -240px;
background-position: 0px -283px;
}
.gradient-menu-hover, .device-desktop .phabricator-side-menu a.phabricator-menu-item-type-link:hover, .phabricator-filetree a.phabricator-filetree-item:hover {
background-position: 0px -267px;
background-position: 0px -51px;
}
.gradient-menu-label, .phabricator-side-menu .phabricator-menu-item-type-label {
@ -72,13 +40,13 @@
}
.gradient-menu-selected, .phabricator-side-menu .phabricator-menu-item-selected, .device-desktop .phabricator-side-menu a.phabricator-menu-item-selected:hover, .phabricator-nav-local a.phabricator-active-nav-focus {
background-position: 0px -296px;
background-position: 0px -80px;
}
.gradient-red-header {
background-position: 0px -570px;
background-position: 0px -354px;
}
.gradient-yellow-header {
background-position: 0px -641px;
background-position: 0px -425px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 873 B