Skip to content

Commit be7b3a2

Browse files
committed
feat(popovers): update for search redesign
1 parent 84e1c09 commit be7b3a2

File tree

1 file changed

+59
-89
lines changed

1 file changed

+59
-89
lines changed

src/popovers/search.scss

Lines changed: 59 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -3,123 +3,93 @@
33
@use "typography";
44
@use "util";
55

6-
._55c999adcf6db265-container:not(:empty) {
7-
--search-popout-option-non-text-color: currentColor;
8-
9-
@include popover.container;
10-
11-
gap: calc(var(--menu_margin) * 2);
12-
margin-top: calc(var(--headerbar-height) + var(--spacing));
13-
14-
display: flex;
15-
flex-direction: column;
16-
}
17-
18-
._56fec8e8b8048fe0-header {
19-
@include popover.title;
20-
21-
letter-spacing: 0;
6+
._1bb324526a52affb-clearSearchHistory {
7+
@include controls.icon-button("user-trash", "32px");
228

23-
box-sizing: border-box;
9+
border-radius: 999px;
2410

25-
pointer-events: none;
11+
position: absolute;
12+
top: -4px;
13+
right: 0;
2614
}
2715

28-
._56fec8e8b8048fe0-option {
29-
@include popover.entry($hover: ":is(:hover, [aria-selected='true'])");
16+
.f1c5c9823fbd3ef8-container:not(:empty) {
17+
@include popover.container;
3018

31-
font-size: var(--document-font-size);
32-
// focus border
33-
box-shadow: none;
34-
margin: 0;
19+
margin-block-start: calc(var(--headerbar-height) + var(--spacing));
3520

36-
&:is(._56fec8e8b8048fe0-user, :has(strong)) ._56fec8e8b8048fe0-filter {
37-
display: none;
21+
[data-text-variant] {
22+
font-size: var(--document-font-size);
3823
}
3924

40-
._56fec8e8b8048fe0-resultChannel {
41-
width: 100%;
42-
}
43-
44-
strong,
45-
._56fec8e8b8048fe0-displayedNick {
46-
width: 50%;
25+
// "from: user", etc.
26+
._1bb324526a52affb-filterSublabelTextContainer,
27+
[data-text-variant="text-sm/medium"] + [data-text-variant="text-sm/medium"] {
28+
display: none;
4729
}
30+
}
4831

49-
strong {
50-
color: var(--popover_fg_color);
51-
font-weight: normal;
52-
margin-left: calc(popover.$icon-size + var(--spacing));
53-
}
32+
._1bb324526a52affb-divider {
33+
margin: var(--menu_padding) 0;
34+
}
5435

55-
._56fec8e8b8048fe0-answer {
56-
color: var(--popover_fg_color);
57-
font-weight: normal;
58-
}
36+
._1bb324526a52affb-groupHeader {
37+
padding: 0;
5938

60-
._56fec8e8b8048fe0-displayedNick {
61-
font-weight: normal;
62-
margin: 0 var(--spacing);
39+
& > [data-text-variant] {
40+
@include popover.title;
6341
}
42+
}
6443

65-
._56fec8e8b8048fe0-displayUsername {
66-
font-weight: normal;
67-
}
44+
._1bb324526a52affb-groupWrapper {
45+
gap: 0;
6846

69-
._56fec8e8b8048fe0-filter {
70-
font-weight: normal;
71-
}
47+
position: relative;
48+
}
7249

73-
._56fec8e8b8048fe0-searchResultChannelCategory {
74-
@extend %text-normal;
50+
._1bb324526a52affb-item {
51+
padding: 0;
7552

76-
opacity: 1;
77-
text-transform: unset;
78-
margin-left: var(--spacing);
53+
flex-grow: 1;
7954

80-
top: 0;
55+
& > div > [data-text-variant="text-sm/medium"]:first-child,
56+
[data-text-variant="text-sm/semibold"] {
57+
color: var(--popover_fg_color);
8158
}
59+
}
8260

83-
._56fec8e8b8048fe0-searchResultChannelIcon {
84-
@include util.icon("lang-include");
61+
._1bb324526a52affb-itemContainer {
62+
@include popover.entry($hover: ":is(:hover, [aria-selected='true'])");
8563

86-
opacity: 1;
64+
display: flex;
65+
align-items: center;
66+
}
8767

88-
position: absolute;
89-
// Make it centered with avatars
90-
left: calc(
91-
var(--menu_padding) + (popover.$icon-size - var(--icon-size)) / 2
92-
);
68+
._1bb324526a52affb-itemIcon {
69+
color: var(--popover_fg_color);
70+
margin-inline-end: var(--spacing);
9371

94-
path {
95-
display: none;
96-
}
72+
// avatars don't work
73+
&:where(svg) {
74+
width: var(--icon-size);
75+
height: var(--icon-size);
9776
}
9877
}
9978

100-
._56fec8e8b8048fe0-plusIcon,
101-
._55c999adcf6db265-queryContainer,
102-
._56fec8e8b8048fe0-searchLearnMore {
103-
display: none;
104-
}
79+
._1bb324526a52affb-labelWithElements {
80+
gap: var(--spacing);
10581

106-
._56fec8e8b8048fe0-resultsGroup {
107-
padding: 0;
108-
margin: 0;
82+
flex-grow: 1;
10983

110-
&::before {
111-
top: calc(var(--spacing) * -1);
112-
113-
margin: 0;
84+
& > * {
85+
overflow: hidden;
86+
white-space: nowrap;
87+
text-overflow: ellipsis;
88+
width: 50%;
11489
}
115-
}
116-
117-
._56fec8e8b8048fe0-searchClearHistory {
118-
@include controls.icon-button("user-trash", "32px");
119-
120-
border-radius: 999px;
12190

122-
position: absolute;
123-
top: -4px;
124-
right: 0;
91+
// revert [data-text-variant^="text-sm"]
92+
& > :first-child {
93+
color: var(--popover_fg_color);
94+
}
12595
}

0 commit comments

Comments
 (0)