From a6b58be7dba250404ace55f2130d32b32e533875 Mon Sep 17 00:00:00 2001 From: Yvonne Tang Date: Tue, 26 Mar 2019 12:03:32 -0700 Subject: [PATCH 1/2] Refactor site-search so the icon can be turned into inline CSS by Webpack (#350) * 349: first pass using search icon as background image * 349: use sr helper class on button to hide text visually instead * 349: unit fixup and put max width on example wrapper instead * Update site-search.twig --- core/css/decanter.css | 17 +++++++---------- .../components/site-search/_site-search.scss | 19 +++++++------------ .../components/site-search/site-search.json | 3 +-- .../components/site-search/site-search.twig | 11 ++++++----- kss/builder/decanter/kss-assets/css/kss.css | 3 +++ kss/builder/decanter/scss/_site-search.scss | 9 +++++++++ kss/builder/decanter/scss/kss.scss | 1 + 7 files changed, 34 insertions(+), 29 deletions(-) create mode 100644 kss/builder/decanter/scss/_site-search.scss diff --git a/core/css/decanter.css b/core/css/decanter.css index 13cf4c68e..e41d26b1e 100644 --- a/core/css/decanter.css +++ b/core/css/decanter.css @@ -8733,9 +8733,9 @@ a { -moz-osx-font-smoothing: grayscale; padding: 0.6rem 2rem; display: inline-block; - height: 40px; + height: 4rem; max-width: 100%; - border-radius: 30px; + border-radius: 3rem; font-size: 1.6rem; } .su-site-search__input::-webkit-input-placeholder { color: #2e2d29; @@ -8764,16 +8764,13 @@ a { margin-top: 0; margin-right: 0; margin-bottom: 0; - background-color: transparent; + background: url("../img/icon-search.svg") no-repeat 0 0; opacity: .6; position: absolute; - top: 11px; - right: 12px; - width: auto; } - .su-site-search__submit img { - display: inline-block; - max-width: 24px; - max-height: 24px; } + top: 1.1rem; + right: 1.2rem; + width: 24px; + height: 25px; } .su-site-search__submit:hover, .su-site-search__submit:active, .su-site-search__submit:focus { background-color: transparent; opacity: 1; } diff --git a/core/scss/components/site-search/_site-search.scss b/core/scss/components/site-search/_site-search.scss index f5d454e54..611981e14 100644 --- a/core/scss/components/site-search/_site-search.scss +++ b/core/scss/components/site-search/_site-search.scss @@ -18,9 +18,9 @@ @include padding(.6rem 2rem); display: inline-block; - height: 40px; + height: 4rem; max-width: 100%; - border-radius: 30px; + border-radius: 3rem; font-size: 1.6rem; &::placeholder { @@ -37,18 +37,13 @@ @include padding(0); @include margin(0 0 0 null); - background-color: transparent; + background: url("#{$image-path}/icon-search.svg") no-repeat 0 0; opacity: .6; position: absolute; - top: 11px; - right: 12px; - width: auto; - - img { - display: inline-block; - max-width: 24px; - max-height: 24px; - } + top: 1.1rem; + right: 1.2rem; + width: 24px; + height: 25px; &:hover, &:active, diff --git a/core/templates/components/site-search/site-search.json b/core/templates/components/site-search/site-search.json index 475e8eb1b..7ce069fda 100644 --- a/core/templates/components/site-search/site-search.json +++ b/core/templates/components/site-search/site-search.json @@ -3,6 +3,5 @@ "method": "get", "search_label": "Search this site", "placeholder": "Search this site", - "search_input_name": "search-field", - "search_icon_src": "../../../img/icon-search.svg" + "search_input_name": "search-field" } diff --git a/core/templates/components/site-search/site-search.twig b/core/templates/components/site-search/site-search.twig index 966bdb6fa..17f714b6a 100644 --- a/core/templates/components/site-search/site-search.twig +++ b/core/templates/components/site-search/site-search.twig @@ -12,10 +12,11 @@ * - method: Method of the form * - search_label: Custom screen reader label * - search_input_name: Name for the search input field. Also used as the ID of the search input field and the "for" attribute of the label. - * - input_attributes: Additional HTML attributes for the search input field + * - search_input_attributes: Additional HTML attributes for the search input field * - placeholder: Placeholder text for the search input field - * - button_attributes: Additional HTML attributes for the submit button - * - search_icon_src: The href property of the search icon image + * - search_button_attributes: Additional HTML attributes for the submit button + * - search_button_name: The name for the form element. Defaults to 'search' + * - search_button_text: The user facing text for the button. Defaults to 'Submit Search' * - additional_fields: Any additional fields for the search form, e.g., hidden input fields * */ @@ -23,8 +24,8 @@
-

Noto Sans

-

Noto Sans is a secondary font.

+

Noto Sans Devanagari (Sanskrit) Subset

+

Noto Sans is a secondary font. It should only be used when Sanskrit font support is needed.

Style Variations

Regular
Regular Italic