Skip to content

Commit 549bf69

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

5 files changed

Lines changed: 44 additions & 11 deletions

File tree

app/views/custom_styles/_primer_color_mapping.erb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@
6161
--main-menu-font-color: var(--fgColor-default);
6262
--main-menu-selected-font-color: var(--fgColor-default);
6363
--main-menu-bg-color: var(--body-background);
64+
--box-list-item-bg-color: var(--body-background);
65+
--box-list-item-bg-hover-color: var(--bgColor-muted) !important;
66+
--box-list-item-border-color: var(--borderColor-default) !important;
67+
--box-list-item-selected-bg-color: hsl(from var(--display-blue-bgColor-muted) h calc(s - 30) calc(l + 2)) !important;
68+
--box-list-item-selected-bg-hover-color: var(--display-blue-bgColor-muted) !important;
69+
--box-list-item-selected-border-color: var(--borderColor-accent-muted) !important;
70+
--box-list-item-pressed-border-color: var(--borderColor-accent-emphasis) !important;
6471
}
6572

6673
/* For accessibility themes we are also overriding the header and the sidebar */

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

Lines changed: 15 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(--box-list-item-bg-color)
4+
$ian-bg-hover-color: var(--box-list-item-bg-hover-color)
5+
$ian-border-color: var(--box-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(--box-list-item-selected-bg-color)
9+
$ian-bg-selected-hover-color: var(--box-list-item-selected-bg-hover-color)
10+
$ian-selected-border-color: var(--box-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,13 +29,19 @@ $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-color: $ian-selected-border-color
3437
&:hover
3538
background: $ian-bg-selected-hover-color
3639

40+
// Since the ian only have a top border, we need to highlight the next sibling as well to
41+
// create the impression that the selected ian has a top and bottom border
42+
& + .op-ian-item
43+
border-color: $ian-selected-border-color
44+
3745
&_read
3846
background: $ian-bg-read-color
3947
&:hover

frontend/src/global_styles/content/_tables.sass

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

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

112+
&:hover
113+
background-color: var(--box-list-item-selected-bg-hover-color) !important
114+
112115
td
113-
border-top: 1px solid var(--bgColor-accent-emphasis) !important
114-
border-bottom: 1px solid var(--bgColor-accent-emphasis) !important
116+
border-top: 1px solid var(--box-list-item-selected-border-color) !important
117+
border-bottom: 1px solid var(--box-list-item-selected-border-color) !important
115118
color: var(--body-font-color) !important
116119
a
117120
color: var(--body-font-color) !important

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,16 @@ 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(--box-list-item-bg-hover-color) !important
75+
border-color: var(--box-list-item-border-color)
7576
color: var(--body-font-color) !important
7677

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

frontend/src/global_styles/openproject/_variable_defaults.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,12 @@
133133
--gantt-split-width: 50%;
134134
--enterprise-upsell-color: #CE4C00;
135135
--enterprise-upsell-text-color: #CE4C00;
136+
137+
--box-list-item-bg-color: var(--body-background);
138+
--box-list-item-bg-hover-color: #f6f8fa;
139+
--box-list-item-border-color: #d1d9e0;
140+
--box-list-item-selected-bg-color: hsl(from #d1f0ff h calc(s - 30) calc(l + 2));
141+
--box-list-item-selected-bg-hover-color: #d1f0ff;
142+
--box-list-item-selected-border-color: #54aeff66;
143+
--box-list-item-pressed-border-color: #0969da;
136144
}

0 commit comments

Comments
 (0)