-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from lunatic-fox/docs
Patch 16
- Loading branch information
Showing
18 changed files
with
293 additions
and
89 deletions.
There are no files selected for viewing
This file contains 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 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 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,24 @@ | ||
.tableWrapper { | ||
margin: 5px; | ||
border-radius: 5px; | ||
background: var(--code-background); | ||
} | ||
|
||
.table { | ||
width: 100%; | ||
display: table; | ||
font-family: 'Fira Mono', monospace; | ||
font-size: .9rem; | ||
} | ||
|
||
.tr { display: flex } | ||
|
||
.th, .td, .tdNone { | ||
width: 100%; | ||
text-align: left; | ||
padding: 5px 15px; | ||
} | ||
|
||
.td { border-top: 1px solid var(--g4d) } | ||
.tdNone { border-top: none } | ||
.th { font-weight: 700 } |
This file contains 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,20 @@ | ||
import styles from './index.module.css' | ||
|
||
export default function Table({ header, rows }: { | ||
header: string[] | ||
rows: string[][] | ||
}) { | ||
return ( | ||
<section className={styles.tableWrapper}> | ||
<section className={styles.table}> | ||
<div className={styles.tr}>{ | ||
header.map(e => <div className={styles.th}>{e}</div>) | ||
}</div> | ||
{rows.map(e => <div className={styles.tr}>{e.map(f => | ||
f.match(/^\^.*?|^$/) ? <div className={styles.tdNone}>{f.slice(1)}</div> | ||
: <div className={styles.td}>{f}</div>)}</div> | ||
)} | ||
</section> | ||
</section> | ||
) | ||
} |
This file contains 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 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 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 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,61 @@ | ||
import Code from '@/app/components/Code' | ||
import Table from '@/app/components/Table' | ||
import Docs from '@/app/docs/components/Docs' | ||
import ReqResExample from '@/app/docs/components/ReqResExample' | ||
|
||
export default function Page() { | ||
return ( | ||
<Docs title='Getting icons: More examples'> | ||
<p> | ||
This is a example of getting a icon using its alternative name, in this case, using <Code ic='x'/> instead of <Code ic='twitter'/>. Also using more parameters: <Code ic='release'/>, <Code ic='size'/> and <Code ic='color'/>. | ||
</p> | ||
<Code c={`GET /api?{iconName}&r={release}&s={size}&c={color}`} /><Code></Code> | ||
<h4>Example</h4> | ||
<Table header={['Parameter', 'Value']} rows={[ | ||
['iconName', 'x'], | ||
['release | r', 'dev'], | ||
['size | s', '96'], | ||
['color | c', 'green'], | ||
]}/> | ||
<ReqResExample reqs={['x&r=dev&s=96&c=green']} title={false}/> | ||
|
||
<hr /> | ||
|
||
<p> | ||
In these next examples let's use the <Code ic='theme'/> parameter. | ||
</p> | ||
<Code c={`GET /api?{iconName}&r={release}&s={size}&t={theme}`} /><Code></Code> | ||
<h4>Examples</h4> | ||
<Table header={['Parameter', 'Value']} rows={[ | ||
['iconName', 'github'], | ||
['release | r', '2.10'], | ||
['size | s', '64'], | ||
['theme | t', 'light'], | ||
]}/> | ||
<ReqResExample reqs={['github&r=2.10&s=64&t=light']} title={false}/> | ||
<hr /> | ||
<Table header={['Parameter', 'Value']} rows={[ | ||
['iconName', 'github'], | ||
['release | r', '2.10'], | ||
['size | s', '64'], | ||
['theme | t', 'dark'], | ||
]}/> | ||
<ReqResExample reqs={['github&r=2.10&s=64&t=dark']} title={false}/> | ||
<hr /> | ||
|
||
<p> | ||
This example shows <Code ic='theme'/> parameter priority over <Code ic='color'/>. | ||
</p> | ||
<Code c={`GET /api?{iconName}&r={release}&s={size}&t={theme}&c={color}`} /><Code></Code> | ||
<h4>Example</h4> | ||
<Table header={['Parameter', 'Value']} rows={[ | ||
['iconName', 'github'], | ||
['release | r', '2.10'], | ||
['size | s', '72'], | ||
['theme | t', 'light'], | ||
['color | c', 'ff00ff'] | ||
]}/> | ||
<ReqResExample reqs={['gitlab&r=2.10&s=72&t=dark&c=ff00ff']} title={false}/> | ||
</Docs> | ||
) | ||
} |
This file contains 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 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 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 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
Oops, something went wrong.