From ca8ae2d4ca5d0f4f8655426e8c99ad35fd3039d0 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sat, 5 Aug 2017 14:57:36 -0700 Subject: [PATCH] Add a red button to PHUIButtonView Summary: Danger Danger Test Plan: UIExamples {F5084035} Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D18347 --- resources/celerity/map.php | 6 +++--- .../CelerityDefaultPostprocessor.php | 3 +++ .../uiexample/examples/PHUIButtonExample.php | 1 + src/view/phui/PHUIButtonView.php | 1 + webroot/rsrc/css/phui/button/phui-button.css | 20 ++++++++++++++++++- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index aa02c547de..fc4556782c 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,7 +9,7 @@ return array( 'names' => array( 'conpherence.pkg.css' => 'e68cf1fa', 'conpherence.pkg.js' => 'b5b51108', - 'core.pkg.css' => '04da74af', + 'core.pkg.css' => 'cea08376', 'core.pkg.js' => '5d80e0db', 'darkconsole.pkg.js' => '1f9a31bc', 'differential.pkg.css' => '45951e9e', @@ -127,7 +127,7 @@ return array( 'rsrc/css/layout/phabricator-source-code-view.css' => 'aea41829', 'rsrc/css/phui/button/phui-button-bar.css' => 'f1ff5494', 'rsrc/css/phui/button/phui-button-simple.css' => '8e1baf68', - 'rsrc/css/phui/button/phui-button.css' => '3ca51caa', + 'rsrc/css/phui/button/phui-button.css' => '340f55c1', 'rsrc/css/phui/calendar/phui-calendar-day.css' => '572b1893', 'rsrc/css/phui/calendar/phui-calendar-list.css' => '576be600', 'rsrc/css/phui/calendar/phui-calendar-month.css' => '21154caf', @@ -824,7 +824,7 @@ return array( 'phui-big-info-view-css' => 'acc3492c', 'phui-box-css' => '745e881d', 'phui-button-bar-css' => 'f1ff5494', - 'phui-button-css' => '3ca51caa', + 'phui-button-css' => '340f55c1', 'phui-button-simple-css' => '8e1baf68', 'phui-calendar-css' => 'f1ddf11c', 'phui-calendar-day-css' => '572b1893', diff --git a/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php b/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php index 39a6c849e1..61f6176f15 100644 --- a/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php +++ b/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php @@ -231,6 +231,9 @@ final class CelerityDefaultPostprocessor 'green.button.color' => '#139543', 'green.button.gradient' => 'linear-gradient(to bottom, #23BB5B, #139543)', 'green.button.hover' => 'linear-gradient(to bottom, #23BB5B, #178841)', + 'red.button.color' => '#b33225', + 'red.button.gradient' => 'linear-gradient(to bottom, #d25454, #b33225)', + 'red.button.hover' => 'linear-gradient(to bottom, #d25454, #982115)', 'grey.button.color' => '#F7F7F9', 'grey.button.gradient' => 'linear-gradient(to bottom, #ffffff, #f1f0f1)', 'grey.button.hover' => 'linear-gradient(to bottom, #ffffff, #eeebec)', diff --git a/src/applications/uiexample/examples/PHUIButtonExample.php b/src/applications/uiexample/examples/PHUIButtonExample.php index a5ece198fd..c7107250ff 100644 --- a/src/applications/uiexample/examples/PHUIButtonExample.php +++ b/src/applications/uiexample/examples/PHUIButtonExample.php @@ -20,6 +20,7 @@ final class PHUIButtonExample extends PhabricatorUIExample { $colors = array( null, PHUIButtonView::GREEN, + PHUIButtonView::RED, PHUIButtonView::GREY, ); $sizes = array(null, PHUIButtonView::SMALL); diff --git a/src/view/phui/PHUIButtonView.php b/src/view/phui/PHUIButtonView.php index 1aaa1cbaad..8d6eca9ec7 100644 --- a/src/view/phui/PHUIButtonView.php +++ b/src/view/phui/PHUIButtonView.php @@ -5,6 +5,7 @@ final class PHUIButtonView extends AphrontTagView { const GREEN = 'green'; const GREY = 'grey'; const BLUE = 'blue'; + const RED = 'red'; const DISABLED = 'disabled'; const SMALL = 'small'; diff --git a/webroot/rsrc/css/phui/button/phui-button.css b/webroot/rsrc/css/phui/button/phui-button.css index 8cdd818f12..a36d69d4bc 100644 --- a/webroot/rsrc/css/phui/button/phui-button.css +++ b/webroot/rsrc/css/phui/button/phui-button.css @@ -50,7 +50,9 @@ input[type="submit"] { button .phui-icon-view, a.button .phui-icon-view, button.button-green .phui-icon-view, -a.button.button-green .phui-icon-view { +a.button.button-green .phui-icon-view, +button.button-red .phui-icon-view, +a.button.button-red .phui-icon-view { color: white; } @@ -76,6 +78,14 @@ a.button-green.button:visited { background-image: {$green.button.gradient}; } +button.button-red, +a.button-red.button, +a.button-red.button:visited { + background-color: {$red.button.color}; + border-color: {$red.button.color}; + background-image: {$red.button.gradient}; +} + button.button-grey, input[type="submit"].button-grey, a.button-grey, @@ -123,6 +133,14 @@ button.button-green:hover { transition: 0.1s; } +a.button.button-red:hover, +button.button-red:hover { + border-color: #79150b; + background-color: #0DAD48; + background-image: {$red.button.hover}; + transition: 0.1s; +} + body a.button.disabled:hover, body button.disabled:hover, body a.button.disabled:active,