Skip to content

Commit

Permalink
docs: make documentation mobile-friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Aug 11, 2024
1 parent 6d6c82c commit a282d47
Show file tree
Hide file tree
Showing 16 changed files with 88 additions and 93 deletions.
10 changes: 8 additions & 2 deletions docs/blocks/demo/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
display: grid;
grid-template-columns: 1fr;
gap: var(--space-xl);
container-type: inline-size;

@container (inline-size >= 980px) {
grid-template-columns: 1fr 460px;
Expand All @@ -24,9 +25,14 @@

.selection {
display: grid;
grid-template-columns: minmax(auto, 400px) auto;
gap: var(--space-m);
grid-template-columns: 1fr;
gap: var(--space-xl);
align-items: end;

@container (inline-size >= 560px) {
grid-template-columns: minmax(auto, 400px) auto;
gap: var(--space-m);
}
}

.code-example {
Expand Down
5 changes: 0 additions & 5 deletions docs/blocks/footer/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
padding-block: var(--space-xl) calc(var(--space-l) * 2);
background: var(--color-background-primary);
}

.container {
display: flex;
justify-content: space-between;
}
16 changes: 6 additions & 10 deletions docs/blocks/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@ import { component$ } from '@builder.io/qwik'

import { Typography } from '../../elements/typography'
import { Container } from '../../elements/container'
import { Netlify } from '../../elements/netlify'
import styles from './index.module.css'

export let Footer = component$(() => (
<footer class={styles.footer}>
<Container class={styles.container}>
<div>
<Typography mbe="2xs" size="s">
Released under the MIT License
</Typography>
<Typography size="s">
Copyright © 2024 Azat S. & Contributors
</Typography>
</div>
<Netlify />
<Typography align="center" mbe="2xs" size="s">
Released under the MIT License
</Typography>
<Typography align="center" size="s">
Copyright © 2024 Azat S. & Contributors
</Typography>
</Container>
</footer>
))
8 changes: 7 additions & 1 deletion docs/blocks/header/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@

.buttons {
display: flex;
gap: var(--space-s);
flex-direction: column;
gap: var(--space-l);
align-items: center;
justify-content: center;
margin: var(--space-l) auto;

@container (inline-size >= 400px) {
flex-direction: row;
gap: var(--space-s);
}
}
29 changes: 22 additions & 7 deletions docs/blocks/icons/index.module.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
.icons {
padding-block: calc(var(--space-l) * 3);
background: var(--color-background-primary);
}

.container {
display: grid;
grid-template-columns: 5fr 7fr;
gap: var(--space-l);
container-type: inline-size;
}

.illustration {
display: flex;
align-items: center;
justify-content: end;
}

.container {
display: grid;
grid-template-columns: 1fr;
gap: var(--space-xl);

.illustration {
justify-content: start;
margin-block-start: var(--space-l);
}

@container (inline-size >= 768px) {
grid-template-columns: 5fr 7fr;
gap: var(--space-l);

.illustration {
justify-content: end;
margin-block-start: 0;
}
}
}
20 changes: 18 additions & 2 deletions docs/blocks/themes/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,27 @@
var(--color-background-primary) 85%,
var(--color-background-secondary)
);
container-type: inline-size;
}

.container {
display: grid;
grid-template-columns: 7fr 5fr;
gap: var(--space-l);
grid-template-columns: 1fr;
gap: var(--space-xl);
align-items: center;

.illustration {
order: 1;
margin-block-start: var(--space-l);
}

@container (inline-size >= 768px) {
grid-template-columns: 7fr 5fr;
gap: var(--space-l);

.illustration {
order: 0;
margin-block-start: 0;
}
}
}
2 changes: 1 addition & 1 deletion docs/blocks/themes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import styles from './index.module.css'
export let Themes = component$(() => (
<section class={styles.themes}>
<Container class={styles.container}>
<div>
<div class={styles.illustration}>
<IllustrationTheme />
</div>
<div>
Expand Down
1 change: 1 addition & 0 deletions docs/elements/illustration-icons/index.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.illustration {
max-inline-size: 100%;
block-size: 200px;
}
1 change: 1 addition & 0 deletions docs/elements/illustration-theme/index.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.illustration {
max-inline-size: 100%;
block-size: 260px;
padding-block-start: var(--space-l);
}
15 changes: 0 additions & 15 deletions docs/elements/netlify/index.module.css

This file was deleted.

41 changes: 0 additions & 41 deletions docs/elements/netlify/index.tsx

This file was deleted.

16 changes: 13 additions & 3 deletions docs/elements/theme-dropdown/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,31 @@
z-index: 1;
display: grid;
grid-template-rows: repeat(
round(up, calc(var(--total) / var(--columns))),
calc((var(--total) + var(--columns) - 1) / var(--columns)),
1fr
);
grid-template-columns: repeat(var(--columns), 1fr);
grid-auto-flow: column;
gap: var(--space-s) var(--space-xs);
inline-size: 540px;
inline-size: min(calc(100vi - var(--space-s) * 2), 540px);
max-block-size: 460px;
padding: var(--space-s) var(--space-xs);
overflow: scroll;
background: var(--color-background-primary);
border: 1px solid var(--color-border-secondary);
border-radius: var(--border-radius);
transform: scaleY(0);
transform-origin: top center;
animation: grow-down 250ms ease-in-out forwards;
--columns: 3;
--columns: 1;

@media (width >= 400px) {
--columns: 2;
}

@media (width >= 600px) {
--columns: 3;
}
}

.dropdown-item {
Expand Down
2 changes: 2 additions & 0 deletions docs/elements/theme-select/index.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.wrapper {
position: relative;
container-type: inline-size;
}

.input-wrapper {
Expand All @@ -11,6 +12,7 @@
inline-size: 100%;
padding: calc(var(--space-xs) / 2) var(--space-s);
color: var(--color-content-primary);
text-align: start;
background: var(--color-background-tertiary);
border: 1px solid var(--color-border-secondary);
border-radius: var(--border-radius);
Expand Down
9 changes: 5 additions & 4 deletions docs/elements/theme-select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ export let ThemeSelect = component$(() => {
<div class={styles.wrapper} ref={ref}>
<Label for="theme">Select Theme:</Label>
<div class={styles['input-wrapper']}>
<input
onFocus$={() => {
<button
onClick$={() => {
dropdownVisible.value = true
}}
value={getThemeNameById(theme.value)}
class={styles.input}
name="theme"
/>
>
{getThemeNameById(theme.value)}
</button>
<svg
xmlns="http://www.w3.org/2000/svg"
class={styles.icon}
Expand Down
4 changes: 3 additions & 1 deletion docs/styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ html {
}

body {
min-inline-size: 320px;
min-inline-size: 300px;
margin: 0;
color: var(--color-content-primary);
background: var(--color-background-primary);
Expand Down Expand Up @@ -63,7 +63,9 @@ code {
}

pre {
max-inline-size: calc(100vi - var(--space-s) * 2);
padding: var(--space-m) var(--space-s);
overflow: scroll;
overflow-inline: scroll;
border: 1px solid var(--color-border-primary);
border-radius: var(--border-radius);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
],
"scripts": {
"build": "vite build --config vite.config.extension.ts",
"docs:dev": "vite --open --mode ssr --config vite.config.docs.ts",
"docs:dev": "vite --open --host --mode ssr --config vite.config.docs.ts",
"docs:build": "pnpm run docs:clean && qwik build",
"docs:clean:dist": "node -e \"fs.rmSync('./docs/dist', { recursive: true, force: true })\"",
"docs:clean:server": "node -e \"fs.rmSync('./.netlify', { recursive: true, force: true })\"",
Expand Down

0 comments on commit a282d47

Please sign in to comment.