From 3c8e41d4f6cb3037f99afdd12923f803c33e0a2b Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 16 Nov 2016 11:37:13 +0100 Subject: [PATCH 1/4] CSS: Remove rule for inputs having the placeholder attribute This was meant to style the input's placeholder but it is just wrong. --- public/css/icinga/forms.less | 4 ---- 1 file changed, 4 deletions(-) diff --git a/public/css/icinga/forms.less b/public/css/icinga/forms.less index e4cf350c3..5b65945c5 100644 --- a/public/css/icinga/forms.less +++ b/public/css/icinga/forms.less @@ -53,10 +53,6 @@ input::-webkit-input-placeholder { color: inherit; } -input[placeholder] { - color: inherit; -} - input.search { background: transparent url("../img/icons/search.png") no-repeat scroll 0.1em center; background-size: 1em 1em; From 6b06e05c04354c654eaaf372c22eb80cadae28de Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 16 Nov 2016 11:43:21 +0100 Subject: [PATCH 2/4] CSS: Add clear button to the search field in the menu refs #11835 --- application/views/scripts/layout/menu.phtml | 10 ++--- public/css/icinga/menu.less | 45 ++++++++++++++++++++- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/application/views/scripts/layout/menu.phtml b/application/views/scripts/layout/menu.phtml index 6821e532c..6102432ff 100644 --- a/application/views/scripts/layout/menu.phtml +++ b/application/views/scripts/layout/menu.phtml @@ -6,11 +6,11 @@ $searchDashboard = new SearchDashboard(); $searchDashboard->setUser($this->Auth()->getUser()); if ($searchDashboard->search('dummy')->getPane('search')->hasDashlets()): ?> -
- + + +
setCssClass('primary-nav')->setElementTag('nav')->setHeading(t('Navigation')); ?> diff --git a/public/css/icinga/menu.less b/public/css/icinga/menu.less index 944461cd2..6bb1410ce 100644 --- a/public/css/icinga/menu.less +++ b/public/css/icinga/menu.less @@ -167,7 +167,6 @@ } // Accessibility skip links - .skip-links { position: relative; ul { @@ -198,3 +197,47 @@ bottom: 0 !important; height: auto !important; } + +.search-control { + position: relative; +} + +.search-reset { + background: none; + border: 0; + cursor: pointer; + display: none; + height: 100%; + padding: 0; + position: absolute; + right: 0; + top: 0; + user-select: none; +} + +.search-reset:focus { + outline: 0; +} + +// Override forms.less +input[type=text].search-input { + padding-right: 1.4em; + text-overflow: ellipsis; +} + +.search-input:valid ~ .search-reset { + animation-duration: .4s; + animation-name: search-reset-in; + display: block; +} + +@keyframes search-reset-in { + 0% { + opacity: 0; + transform: translate3d(-20%, 0, 0); + } + 100% { + opacity: 1; + transform: none; + } +} From c0e92c2bc5b54ce76c74ae3adda2ff75a6b3f90d Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 16 Nov 2016 12:34:55 +0100 Subject: [PATCH 3/4] CSS: Use color gray-light for the search placeholder in the menu --- public/css/icinga/menu.less | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/public/css/icinga/menu.less b/public/css/icinga/menu.less index 6bb1410ce..b583fb1d3 100644 --- a/public/css/icinga/menu.less +++ b/public/css/icinga/menu.less @@ -225,6 +225,22 @@ input[type=text].search-input { text-overflow: ellipsis; } +.search-input:-moz-placeholder { // FF 18- + color: @gray-light; +} + +.search-input::-moz-placeholder { // FF 19+ + color: @gray-light; +} + +.search-input:-ms-input-placeholder { + color: @gray-light; +} + +.search-input::-webkit-input-placeholder { + color: @gray-light; +} + .search-input:valid ~ .search-reset { animation-duration: .4s; animation-name: search-reset-in; From 5805e5d67519a01f57992227e6641225cb4cd643 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 16 Nov 2016 12:54:38 +0100 Subject: [PATCH 4/4] CSS: Fix skip-links positioning --- public/css/icinga/menu.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/css/icinga/menu.less b/public/css/icinga/menu.less index b583fb1d3..f075b983b 100644 --- a/public/css/icinga/menu.less +++ b/public/css/icinga/menu.less @@ -177,13 +177,15 @@ display: block; a, button[type="submit"] { background-color: @body-bg-color; + border: none; left: -999px; padding: @vertical-padding @horizontal-padding; position: absolute; width: 100%; + z-index: 1; &:focus { left: 0; - outline: 1px dotted black; + outline-offset: -3px; } } button[type="submit"] {