Skip to content

Commit 6c45bce

Browse files
committed
refactor(devtools): update SERP snippet styles and structure
This commit refactors the SERP snippet styles by renaming the `serpSnippetUrlRow` to `serpSnippetTopRow` and introduces new styles for site name and URL. The structure of the SERP preview is enhanced to better organize the display of site information, improving the overall layout and visual consistency.
1 parent 98fa3c9 commit 6c45bce

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

packages/devtools/src/styles/use-styles.ts

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,21 +239,37 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
239239
max-width: 600px;
240240
font-family: ${fontFamily.sans};
241241
`,
242-
serpSnippetUrlRow: css`
242+
serpSnippetTopRow: css`
243243
display: flex;
244244
align-items: center;
245-
gap: 6px;
246-
margin-bottom: 4px;
247-
font-size: 0.875rem;
248-
color: ${t(colors.gray[600], colors.gray[400])};
245+
gap: 12px;
246+
margin-bottom: 8px;
249247
`,
250248
serpSnippetFavicon: css`
251-
width: 16px;
252-
height: 16px;
253-
border-radius: 2px;
249+
width: 28px;
250+
height: 28px;
251+
border-radius: 50%;
254252
flex-shrink: 0;
255253
object-fit: contain;
256254
`,
255+
serpSnippetSiteColumn: css`
256+
display: flex;
257+
flex-direction: column;
258+
gap: 0;
259+
min-width: 0;
260+
`,
261+
serpSnippetSiteName: css`
262+
font-size: 0.875rem;
263+
color: ${t(colors.gray[900], colors.gray[100])};
264+
line-height: 1.4;
265+
margin: 0;
266+
`,
267+
serpSnippetSiteUrl: css`
268+
font-size: 0.75rem;
269+
color: ${t(colors.gray[500], colors.gray[500])};
270+
line-height: 1.4;
271+
margin: 0;
272+
`,
257273
serpSnippetTitle: css`
258274
font-size: 1.25rem;
259275
font-weight: 400;

packages/devtools/src/tabs/seo-tab/serp-preview.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,20 @@ export function SerpPreviewSection() {
6565
results. Data is read from the current page.
6666
</SectionDescription>
6767
<div class={styles().serpSnippet}>
68-
<div class={styles().serpSnippetUrlRow}>
68+
<div class={styles().serpSnippetTopRow}>
6969
{data.favicon ? (
7070
<img
7171
src={data.favicon}
7272
alt=""
7373
class={styles().serpSnippetFavicon}
7474
/>
7575
) : null}
76-
<span>{data.siteName || data.url}</span>
76+
<div class={styles().serpSnippetSiteColumn}>
77+
<span class={styles().serpSnippetSiteName}>
78+
{data.siteName || data.url}
79+
</span>
80+
<span class={styles().serpSnippetSiteUrl}>{data.url}</span>
81+
</div>
7782
</div>
7883
<div class={styles().serpSnippetTitle}>
7984
{data.title || 'No title'}

0 commit comments

Comments
 (0)