Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Unify focus states to spot-focus (#11126)

Benjamin Bädorf27720bb2fafb
diff --git a/frontend/src/app/spot/styles/sass/common/focus.sass b/frontend/src/app/spot/styles/sass/common/focus.sass
new file mode 100644
index 00000000000..ef2ea90b261
--- /dev/null
+++ b/frontend/src/app/spot/styles/sass/common/focus.sass
@@ -0,0 +1,3 @@
+:focus-visible
+ @include spot-focus
+
diff --git a/frontend/src/app/spot/styles/sass/common/index.sass b/frontend/src/app/spot/styles/sass/common/index.sass
index a386bf6f91a..f2d34b833e9 100644
--- a/frontend/src/app/spot/styles/sass/common/index.sass
+++ b/frontend/src/app/spot/styles/sass/common/index.sass
@@ -1,3 +1,4 @@
@import './icon'
+@import './focus'
@import './container'
@import './typography'
diff --git a/frontend/src/app/spot/styles/sass/components/text-field.sass b/frontend/src/app/spot/styles/sass/components/text-field.sass
index 54a03c409f0..0a41c8f95a3 100644
--- a/frontend/src/app/spot/styles/sass/components/text-field.sass
+++ b/frontend/src/app/spot/styles/sass/components/text-field.sass
@@ -40,6 +40,10 @@
color: $spot-color-basic-gray-4
background-color: $spot-color-basic-white
+ &:focus,
+ &:focus-visible
+ outline: none
+
&--clear-button
border: 0
background: transparent
diff --git a/frontend/src/app/spot/styles/sass/variables/focus.sass b/frontend/src/app/spot/styles/sass/variables/focus.sass
index d66f7dff2d4..9cd16229403 100644
--- a/frontend/src/app/spot/styles/sass/variables/focus.sass
+++ b/frontend/src/app/spot/styles/sass/variables/focus.sass
@@ -3,4 +3,3 @@ $spot-focus: 2px solid $spot-color-indication-attention
@mixin spot-focus
outline: $spot-focus
outline-offset: -2px
-
diff --git a/frontend/src/global_styles/content/_forms.sass b/frontend/src/global_styles/content/_forms.sass
index b5fbb09b26d..ce94c5e67b3 100644
--- a/frontend/src/global_styles/content/_forms.sass
+++ b/frontend/src/global_styles/content/_forms.sass
@@ -866,6 +866,9 @@ input[readonly].-clickable
border-top-right-radius: 2px
border-bottom-right-radius: 2px
+ &:focus-within
+ @include spot-focus
+
.form--list
display: flex
margin: 0
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_forms.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_forms.scss
index 29e8cdd315f..5de433db797 100755
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_forms.scss
+++ b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_forms.scss
@@ -100,7 +100,6 @@ $meter-radius: 0 !default;
color: $input-color-hover;
}
&:focus {
- outline: 0;
border: $input-border-focus;
background: $input-background-focus;
color: $input-color-focus;
@@ -252,10 +251,6 @@ select {
background-color: $select-background-hover;
}
- &:focus {
- outline: 0;
- }
-
// Remove the dropdown arrow added in IE10/11
&::-ms-expand {
display: none;
@@ -281,10 +276,6 @@ input[type="range"] {
border-radius: $slider-radius;
}
- &:focus {
- outline: 0;
- }
-
// Chrome/Safari
&::-webkit-slider-runnable-track {
height: $slider-height;