Skip to content
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

Feature/docs #60

Merged
merged 23 commits into from
Feb 8, 2024
Merged
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
51 changes: 51 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: docs

on:
push:
branches:
- main
paths:
- "packages/docs/**"
- ".github/workflows/docs.yml"

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install
working-directory: ./packages/docs
run: pnpm install
- name: Build docs
working-directory: ./packages/docs
run: pnpm build
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/docs/docs/dist
Mad-Kat marked this conversation as resolved.
Show resolved Hide resolved
cname: yak.js.org
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.next
node_modules
node_modules
packages/docs/docs/dist
5 changes: 5 additions & 0 deletions packages/docs/docs/pages/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Examples

## [Showcase](https://github.com/jantimon/next-yak/tree/main/packages/example)

Small showcase of next-yak in action with all the features.
51 changes: 51 additions & 0 deletions packages/docs/docs/pages/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# FAQ

## Is next-yak production ready?

`next-yak` is still experimental but we are working hard to release a stable 1.0 version

## Can I use next-yak with other frameworks than next.js?

Not by now - feel free to ask for adding support for your framework in our github issue tracker and we will give it a thought.

## Can I mix/combine next-yak with other CSS-in-JS libraries?

Yes, you can use next-yak with other CSS-in-JS libraries. You can use it with styled-components, emotion, or any other library that
adds css classes to your components.

## Can I reference a component in another component?

Yes, you can reference it in the tagged template literal.
```jsx
import { styled } from 'next-yak';

const Button = styled.button`
background: #BF4F74;
`;

const Nav = styled.nav`
background: #BF4F74;
${Button} {
color: white;
}
`;
```

:::info

This doesn't work for components outside of the current file, as next-yak only considers one file at a time.

:::

## Why does next-yak always generate CSS variables when the values are static references that are known at build time?

It's very hard to determine if a value is static or dynamic. We decided to always generate CSS variables to be on the safe side
and add errors if we detect that a value is static but a CSS variable is used.

## Can I use next-yak with TypeScript?

Yes, of course. `next-yak` is fully type safe.

## Can I contribute to next-yak?

Yes, of course. We are happy about every contribution. Just write an issue or a pull request [here](https://github.com/jantimon/next-yak)
Loading
Loading