Skip to content

Commit 95f31a9

Browse files
committed
Introduce specific variables for list item selection, hover and pressed state
1 parent db29c1d commit 95f31a9

4 files changed

Lines changed: 33 additions & 11 deletions

File tree

frontend/src/app/features/in-app-notifications/entry/in-app-notification-entry.component.sass

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
@import "helpers"
22

3-
$ian-bg-color: var(--body-background)
4-
$ian-bg-hover-color: var(--bgColor-neutral-muted)
3+
$ian-bg-color: var(--list-item-bg-color)
4+
$ian-bg-hover-color: var(--list-item-bg-hover-color)
5+
$ian-border-color: var(--list-item-border-color)
56
$ian-bg-read-color: var(--bgColor-muted)
6-
$ian-bg-read-hover-color: hsl(from var(--bgColor-neutral-muted) h s calc(l - 0.5))
7-
$ian-bg-selected-color: var(--codeMirror-selection-bgColor)
8-
$ian-bg-selected-hover-color: hsl(from var(--codeMirror-selection-bgColor) h calc(s - 30) l)
7+
$ian-bg-read-hover-color: hsl(from var(--bgColor-muted) h s calc(l - 3.5))
8+
$ian-bg-selected-color: var(--list-item-bg-selected-color)
9+
$ian-bg-selected-hover-color: var(--list-item-bg-selected-hover-color)
10+
$ian-selected-border-color: var(--list-item-selected-border-color)
911
// This needs to be set in the itemSize of
1012
// the virtual scroller
1113
$ian-height: 100px
@@ -17,7 +19,7 @@ $subject-font-size: 14px
1719
margin: 0
1820
padding: 15px 10px
1921
font-size: 0.9rem
20-
border-top: 1px solid var(--borderColor-default)
22+
border-top: 1px solid $ian-border-color
2123
height: $ian-height
2224

2325
&:hover
@@ -27,10 +29,11 @@ $subject-font-size: 14px
2729
border-top: none
2830

2931
&:last-of-type
30-
border-bottom: 1px solid var(--borderColor-default)
32+
border-bottom: 1px solid $ian-border-color
3133

3234
&_selected
3335
background: $ian-bg-selected-color
36+
border: $ian-selected-border-color
3437
&:hover
3538
background: $ian-bg-selected-hover-color
3639

frontend/src/global_styles/content/_tables.sass

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ th.hidden
105105

106106
tr.context-menu-selection,
107107
tr.-checked
108-
background-color: var(--bgColor-accent-muted) !important
108+
background-color: var(--list-item-bg-selected-color) !important
109109
&[class*=__hl_background]
110110
outline: var(--bgColor-accent-emphasis) solid 2px
111111

112112
td
113-
border-top: 1px solid var(--bgColor-accent-emphasis) !important
114-
border-bottom: 1px solid var(--bgColor-accent-emphasis) !important
113+
border-top: 1px solid var(--list-item-selected-border-color) !important
114+
border-bottom: 1px solid var(--list-item-selected-border-color) !important
115115
color: var(--body-font-color) !important
116116
a
117117
color: var(--body-font-color) !important

frontend/src/global_styles/layout/work_packages/_table.sass

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,18 @@ body[class*="router--"]
7171
div.row-hovered
7272
// Use important to override the background styles from __hl classes
7373
// That also have to be important (cf. 30863)
74-
background: var(--codeMirror-selection-bgColor) !important
74+
background: var(--list-item-bg-color) !important
75+
border-color: var(--list-item-selected-border-color)
7576
color: var(--body-font-color) !important
7677

78+
&:hover
79+
background: var(--list-item-bg-color) !important
80+
&.-checked
81+
background: var(--list-item-bg-selected-color) !important
82+
border-color: var(--list-item-selected-border-color)
83+
&:hover
84+
background: var(--list-item-bg-selected-hover-color) !important
85+
7786
// Left part of the split view
7887
// == flex container for (table|timeline)
7988
.work-packages-split-view--tabletimeline-side

frontend/src/global_styles/openproject/_variable_defaults.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,14 @@
133133
--gantt-split-width: 50%;
134134
--enterprise-upsell-color: #CE4C00;
135135
--enterprise-upsell-text-color: #CE4C00;
136+
137+
--list-item-bg-color: var(--body-background);
138+
--list-item-bg-hover-color: var(--bgColor-muted);
139+
--list-item-border-color: var(--borderColor-default);
140+
--list-item-selected-bg-color: var(--bgColor-accent-muted);
141+
--list-item-selected-bg-hover-color: hsl(from var(--bgColor-accent-muted) h calc(s - 60) l);
142+
--list-item-selected-border-color: var(--borderColor-accented-emphasis);
143+
//--list-item-bg-pressed-color: ??
144+
//--list-item-bg-pressed-hover-color: ??
145+
//--list-item-bg-pressed-border-color: ??
136146
}

0 commit comments

Comments
 (0)