From c2c6413eb7ba78cb64e7c470bbd406ed1156b70d Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Mon, 7 Jun 2021 00:27:02 +0200 Subject: [PATCH] Support custom SVG icon in umb-child-selector component (#10344) * Use umb-icon component * Specify button type attribute * Use umb-search-filter component * Adjust styling of item picker * Replace trash icons with umb-icon * Replace a few icons in umb-grid-selector as well * Use umb-icon in datatype picker * Ensure icons are styles correct in legacy format * Use umb-icon component in macro parameter editors and fix wrong end closing tag from button element * Use umb-icon in macro parameter editor overlay --- .../src/less/components/card.less | 117 +++++++++--------- .../less/components/umb-group-builder.less | 1 + .../datatypepicker/datatypepicker.html | 42 +++---- .../macroparameterpicker.html | 31 +++-- .../overlays/itempicker/itempicker.html | 34 ++--- .../views/components/umb-child-selector.html | 8 +- .../views/components/umb-grid-selector.html | 29 +++-- .../macros/infiniteeditors/parameter.html | 2 +- 8 files changed, 133 insertions(+), 131 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/card.less b/src/Umbraco.Web.UI.Client/src/less/components/card.less index 7174c0f290..4e3a8b0d70 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/card.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/card.less @@ -96,8 +96,6 @@ } - - //Card icon grid for picking items off a card .umb-card-grid { padding: 0; @@ -129,48 +127,74 @@ } .umb-card-grid.-three-in-row li { - flex: 0 0 33.333%; - max-width:33.333%; + flex: 0 0 33.333%; + max-width: 33.333%; - i { + span > i, // legacy icon + .umb-icon { font-size: 36px; - line-height: 28px; + line-height: 1; } } -.umb-card-grid .umb-card-grid-item { - position: relative; - display: block; - width: 100%; - height: 100%; - padding: 10px 5px; - border-radius: @baseBorderRadius * 2; - transition: background-color 120ms; - font-size: 13px; - line-height: 1.3em; - display: flex; - flex-direction: column; - align-items: center; - justify-content: flex-start; - - > span { +.umb-card-grid { + .umb-card-grid-item { position: relative; + display: block; + width: 100%; + height: 100%; + padding: 10px 5px; + border-radius: @baseBorderRadius * 2; + transition: background-color 120ms; + font-size: 13px; + line-height: 1.3em; display: flex; - align-items: center; - justify-content: center; flex-direction: column; - background-color: transparent; - word-break: break-word; + align-items: center; + justify-content: flex-start; + + &__loading { + position: absolute; + background-color: rgba(255,255,255,0.8); + top: 0; + right: 0; + bottom: 0; + left: 0; + } + + a { + color: @ui-option-type; + text-decoration: none; + } + + > span { + position: relative; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + background-color: transparent; + word-break: break-word; + } + + &:hover { + background-color: @ui-option-hover; + color: @ui-option-type-hover; + } + + &:focus { + color: @ui-option-type-hover; + } } -} - -.umb-card-grid .umb-card-grid-item:hover { - background-color: @ui-option-hover; - color: @ui-option-type-hover; -} -.umb-card-grid .umb-card-grid-item:focus { - color: @ui-option-type-hover; + span > i, // legacy icon + .umb-icon { + font-size: 30px; + line-height: 1; + margin-top: 6px; + margin-bottom: 10px; + display: block; + } } .umb-card-grid .umb-card-grid-item.--creator { @@ -189,7 +213,6 @@ width: 100%; padding-top: 100%; border-radius: @baseBorderRadius * 2; - box-sizing: border-box; transition: background-color 120ms; @@ -217,30 +240,6 @@ } } - -.umb-card-grid a { - color: @ui-option-type; - text-decoration: none; -} - -.umb-card-grid i { - font-size: 30px; - line-height: 20px; - margin-top: 6px; - margin-bottom: 10px; - display: block; -} - - .umb-card-grid .umb-card-grid-item__loading { - position: absolute; - background-color: rgba(255,255,255,0.8); - top: 0; - right: 0; - bottom: 0; - left: 0; - } - - //Round icon-like button - this should be somewhere else .umb-btn-round { padding: 4px 6px 4px 6px; diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less index 87e46f5d85..a4a8388861 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-group-builder.less @@ -546,6 +546,7 @@ input.umb-group-builder__group-sort-value { .icon { font-size: 32px; + line-height: 1; } } diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/datatypepicker/datatypepicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/datatypepicker/datatypepicker.html index 3d8e1d4d0b..d19f537354 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/datatypepicker/datatypepicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/datatypepicker/datatypepicker.html @@ -22,8 +22,7 @@ text="Type to search" on-change="vm.searchTermChanged()" css-class="w-100" - auto-focus="true" - > + auto-focus="true"> @@ -33,14 +32,13 @@

{{key | umbCmsTitleCase}}