Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/.vitepress/component-navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const navigation: SidebarItem[] = [
{text: 'Link', link: '/components/link', image: '/assets/components/link.svg'},
{text: 'Pressable', link: '/components/pressable'},
{text: 'Root', link: '/components/root'},
{text: 'Text', link: '/components/text'}
{text: 'Text', link: '/components/text'},
{text: 'Typography', link: '/components/typography'}
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/FluxView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
line-height: 1.6;
}

:global(p) {
:global(p:not(:where([data-flux-typography] *))) {
margin: unset;
line-height: 1.6;
}
Expand Down
44 changes: 22 additions & 22 deletions docs/.vitepress/theme/override/vp-doc.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
outline: none;
}

.vp-doc h1 {
.vp-doc h1:not(:where([data-flux-typography] *)) {
letter-spacing: -0.02em;
line-height: 40px;
font-size: 28px;
}

.vp-doc h2 {
.vp-doc h2:not(:where([data-flux-typography] *)) {
margin: 48px 0 16px;
border-top: 1px solid var(--vp-c-divider);
padding-top: 24px;
Expand All @@ -28,14 +28,14 @@
font-size: 24px;
}

.vp-doc h3 {
.vp-doc h3:not(:where([data-flux-typography] *)) {
margin: 32px 0 0;
letter-spacing: -0.01em;
line-height: 28px;
font-size: 20px;
}

.vp-doc h4 {
.vp-doc h4:not(:where([data-flux-typography] *)) {
margin: 24px 0 0;
letter-spacing: -0.01em;
line-height: 24px;
Expand Down Expand Up @@ -76,7 +76,7 @@
}

@media (min-width: 768px) {
.vp-doc h1 {
.vp-doc h1:not(:where([data-flux-typography] *)) {
letter-spacing: -0.02em;
line-height: 40px;
font-size: 32px;
Expand All @@ -91,24 +91,24 @@
* Paragraph and inline elements
* -------------------------------------------------------------------------- */

.vp-doc p,
.vp-doc summary {
.vp-doc p:not(:where([data-flux-typography] *)),
.vp-doc summary:not(:where([data-flux-typography] *)) {
margin: 16px 0;
}

.vp-doc p {
.vp-doc p:not(:where([data-flux-typography] *)) {
line-height: 28px;
}

.vp-doc blockquote {
.vp-doc blockquote:not(:where([data-flux-typography] *)) {
margin: 16px 0;
border-left: 2px solid var(--vp-c-divider);
padding-left: 16px;
transition: border-color 0.5s;
color: var(--vp-c-text-2);
}

.vp-doc blockquote > p {
.vp-doc blockquote:not(:where([data-flux-typography] *)) > p {
margin: 0;
font-size: 16px;
transition: color 0.5s;
Expand Down Expand Up @@ -136,34 +136,34 @@
* Lists
* -------------------------------------------------------------------------- */

.vp-doc ul,
.vp-doc ol {
.vp-doc ul:not(:where([data-flux-typography] *)),
.vp-doc ol:not(:where([data-flux-typography] *)) {
padding-left: 1.25rem;
margin: 16px 0;
}

.vp-doc ul {
.vp-doc ul:not(:where([data-flux-typography] *)) {
list-style: disc;
}

.vp-doc ol {
.vp-doc ol:not(:where([data-flux-typography] *)) {
list-style: decimal;
}

.vp-doc li + li {
.vp-doc li:not(:where([data-flux-typography] *)) + li {
margin-top: 8px;
}

.vp-doc li > ol,
.vp-doc li > ul {
.vp-doc li:not(:where([data-flux-typography] *)) > ol,
.vp-doc li:not(:where([data-flux-typography] *)) > ul {
margin: 8px 0 0;
}

/**
* Decorational elements
* -------------------------------------------------------------------------- */

.vp-doc hr:not(:only-child) {
.vp-doc hr:not(:only-child):not(:where([data-flux-typography] *)) {
margin: 16px 0;
border: none;
border-top: 1px solid var(--vp-c-divider);
Expand Down Expand Up @@ -206,12 +206,12 @@
* -------------------------------------------------------------------------- */

/* inline code */
.vp-doc :not(pre, h1, h2, h3, h4, h5, h6) > code {
.vp-doc :not(pre, h1, h2, h3, h4, h5, h6):not(:where([data-flux-typography] *)) > code {
font-size: var(--vp-code-font-size);
color: var(--vp-code-color);
}

.vp-doc :not(pre) > code {
.vp-doc :not(pre):not(:where([data-flux-typography] *)) > code {
border-radius: 4px;
padding: 3px 6px;
background-color: var(--vp-code-bg);
Expand Down Expand Up @@ -283,7 +283,7 @@
hyphens: none;
}

.vp-doc [class*='language-'] pre {
.vp-doc [class*='language-'] pre:not(:where([data-flux-typography] *)) {
position: relative;
z-index: 1;
margin: 0;
Expand All @@ -292,7 +292,7 @@
overflow-x: auto;
}

.vp-doc [class*='language-'] code {
.vp-doc [class*='language-'] code:not(:where([data-flux-typography] *)) {
display: block;
padding: 0 24px;
width: fit-content;
Expand Down
6 changes: 3 additions & 3 deletions docs/.vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ button {
padding: 18px;
}

.vp-adaptive-theme p {
.vp-adaptive-theme p:not(:where([data-flux-typography] *)) {
margin: unset;
}

Expand Down Expand Up @@ -101,12 +101,12 @@ button {
z-index: 0;
}

.vp-code-group .blocks :where(h1, h2, h3, h4, h5, h6) {
.vp-code-group .blocks :where(h1, h2, h3, h4, h5, h6):not(:where([data-flux-typography] *)) {
margin: unset;
line-height: 1.6;
}

.vp-code-group .blocks p {
.vp-code-group .blocks p:not(:where([data-flux-typography] *)) {
margin: unset;
line-height: 1.6;
}
Expand Down
14 changes: 8 additions & 6 deletions docs/code/components/flyout/preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
<template #default="{ close }">
<FluxPane style="max-width: 420px">
<FluxPaneBody>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A asperiores cum debitis dolor, explicabo facere illo ipsa iste labore, maiores molestias odit optio qui quo reprehenderit ut veniam veritatis. Saepe.</p>
<FluxTypography>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A asperiores cum debitis dolor, explicabo facere illo ipsa iste labore, maiores molestias odit optio qui quo reprehenderit ut veniam veritatis. Saepe.</p>

<FluxSecondaryButton
data-typography-aware
label="Close"
@click="close()"/>
<FluxSecondaryButton
data-typography-aware
label="Close"
@click="close()"/>
</FluxTypography>
</FluxPaneBody>
</FluxPane>
</template>
Expand All @@ -27,5 +29,5 @@
<script
lang="ts"
setup>
import { FluxFlyout, FluxPane, FluxPaneBody, FluxSecondaryButton } from '@flux-ui/components';
import { FluxFlyout, FluxPane, FluxPaneBody, FluxSecondaryButton, FluxTypography } from '@flux-ui/components';
</script>
91 changes: 91 additions & 0 deletions docs/code/components/typography/article.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<template>
<FluxTypography tag="article">
<h1>Designing with type</h1>
<p>Typography is the craft of arranging text so it is <a href="#">legible, readable and appealing</a> when displayed. Good type sets a rhythm the reader can follow without conscious effort, and it is the single biggest lever you have over how <strong>trustworthy</strong> an interface feels.</p>

<h2>The vertical rhythm</h2>
<p>Every block of content, whether a paragraph, a list, an image or a table, sits on a consistent baseline. Spacing scales with the weight of the element: a new section gets more room above it than the next paragraph does.</p>

<blockquote>Typography is the detail and the presentation of a story. It represents the voice of an atmosphere, or a historical setting of some kind.</blockquote>

<h3>Working with lists</h3>
<p>Lists break dense information into scannable chunks. Reach for an unordered list when order does not matter:</p>
<ul>
<li>Keep the measure between 45 and 75 characters.
<ul>
<li>Narrower for captions.</li>
<li>Wider for long form reading.</li>
</ul>
</li>
<li>Set a generous line height for body copy.</li>
<li>Limit the number of distinct type sizes.</li>
</ul>

<p>Use an ordered list when the sequence itself is the point:</p>
<ol>
<li>Establish a base font size.</li>
<li>Derive a modular scale from it.</li>
<li>Assign each level a single, clear role.</li>
</ol>

<h3>Code and keys</h3>
<p>Wrap identifiers such as <code>--font-sans</code> in inline code, and show a full snippet in a block:</p>
<pre><code>:root {
--font-sans: inter-variable, sans-serif;
}</code></pre>
<p>Document shortcuts with the keyboard element: press <kbd>Cmd</kbd> + <kbd>B</kbd> to toggle bold.</p>

<FluxTypographyReset>
<FluxPane>
<FluxPaneHeader
icon="circle-info"
subtitle="Rendered inside FluxTypographyReset"
title="Embedded component"/>
<FluxPaneBody>
This pane keeps its own styling. Typography Reset stops the prose rules from reaching in, yet the block still flows in the article rhythm just like a paragraph or a heading.
</FluxPaneBody>
</FluxPane>
</FluxTypographyReset>

<h2>A quick reference</h2>
<p>The scale below summarises the default roles.</p>
<table>
<thead>
<tr>
<th>Element</th>
<th>Size</th>
<th>Role</th>
</tr>
</thead>
<tbody>
<tr>
<td>Heading 1</td>
<td>27px</td>
<td>Page title</td>
</tr>
<tr>
<td>Heading 2</td>
<td>21px</td>
<td>Section heading</td>
</tr>
<tr>
<td>Body</td>
<td>15px</td>
<td>Paragraphs and lists</td>
</tr>
</tbody>
</table>

<hr/>

<p>Finally, imagery breaks up long stretches of text and gives the eye a place to rest.</p>
<img src="https://images.pexels.com/photos/33688/delicate-arch-night-stars-landscape.jpg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2"
alt=""/>
Comment thread
basmilius marked this conversation as resolved.
</FluxTypography>
</template>

<script
lang="ts"
setup>
import { FluxPane, FluxPaneBody, FluxPaneHeader, FluxTypography, FluxTypographyReset } from '@flux-ui/components';
</script>
12 changes: 12 additions & 0 deletions docs/code/components/typography/blockquote.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template>
<FluxTypography>
<p>As Robert Bringhurst reminds us in his classic manual:</p>
<blockquote>Typography exists to honor content. Its purpose is to serve the reader, not to draw attention to itself.</blockquote>
</FluxTypography>
</template>

<script
lang="ts"
setup>
import { FluxTypography } from '@flux-ui/components';
</script>
15 changes: 15 additions & 0 deletions docs/code/components/typography/code.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<FluxTypography>
<p>Install the package with your favourite manager, then import <code>FluxTypography</code> where you need it.</p>
<pre><code>import { FluxTypography } from '@flux-ui/components';

const article = FluxTypography;</code></pre>
<p>Press <kbd>Cmd</kbd> + <kbd>K</kbd> to open the command palette.</p>
</FluxTypography>
</template>

<script
lang="ts"
setup>
import { FluxTypography } from '@flux-ui/components';
</script>
16 changes: 16 additions & 0 deletions docs/code/components/typography/headings.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template>
<FluxTypography>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
</FluxTypography>
</template>

<script
lang="ts"
setup>
import { FluxTypography } from '@flux-ui/components';
</script>
28 changes: 28 additions & 0 deletions docs/code/components/typography/lists.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<FluxTypography>
<h3>Unordered list</h3>
<ul>
<li>Espresso, the concentrated base for most drinks.
<ul>
<li>Ristretto</li>
<li>Lungo</li>
</ul>
</li>
<li>Filter, brewed slowly for a lighter body.</li>
<li>Cold brew, steeped for many hours.</li>
</ul>

<h3>Ordered list</h3>
<ol>
<li>Grind the beans just before brewing.</li>
<li>Rinse the filter and preheat the cup.</li>
<li>Pour in slow, steady circles.</li>
</ol>
</FluxTypography>
</template>

<script
lang="ts"
setup>
import { FluxTypography } from '@flux-ui/components';
</script>
13 changes: 13 additions & 0 deletions docs/code/components/typography/paragraph.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<FluxTypography>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A adipisci aut ex excepturi expedita pariatur perspiciatis! Amet aperiam aut commodi fugit harum, id, incidunt necessitatibus, nemo nisi placeat voluptatem voluptatum!</p>
<p>Aspernatur commodi cum debitis doloremque, ea et harum hic illum natus nulla quam quisquam rem rerum similique tempora totam ullam vel. Accusamus consequuntur dicta facilis labore modi mollitia, perspiciatis voluptate?</p>
<p>Assumenda beatae commodi dolor dolore eum ex, excepturi fugiat id, inventore iure maiores maxime minima nesciunt nostrum, quidem sed sequi soluta tempora ullam voluptatem? Atque consequatur non omnis perferendis suscipit.</p>
</FluxTypography>
</template>

<script
lang="ts"
setup>
import { FluxTypography } from '@flux-ui/components';
</script>
Loading
Loading