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

Change SPOT SASS structure a bit so variable and mixin-only sass is separated

Benjamin Bädorf030f77225269
diff --git a/frontend/src/app/shared/components/project-include/project-include.component.sass b/frontend/src/app/shared/components/project-include/project-include.component.sass
index 0917f60c28f..8b2f4495c3f 100644
--- a/frontend/src/app/shared/components/project-include/project-include.component.sass
+++ b/frontend/src/app/shared/components/project-include/project-include.component.sass
@@ -1,5 +1,4 @@
-@import '../../../spot/styles/sass/common/typography'
-@import '../../../spot/styles/sass/common/variables'
+@import '../../../spot/styles/sass/variables'
\::ng-deep .spot-drop-modal--body
width: 460px
diff --git a/frontend/src/app/spot/spot-docs.component.html b/frontend/src/app/spot/spot-docs.component.html
index e0c53277f88..f89d8997d0b 100644
--- a/frontend/src/app/spot/spot-docs.component.html
+++ b/frontend/src/app/spot/spot-docs.component.html
@@ -222,7 +222,19 @@ Currently selected value is {{ toggleValue }}
(click)="dropModalOpen = !dropModalOpen"
>Open Modal</button>
<ng-container slot="body">
- <h1>Test</h1>
+ <div class="spot-body">
+ <h1>Test</h1>
+
+ <spot-text-field
+ placeholder="Placeholder value"
+ [(ngModel)]="textFieldValue"
+ >
+ <span
+ slot="before"
+ class="spot-icon spot-icon_bell"
+ ></span>
+ </spot-text-field>
+ </div>
</ng-container>
</spot-drop-modal>
diff --git a/frontend/src/app/spot/spot-docs.component.ts b/frontend/src/app/spot/spot-docs.component.ts
index be1a9f76d62..c75d1610979 100644
--- a/frontend/src/app/spot/spot-docs.component.ts
+++ b/frontend/src/app/spot/spot-docs.component.ts
@@ -10,7 +10,7 @@ export class SpotDocsComponent {
listCheckboxValue = null;
textFieldValue = 'ngModel value';
dropModalOpen = false;
- alignment = 'bottom-center';
+ alignment = 'bottom-left';
toggleValue = null;
toggleOptions = [
diff --git a/frontend/src/app/spot/styles/sass/common/index.sass b/frontend/src/app/spot/styles/sass/common/index.sass
index f1210eea4df..c781279d27e 100644
--- a/frontend/src/app/spot/styles/sass/common/index.sass
+++ b/frontend/src/app/spot/styles/sass/common/index.sass
@@ -1,5 +1,2 @@
@import './icon'
-@import './zindex'
-@import './typography'
-@import './variables'
@import './body'
diff --git a/frontend/src/app/spot/styles/sass/common/variables.sass b/frontend/src/app/spot/styles/sass/common/variables.sass
deleted file mode 100644
index c3ef74b4f2c..00000000000
--- a/frontend/src/app/spot/styles/sass/common/variables.sass
+++ /dev/null
@@ -1 +0,0 @@
-@import '../../tokens/dist/tokens'
diff --git a/frontend/src/app/spot/styles/sass/components/drop-modal.sass b/frontend/src/app/spot/styles/sass/components/drop-modal.sass
index c20390360ca..1e0e61076c7 100644
--- a/frontend/src/app/spot/styles/sass/components/drop-modal.sass
+++ b/frontend/src/app/spot/styles/sass/components/drop-modal.sass
@@ -20,12 +20,21 @@
background: $spot-color-basic-white
border-radius: 5px
+ @media #{$spot-mq-landscape}
+ bottom: $spot-spacing-1
+ top: $spot-spacing-1
+ right: $spot-spacing-3_5
+ height: calc(100vw - (2 * #{$spot-spacing-1}))
+ width: calc(100vh - (#{$spot-spacing-3_5} - #{$spot-spacing-1}))
+
@media #{$spot-mq-drop-modal-in-context}
position: absolute
top: unset
bottom: unset
left: unset
right: unset
+ width: auto
+ max-width: calc(100vw - (2 * #{$spot-spacing-1}))
&_bottom-center
top: calc(100% + #{$spot-spacing-0_25})
@@ -79,6 +88,15 @@
transform: translateX(-50%)
background-color: $spot-color-basic-white
+ @media #{$spot-mq-landscape}
+ bottom: unset
+ left: unset
+ right: $spot-spacing-0_75
+ width: calc(100% - 2 * $spot-spacing-1)
+ top: 50%
+ transform: translateY(-50%)
+
+
&_opened &--close-button
display: block
diff --git a/frontend/src/app/spot/styles/sass/index.sass b/frontend/src/app/spot/styles/sass/index.sass
index 30393d2e967..390f320700a 100644
--- a/frontend/src/app/spot/styles/sass/index.sass
+++ b/frontend/src/app/spot/styles/sass/index.sass
@@ -1,2 +1,3 @@
+@import 'variables'
@import 'common'
@import 'components'
diff --git a/frontend/src/app/spot/styles/sass/variables/index.sass b/frontend/src/app/spot/styles/sass/variables/index.sass
new file mode 100644
index 00000000000..03211e88368
--- /dev/null
+++ b/frontend/src/app/spot/styles/sass/variables/index.sass
@@ -0,0 +1,3 @@
+@import '../../tokens/dist/tokens'
+@import 'typography'
+@import 'zindex'
diff --git a/frontend/src/app/spot/styles/sass/common/typography.sass b/frontend/src/app/spot/styles/sass/variables/typography.sass
similarity index 100%
rename from frontend/src/app/spot/styles/sass/common/typography.sass
rename to frontend/src/app/spot/styles/sass/variables/typography.sass
diff --git a/frontend/src/app/spot/styles/sass/common/zindex.sass b/frontend/src/app/spot/styles/sass/variables/zindex.sass
similarity index 68%
rename from frontend/src/app/spot/styles/sass/common/zindex.sass
rename to frontend/src/app/spot/styles/sass/variables/zindex.sass
index b891ac6bba4..b9bffc5c7b9 100644
--- a/frontend/src/app/spot/styles/sass/common/zindex.sass
+++ b/frontend/src/app/spot/styles/sass/variables/zindex.sass
@@ -1,6 +1,6 @@
@use "sass:map"
-$spot-z-indexes: ( "drop-modal": 1000 )
+$spot-z-indexes: ( "header": 20, "drop-modal": 1000)
@mixin spot-z-index($type, $addition: 0)
z-index: map.get($spot-z-indexes, $type) + $addition
diff --git a/frontend/src/app/spot/styles/tokens/dist/tokens.json b/frontend/src/app/spot/styles/tokens/dist/tokens.json
index d86471efef2..470f32b13c9 100644
--- a/frontend/src/app/spot/styles/tokens/dist/tokens.json
+++ b/frontend/src/app/spot/styles/tokens/dist/tokens.json
@@ -54,7 +54,7 @@
"spot-shadow-hard-low": "2px 2px 5px rgba(0, 0, 0, 0.25)",
"spot-shadow-hard-mid": "4px 4px 10px rgba(0, 0, 0, 0.25)",
"spot-shadow-hard-high": "6px 6px 20px rgba(0, 0, 0, 0.25)",
- "spot-mq-drop-modal-in-context": "'screen and (min-width: 768px)'",
- "spot-mq-portrait": "'screen and (orientation: portrait)'",
- "spot-mq-landscape": "'screen and (orientation: landscape)'"
+ "spot-mq-portrait": "'(orientation: portrait)'",
+ "spot-mq-landscape": "'(orientation: landscape)'",
+ "spot-mq-drop-modal-in-context": "'(min-width: 680px) and (min-height: 500px)'"
}
\ No newline at end of file
diff --git a/frontend/src/app/spot/styles/tokens/dist/tokens.sass b/frontend/src/app/spot/styles/tokens/dist/tokens.sass
index 8becbeb3549..7196dd84ca7 100644
--- a/frontend/src/app/spot/styles/tokens/dist/tokens.sass
+++ b/frontend/src/app/spot/styles/tokens/dist/tokens.sass
@@ -54,6 +54,6 @@ $spot-shadow-light-high: 6px 6px 20px rgba(0, 0, 0, 0.15)
$spot-shadow-hard-low: 2px 2px 5px rgba(0, 0, 0, 0.25)
$spot-shadow-hard-mid: 4px 4px 10px rgba(0, 0, 0, 0.25)
$spot-shadow-hard-high: 6px 6px 20px rgba(0, 0, 0, 0.25)
-$spot-mq-drop-modal-in-context: 'screen and (min-width: 768px)'
-$spot-mq-portrait: 'screen and (orientation: portrait)'
-$spot-mq-landscape: 'screen and (orientation: landscape)'
+$spot-mq-portrait: '(orientation: portrait)'
+$spot-mq-landscape: '(orientation: landscape)'
+$spot-mq-drop-modal-in-context: '(min-width: 680px) and (min-height: 500px)'
diff --git a/frontend/src/app/spot/styles/tokens/media-queries.yml b/frontend/src/app/spot/styles/tokens/media-queries.yml
index 140ec772289..8ad4d717aa5 100644
--- a/frontend/src/app/spot/styles/tokens/media-queries.yml
+++ b/frontend/src/app/spot/styles/tokens/media-queries.yml
@@ -1,11 +1,9 @@
props:
- spot-mq-portrait:
- value: "'screen and (orientation: portrait)'"
spot-mq-landscape:
- value: "'screen and (orientation: landscape)'"
+ value: "'(orientation: landscape)'"
spot-mq-drop-modal-in-context:
- value: "'screen and (min-width: 680px)'"
+ value: "'(min-width: 680px) and (min-height: 500px)'"
global:
type: media-query
diff --git a/frontend/src/global_styles/common/header/app-header.sass b/frontend/src/global_styles/common/header/app-header.sass
index 5bfedaf9707..27c2110b92e 100644
--- a/frontend/src/global_styles/common/header/app-header.sass
+++ b/frontend/src/global_styles/common/header/app-header.sass
@@ -7,7 +7,7 @@
height: var(--header-height)
padding: 0
position: relative
- z-index: 22
+ @include spot-z-index("header")
border-bottom-style: solid
border-bottom-width: var(--header-border-bottom-width)
border-bottom-color: var(--header-border-bottom-color)
diff --git a/frontend/src/global_styles/layout/_base.sass b/frontend/src/global_styles/layout/_base.sass
index e93b1ed420e..fd16b3a46c7 100644
--- a/frontend/src/global_styles/layout/_base.sass
+++ b/frontend/src/global_styles/layout/_base.sass
@@ -35,7 +35,6 @@
#main
display: grid
grid-template-columns: auto 1fr
- z-index: 20
overflow: auto
&.nomenus
diff --git a/frontend/src/global_styles/openproject.sass b/frontend/src/global_styles/openproject.sass
index bdd45413129..8305e166b8d 100644
--- a/frontend/src/global_styles/openproject.sass
+++ b/frontend/src/global_styles/openproject.sass
@@ -1,3 +1,6 @@
+// SPOT variables
+@import "../app/spot/styles/sass/variables"
+
@import "fonts/_index.sass"
@import "openproject/_index.sass"
@import "vendor/_index.sass"
@@ -5,8 +8,11 @@
@import "content/_index.sass"
@import "./common/openproject-common.module"
-@import "../app/spot/styles/sass"
@import "../app/shared/components/modal/modal.module"
// Dynamically linked plugin styles from Rails plugins
@import "../app/features/plugins/linked-plugins.styles"
+
+// SPOT styles
+@import "../app/spot/styles/sass/common"
+@import "../app/spot/styles/sass/components"