-
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 #38 from heyjul3s/docs/readme-updates
Docs/readme updates
- Loading branch information
Showing
6 changed files
with
117 additions
and
22 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 |
---|---|---|
@@ -1,3 +1,39 @@ | ||
# `@artifak/fluidsizing` | ||
|
||
A utility function that computes a fluid sizing value based on the min and max values provided. Refer to the **Artifak Fluid Sizing[Artifak](https://artifak.dev/docs?content=fluidsizing)** for more information. | ||
A utility function that computes a fluid sizing value based on the min and max values provided. | ||
|
||
## Installation | ||
|
||
### Yarn | ||
|
||
```sh | ||
yarn add @artifak/fluidsizing | ||
``` | ||
|
||
### NPM | ||
|
||
```sh | ||
npm install @artifak/fluidsizing | ||
``` | ||
|
||
## Usage | ||
|
||
Below are the parameters and the following an example of usage. | ||
|
||
| Arguments | Type | | ||
| ---------------- | ------ | | ||
| minElementSize | number | | ||
| maxElementSize | number | | ||
| minViewportWidth | number | | ||
| maxViewportWidth | number | | ||
|
||
```ts | ||
import { fluidSizing } from '@artifak/fluidsizing'; | ||
import styled from 'styled-components'; | ||
|
||
const Paragraph = styled.p` | ||
font-size: ${fluidSizing(16, 96, 300, 1200)}; | ||
line-height: ${fluidSizing(1.4, 1.6, 300, 1200)}; | ||
padding-bottom: ${fluidSizing(10, 15, 300, 1200)}; | ||
`; | ||
``` |
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 |
---|---|---|
@@ -1,3 +1,36 @@ | ||
# `@artifak/usematchmedia` | ||
|
||
A React hook that allows you to perform media queries within your React component. Refer to the **Artifak Fluid Sizing[Artifak](https://artifak.dev/docs?content=usematchmedia)** for more information. | ||
A React hook that allows you to perform media queries within your React component. | ||
|
||
## Installation | ||
|
||
### Yarn | ||
|
||
```sh | ||
yarn add @artifak/usematchmedia | ||
``` | ||
|
||
### NPM | ||
|
||
```sh | ||
npm install @artifak/usematchmedia | ||
``` | ||
|
||
## Usage | ||
|
||
```ts | ||
import { useMatchMedia } from 'artifak'; | ||
import { ExampleMobile } from './ExampleMobile'; | ||
import { ExampleDesktop } from './ExampleDesktop'; | ||
|
||
export function Nav() { | ||
const matchedMobile = useMatchMedia('(hover: none)'); | ||
|
||
return ( | ||
<> | ||
{matchedMobile && <ExampleMobile />} | ||
{!matchedMobile && <ExampleDesktop />} | ||
</> | ||
); | ||
} | ||
``` |
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 |
---|---|---|
@@ -1,3 +1,36 @@ | ||
# `@artifak/usewindowsize` | ||
|
||
A React hook that allows you to get the window dimensions within your React component. Refer to the **Artifak Fluid Sizing[Artifak](https://artifak.dev/docs?content=usewindowsize)** for more information. | ||
A React hook that allows you to get the window dimensions within your React component. Returns an object consisting of properties: innerWidth, innerHeight, outerWidth and outerHeight. | ||
|
||
## Installation | ||
|
||
### Yarn | ||
|
||
```sh | ||
yarn add @artifak/usewindowsize | ||
``` | ||
|
||
### NPM | ||
|
||
```sh | ||
npm install @artifak/usewindowsize | ||
``` | ||
|
||
## Usage | ||
|
||
```ts | ||
import { useWindowSize } from 'artifak'; | ||
import { ExampleMobile } from './ExampleMobile'; | ||
import { ExampleDesktop } from './ExampleDesktop'; | ||
|
||
export function Nav() { | ||
const windowSize = useWindowSize(); | ||
|
||
return ( | ||
<> | ||
{windowSize.innerWidth < 1000 && <ExampleMobile />} | ||
<ExampleDesktop /> | ||
</> | ||
); | ||
} | ||
``` |