From b930f4886aca4e7440e06a618a4a55aa4ac04913 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Mon, 15 Aug 2022 15:06:03 -0400 Subject: [PATCH] UX: Add flat text button styles and use in date/time cancel modal (#17892) Also fixes an A11Y issue with the date/time cancel button. --- .../templates/logs/screened-ip-addresses.hbs | 4 +-- .../stylesheets/common/admin/staff_logs.scss | 3 --- .../common/components/buttons.scss | 25 +++++++++++++++++++ .../discourse-local-dates-create-form.hbs | 7 +++--- .../common/discourse-local-dates.scss | 8 ------ .../templates/styleguide/atoms/02-buttons.hbs | 12 +++++++++ 6 files changed, 42 insertions(+), 17 deletions(-) diff --git a/app/assets/javascripts/admin/addon/templates/logs/screened-ip-addresses.hbs b/app/assets/javascripts/admin/addon/templates/logs/screened-ip-addresses.hbs index 56af8c935f3..63489dcdee9 100644 --- a/app/assets/javascripts/admin/addon/templates/logs/screened-ip-addresses.hbs +++ b/app/assets/javascripts/admin/addon/templates/logs/screened-ip-addresses.hbs @@ -63,9 +63,7 @@ {{#if item.editing}} - - {{i18n "cancel"}} - + {{else}} diff --git a/app/assets/stylesheets/common/admin/staff_logs.scss b/app/assets/stylesheets/common/admin/staff_logs.scss index c5cb456c863..3f2b48aa06a 100644 --- a/app/assets/stylesheets/common/admin/staff_logs.scss +++ b/app/assets/stylesheets/common/admin/staff_logs.scss @@ -193,9 +193,6 @@ table.screened-ip-addresses { } td.actions { text-align: right; - .cancel-action { - margin-left: 0.5em; - } } } diff --git a/app/assets/stylesheets/common/components/buttons.scss b/app/assets/stylesheets/common/components/buttons.scss index 18d61d1c2e8..1725ba2cc9a 100644 --- a/app/assets/stylesheets/common/components/buttons.scss +++ b/app/assets/stylesheets/common/components/buttons.scss @@ -287,7 +287,32 @@ } } } + &.btn-text { + color: var(--tertiary); + &[disabled] { + &, + &:hover, + &.btn-hover, + &:focus { + color: var(--primary); + } + } + &:not([disabled]) { + &:hover, + &.btn-hover, + &:focus { + color: var(--tertiary-hover); + } + &:active, + &.btn-active { + @include linear-gradient( + var(--primary-low-mid) 0%, + var(--primary-very-low) 100% + ); + } + } + } &:focus { outline: none; background: var(--primary-low); diff --git a/plugins/discourse-local-dates/assets/javascripts/discourse/templates/components/discourse-local-dates-create-form.hbs b/plugins/discourse-local-dates/assets/javascripts/discourse/templates/components/discourse-local-dates-create-form.hbs index 10c56ff5e41..390e4ece951 100644 --- a/plugins/discourse-local-dates/assets/javascripts/discourse/templates/components/discourse-local-dates-create-form.hbs +++ b/plugins/discourse-local-dates/assets/javascripts/discourse/templates/components/discourse-local-dates-create-form.hbs @@ -156,9 +156,10 @@ @label="discourse_local_dates.create.form.insert" /> {{/if}} - - {{i18n "cancel"}} - + {{/each}} + + + {{#each this.dummy.buttonSizes as |bs|}} + + {{/each}} + + + + {{#each this.dummy.buttonStates as |bs|}} + + {{/each}} +