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

Extract input styles for inputs in toolbars to a mixin to avoid, that we have to manually adjust all places in the future

Henriette Darge180c4a2d6943
diff --git a/frontend/src/global_styles/content/work_packages/new/_type_status_row.sass b/frontend/src/global_styles/content/work_packages/new/_type_status_row.sass
index 6322c3197fe..949357eae78 100644
--- a/frontend/src/global_styles/content/work_packages/new/_type_status_row.sass
+++ b/frontend/src/global_styles/content/work_packages/new/_type_status_row.sass
@@ -1,3 +1,5 @@
+@import "helpers"
+
.wp-new-top-row
color: var(--content-link-color)
display: flex
@@ -21,11 +23,11 @@
.inline-edit--field
min-width: 125px
+// Avoid visual jump by making them the same height as the toolbar inputs
.work-packages--type-selector,
.work-packages--status-selector
.-active
.ng-select-container
- height: 36px !important
- line-height: 36px !important
+ @include toolbar-input-styles
.ng-select input
height: initial !important
diff --git a/frontend/src/global_styles/content/work_packages/single_view/_single_view.sass b/frontend/src/global_styles/content/work_packages/single_view/_single_view.sass
index 1303c01d855..6666c244f0a 100644
--- a/frontend/src/global_styles/content/work_packages/single_view/_single_view.sass
+++ b/frontend/src/global_styles/content/work_packages/single_view/_single_view.sass
@@ -27,6 +27,7 @@
//++
@import "src/app/spot/styles/tokens/dist/tokens"
+@import "helpers"
@mixin details-pane--form-field
@include grid-visible-overflow
@@ -69,11 +70,12 @@
@include grid-size(expand)
@include details-pane--form-field
- // overriding default in place editing padding
- // because the height will otherwise be too much
- // and the change from read to write will flicker
- .inplace-edit--text-field
- padding: 0.15625rem 0.375rem
+
+ // Style edit field to look like the display field.
+ // Thus we avoid a visual jump when editing the subject.
+ &.-active input
+ @include toolbar-input-styles
+ padding: 5px 0 5px 5px
.work-packages--details-content
font-size: 0.875rem
diff --git a/frontend/src/global_styles/layout/_toolbar.sass b/frontend/src/global_styles/layout/_toolbar.sass
index c0129e2f462..7717627ac32 100644
--- a/frontend/src/global_styles/layout/_toolbar.sass
+++ b/frontend/src/global_styles/layout/_toolbar.sass
@@ -25,6 +25,8 @@
//
// See COPYRIGHT and LICENSE files for more details.
//++
+@import "helpers"
+
$nm-color-error-background: #fedada
$nm-color-success-border: #35c53f
@@ -246,8 +248,7 @@ $nm-color-success-background: #d8fdd1
margin: 9px 0
color: var(--toolbar-title-color)
font-size: 1.5rem
- height: 36px
- line-height: 36px
+ @include toolbar-input-styles
width: calc(100% + 2px)
&.-error
diff --git a/frontend/src/global_styles/layout/work_packages/_details_view.sass b/frontend/src/global_styles/layout/work_packages/_details_view.sass
index d6d90d86366..143eb15c2af 100644
--- a/frontend/src/global_styles/layout/work_packages/_details_view.sass
+++ b/frontend/src/global_styles/layout/work_packages/_details_view.sass
@@ -92,18 +92,6 @@ body.router--work-packages-partitioned-split-view-new
.work-packages--details--subject
overflow: hidden
- .inline-edit--field
- height: 38px
- line-height: 36px
-
- // Style edit field to look like the display field.
- // Thus we avoid a visual jump when editing the subject.
- &.-active input
- height: 36px !important
- line-height: 36px !important
- padding: 5px 0 5px 5px !important
- font-size: 20px !important
-
.work-packages--details-form
display: flex
flex-direction: column
diff --git a/frontend/src/global_styles/openproject/_mixins.sass b/frontend/src/global_styles/openproject/_mixins.sass
index f7a04cb0310..ce25dc9dbcb 100644
--- a/frontend/src/global_styles/openproject/_mixins.sass
+++ b/frontend/src/global_styles/openproject/_mixins.sass
@@ -303,6 +303,10 @@ $scrollbar-size: 10px
@mixin board-header-editable-toolbar-title
line-height: normal !important
+@mixin toolbar-input-styles
+ height: 36px !important
+ line-height: 36px !important
+
@mixin global-breadcrumb-styles
margin-top: 10px
display: none