From 7b885cc69ae613ddbb0fcd7664ce2a79cf1f14ca Mon Sep 17 00:00:00 2001 From: Jonathan Tang Date: Wed, 20 Dec 2023 00:51:14 -0800 Subject: [PATCH 1/2] feat: matches style of "choose file" button to bootstrap style of buttons --- .../apps/hqwebapp/static/hqwebapp/less/_hq/buttons.less | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/corehq/apps/hqwebapp/static/hqwebapp/less/_hq/buttons.less b/corehq/apps/hqwebapp/static/hqwebapp/less/_hq/buttons.less index 20f2339c9086..0f101f1ad1d0 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/less/_hq/buttons.less +++ b/corehq/apps/hqwebapp/static/hqwebapp/less/_hq/buttons.less @@ -1,8 +1,16 @@ +@import "../../../../../../node_modules/bootstrap/less/buttons.less"; + .btn-primary { .button-variant(#ffffff; @call-to-action-mid; @call-to-action-mid); font-weight: bold; } +input::file-selector-button { + .btn; + .btn-xs; + .btn-default; +} + .btn-default { .button-variant(@call-to-action-mid; #ffffff; @call-to-action-mid); } From de6b9084a2f7216efdd620807801d6c3227fc8de Mon Sep 17 00:00:00 2001 From: Jonathan Tang Date: Wed, 20 Dec 2023 14:02:42 -0800 Subject: [PATCH 2/2] sync with bootstrap5 style sheet --- .../hqwebapp/scss/commcarehq/_buttons.scss | 17 +++++++++++ .../imports/buttons._buttons.style.diff.txt | 29 +++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/corehq/apps/hqwebapp/static/hqwebapp/scss/commcarehq/_buttons.scss b/corehq/apps/hqwebapp/static/hqwebapp/scss/commcarehq/_buttons.scss index cba714362de9..48db1b23e1fe 100644 --- a/corehq/apps/hqwebapp/static/hqwebapp/scss/commcarehq/_buttons.scss +++ b/corehq/apps/hqwebapp/static/hqwebapp/scss/commcarehq/_buttons.scss @@ -35,3 +35,20 @@ .btn-outline-danger:hover { color: #ffffff; } + +.btn-default { + @include button-variant(white, $call-to-action-mid, $call-to-action-mid); +} + +.btn-group-xs > .btn, .btn-xs { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; + } + +input::file-selector-button { + @extend .btn; + @extend .btn-xs; + @extend .btn-default; +} diff --git a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/stylesheets/imports/buttons._buttons.style.diff.txt b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/stylesheets/imports/buttons._buttons.style.diff.txt index 6c6f6d0f3c62..781eb4a12bcf 100644 --- a/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/stylesheets/imports/buttons._buttons.style.diff.txt +++ b/corehq/apps/hqwebapp/tests/data/bootstrap5_diffs/stylesheets/imports/buttons._buttons.style.diff.txt @@ -1,11 +1,19 @@ --- +++ -@@ -1,26 +1,5 @@ +@@ -1,34 +1,5 @@ +-@import "../../../../../../node_modules/bootstrap/less/buttons.less"; +- -.btn-primary { - .button-variant(#ffffff; @call-to-action-mid; @call-to-action-mid); - font-weight: bold; -} - +-input::file-selector-button { +- .btn; +- .btn-xs; +- .btn-default; +-} +- -.btn-default { - .button-variant(@call-to-action-mid; #ffffff; @call-to-action-mid); -} @@ -28,7 +36,7 @@ } .btn-full-width { -@@ -30,25 +9,29 @@ +@@ -38,25 +9,46 @@ // Separated button groups in toolbars need more space between them, // since the buttons within the group have space between them .btn-toolbar > .btn-group-separated:not(:first-child) { @@ -74,3 +82,20 @@ +.btn-outline-danger:hover { + color: #ffffff; +} ++ ++.btn-default { ++ @include button-variant(white, $call-to-action-mid, $call-to-action-mid); ++} ++ ++.btn-group-xs > .btn, .btn-xs { ++ padding: 1px 5px; ++ font-size: 12px; ++ line-height: 1.5; ++ border-radius: 3px; ++ } ++ ++input::file-selector-button { ++ @extend .btn; ++ @extend .btn-xs; ++ @extend .btn-default; ++}