Skip to content

Commit 3479527

Browse files
authored
Merge pull request #2658 from appwrite/feat-mobile-responsiveness-cpmd
fix: make the cpmd feature responsive for mobile devices
2 parents a1dd103 + af4becb commit 3479527

File tree

1 file changed

+39
-10
lines changed

1 file changed

+39
-10
lines changed

src/lib/layouts/DocsArticle.svelte

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@
4343
<article class="web-article contents">
4444
<header class="web-article-header flex items-start justify-between">
4545
<div class="web-article-header-start web-u-cross-start flex flex-col">
46-
{#if back}
47-
<a
48-
href={back}
49-
class="web-icon-button web-is-only-mobile"
50-
aria-label="previous page"
51-
>
52-
<span class="icon-cheveron-left" aria-hidden="true"></span>
53-
</a>
54-
{/if}
46+
<div class="mobile-header-row mb-2 flex w-full items-center lg:hidden">
47+
{#if back}
48+
<a href={back} class="web-icon-button" aria-label="previous page">
49+
<span class="web-icon-chevron-left" aria-hidden="true"></span>
50+
</a>
51+
{/if}
52+
<div class="copy-button-wrapper-mobile ml-auto">
53+
<CopyAsMarkdown class="ml-0" />
54+
</div>
55+
</div>
5556
<ul class="web-metadata text-caption">
5657
<slot name="metadata" />
5758
</ul>
@@ -74,7 +75,7 @@
7475
<h1 class="text-title font-aeonik-pro text-primary">{title}</h1>
7576
</div>
7677
</div>
77-
<div class="web-article-header-end self-start md:self-auto">
78+
<div class="web-article-header-end copy-button-wrapper hidden lg:block">
7879
<CopyAsMarkdown class="ml-0" />
7980
</div>
8081
</header>
@@ -100,4 +101,32 @@
100101
max-inline-size: 40.5rem;
101102
}
102103
}
104+
105+
/* Mobile header row with back button and copy button */
106+
@media (max-width: 1023.9px) {
107+
.mobile-header-row {
108+
align-items: center;
109+
width: 100vw;
110+
position: relative;
111+
margin-left: calc(-1 * var(--p-grid-huge-navs-padding-inline, 1.25rem));
112+
margin-right: calc(-1 * var(--p-grid-huge-navs-padding-inline, 1.25rem));
113+
padding-left: var(--p-grid-huge-navs-padding-inline, 1.25rem);
114+
padding-right: var(--p-grid-huge-navs-padding-inline, 1.25rem);
115+
}
116+
117+
.copy-button-wrapper-mobile {
118+
display: flex;
119+
align-items: center;
120+
margin-left: auto;
121+
margin-right: 0;
122+
}
123+
}
124+
125+
/* Desktop copy button wrapper */
126+
@media (min-width: 1024px) {
127+
.copy-button-wrapper {
128+
align-self: center;
129+
width: auto;
130+
}
131+
}
103132
</style>

0 commit comments

Comments
 (0)