Skip to content

Commit 56486c0

Browse files
committed
few more styling updates
1 parent 86ad8f2 commit 56486c0

File tree

6 files changed

+98
-69
lines changed

6 files changed

+98
-69
lines changed

packages/browser-sdk/src/toolbar/Features.css

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
.search-input {
2-
background: transparent;
3-
border: none;
4-
border-bottom: 1px solid var(--border-color);
5-
color: white;
6-
padding: 0 0 6px 0;
7-
margin-bottom: 4px;
8-
width: 100%;
9-
}
10-
111
.features-table {
122
width: 100%;
133
border-collapse: collapse;
@@ -21,31 +11,43 @@
2111
color: var(--brand300);
2212
}
2313

24-
input[type="search"]::-webkit-search-cancel-button {
25-
-webkit-appearance: none;
26-
display: inline-block;
27-
width: 8px;
28-
height: 8px;
29-
margin-left: 10px;
30-
background: linear-gradient(
31-
45deg,
32-
rgba(0, 0, 0, 0) 0%,
33-
rgba(0, 0, 0, 0) 43%,
34-
#fff 45%,
35-
#fff 55%,
36-
rgba(0, 0, 0, 0) 57%,
37-
rgba(0, 0, 0, 0) 100%
38-
),
39-
linear-gradient(
40-
135deg,
41-
transparent 0%,
42-
transparent 43%,
43-
#fff 45%,
44-
#fff 55%,
45-
transparent 57%,
46-
transparent 100%
47-
);
48-
cursor: pointer;
14+
.search-input {
15+
background: transparent;
16+
border: none;
17+
color: white;
18+
width: 100%;
19+
font-size: 12px;
20+
21+
&::placeholder {
22+
color: var(--gray500);
23+
}
24+
25+
&::-webkit-search-cancel-button {
26+
-webkit-appearance: none;
27+
display: inline-block;
28+
width: 8px;
29+
height: 8px;
30+
margin-left: 10px;
31+
background: linear-gradient(
32+
45deg,
33+
rgba(0, 0, 0, 0) 0%,
34+
rgba(0, 0, 0, 0) 43%,
35+
#fff 45%,
36+
#fff 55%,
37+
rgba(0, 0, 0, 0) 57%,
38+
rgba(0, 0, 0, 0) 100%
39+
),
40+
linear-gradient(
41+
135deg,
42+
transparent 0%,
43+
transparent 43%,
44+
#fff 45%,
45+
#fff 55%,
46+
transparent 57%,
47+
transparent 100%
48+
);
49+
cursor: pointer;
50+
}
4951
}
5052

5153
.feature-name-cell {

packages/browser-sdk/src/toolbar/Features.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function FeatureSearch({
8383
return (
8484
<input
8585
type="search"
86-
placeholder="Search"
86+
placeholder="Search features"
8787
onInput={(s) => onSearch(s.currentTarget.value)}
8888
autoFocus
8989
class="search-input"

packages/browser-sdk/src/toolbar/Toolbar.css

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
border-radius: 7px;
9191
z-index: 999999;
9292
min-width: 200px;
93+
padding: 0;
9394
}
9495

9596
.toolbar-toggle {
@@ -116,27 +117,29 @@
116117
align-items: center;
117118

118119
animation: bounceInUp 1s ease-out;
119-
}
120120

121-
.toolbar-toggle.open {
122-
color: var(--gray500);
123-
}
121+
transition: color 0.1s ease;
124122

125-
.toolbar-toggle .override-indicator {
126-
position: absolute;
127-
top: -3px;
128-
right: -3px;
129-
width: 8px;
130-
height: 8px;
131-
background-color: var(--brand400);
132-
border-radius: 50%;
133-
opacity: 0;
134-
transition: opacity 0.1s ease-in-out;
135-
border: 1px solid var(--brand300);
123+
&.open {
124+
color: var(--gray500);
125+
}
136126

137-
&.show {
138-
opacity: 1;
139-
animation: gelatine 0.5s;
127+
& .override-indicator {
128+
position: absolute;
129+
top: -3px;
130+
right: -3px;
131+
width: 8px;
132+
height: 8px;
133+
background-color: var(--brand400);
134+
border-radius: 50%;
135+
opacity: 0;
136+
transition: opacity 0.1s ease-in-out;
137+
border: 1px solid var(--brand300);
138+
139+
&.show {
140+
opacity: 1;
141+
animation: gelatine 0.5s;
142+
}
140143
}
141144
}
142145

packages/browser-sdk/src/toolbar/Toolbar.tsx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { useEffect, useMemo, useRef, useState } from "preact/hooks";
33

44
import { BucketClient } from "../client";
55
import { toolbarContainerId } from "../ui/constants";
6-
import { Dialog, useDialog } from "../ui/Dialog";
7-
import { Close } from "../ui/icons/Close";
6+
import { Dialog, DialogContent, DialogHeader, useDialog } from "../ui/Dialog";
87
import { Logo } from "../ui/icons/Logo";
98
import { Offset, Placement } from "../ui/types";
109
import { parseUnanchoredPosition } from "../ui/utils";
@@ -95,14 +94,18 @@ export default function Toolbar({
9594
}}
9695
close={close}
9796
>
98-
<FeatureSearch onSearch={onSearch} />
99-
<FeaturesTable
100-
features={searchedFeatures}
101-
setEnabledOverride={bucketClient.setFeatureOverride.bind(
102-
bucketClient,
103-
)}
104-
appBaseUrl={appBaseUrl}
105-
/>
97+
<DialogHeader>
98+
<FeatureSearch onSearch={onSearch} />
99+
</DialogHeader>
100+
<DialogContent>
101+
<FeaturesTable
102+
features={searchedFeatures}
103+
setEnabledOverride={bucketClient.setFeatureOverride.bind(
104+
bucketClient,
105+
)}
106+
appBaseUrl={appBaseUrl}
107+
/>
108+
</DialogContent>
106109
</Dialog>
107110
</div>
108111
);
@@ -136,11 +139,7 @@ function ToolbarToggle({
136139
return (
137140
<div ref={innerRef} class={toggleClasses} onClick={onClick} style={offsets}>
138141
<div class={indicatorClasses}></div>
139-
{isOpen ? (
140-
<Close width="16" height="16" />
141-
) : (
142-
<Logo height="13px" width="13px" />
143-
)}
142+
<Logo height="13px" width="13px" />
144143
</div>
145144
);
146145
}

packages/browser-sdk/src/ui/Dialog.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,12 @@
9494
fade 300ms cubic-bezier(0.22, 1, 0.36, 1);
9595
}
9696
}
97+
98+
.dialog-header {
99+
border-bottom: 1px solid var(--border-color);
100+
padding: 7px 12px;
101+
}
102+
103+
.dialog-content {
104+
padding: 7px 12px;
105+
}

packages/browser-sdk/src/ui/Dialog.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,19 @@ export const Dialog: FunctionComponent<OpenDialogOptions> = ({
221221
</>
222222
);
223223
};
224+
225+
export function DialogHeader({
226+
children,
227+
}: {
228+
children: preact.ComponentChildren;
229+
}) {
230+
return <header class="dialog-header">{children}</header>;
231+
}
232+
233+
export function DialogContent({
234+
children,
235+
}: {
236+
children: preact.ComponentChildren;
237+
}) {
238+
return <div class="dialog-content">{children}</div>;
239+
}

0 commit comments

Comments
 (0)