-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(typography): add FluxTypography prose component #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
basmilius
wants to merge
2
commits into
main
Choose a base branch
from
feat/typography
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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=""/> | ||
| </FluxTypography> | ||
| </template> | ||
|
|
||
| <script | ||
| lang="ts" | ||
| setup> | ||
| import { FluxPane, FluxPaneBody, FluxPaneHeader, FluxTypography, FluxTypographyReset } from '@flux-ui/components'; | ||
| </script> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.