Skip to content

Commit 9170756

Browse files
authored
Merge branch 'main' into joan/order-from-config
2 parents 84fbdcc + e188412 commit 9170756

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+3564
-5
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ jobs:
5252
- name: Build
5353
run: pnpm build
5454
- name: Build docs
55-
run: pnpm run docs:build
55+
run: |
56+
pnpm run docs:build
57+
pnpm run demo:build

docs/demo/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# generated types
2+
.astro
3+
4+
# environment variables
5+
.env
6+
.env.production

docs/demo/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# [demo.tutorialkit.dev](https://demo.tutorialkit.dev)
2+
3+
## Local Development
4+
5+
### Prerequisites
6+
7+
- Install [Node.js](https://nodejs.org/en) v18.18 or above.
8+
- Install [pnpm](https://pnpm.io/).
9+
10+
### Set up
11+
12+
Clone this repository and navigate into the cloned directory.
13+
14+
```
15+
git clone [email protected]:stackblitz/tutorialkit.git
16+
cd tutorialkit
17+
```
18+
19+
TutorialKit uses [pnpm workspaces](https://pnpm.io/workspaces). Just run the install command in the root of the project.
20+
21+
```
22+
pnpm install
23+
```
24+
25+
You can now start the demo website by running:
26+
27+
```
28+
pnpm run demo
29+
```

docs/demo/_headers

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/*
2+
Cross-Origin-Embedder-Policy: require-corp
3+
Cross-Origin-Opener-Policy: same-origin

docs/demo/astro.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import tutorialkit from '@tutorialkit/astro';
2+
import { defineConfig } from 'astro/config';
3+
4+
export default defineConfig({
5+
devToolbar: {
6+
enabled: false,
7+
},
8+
integrations: [tutorialkit()],
9+
});

docs/demo/icons/languages/css.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/demo/icons/languages/html.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/demo/icons/languages/js.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/demo/icons/languages/json.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

docs/demo/icons/languages/sass.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/demo/icons/languages/ts.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/demo/package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "demo.tutorialkit.dev",
3+
"version": "0.0.1",
4+
"type": "module",
5+
"private": true,
6+
"scripts": {
7+
"astro": "astro",
8+
"build_with_check": "astro check && pnpm run build",
9+
"build": "astro build && cp _headers ./dist/",
10+
"dev": "astro dev",
11+
"preview": "astro preview",
12+
"start": "astro dev"
13+
},
14+
"dependencies": {
15+
"@tutorialkit/components-react": "workspace:*",
16+
"react": "^18.3.1",
17+
"react-dom": "^18.3.1"
18+
},
19+
"devDependencies": {
20+
"@astrojs/check": "^0.7.0",
21+
"@astrojs/react": "^3.6.0",
22+
"@iconify-json/ph": "^1.1.13",
23+
"@iconify-json/svg-spinners": "^1.1.2",
24+
"@tutorialkit/astro": "workspace:*",
25+
"@tutorialkit/types": "workspace:*",
26+
"@unocss/reset": "^0.60.4",
27+
"@unocss/transformer-directives": "^0.60.4",
28+
"astro": "^4.10.3",
29+
"fast-glob": "^3.3.2",
30+
"prettier-plugin-astro": "^0.14.0",
31+
"typescript": "^5.4.5",
32+
"unocss": "^0.60.4"
33+
}
34+
}

docs/demo/public/favicon.svg

Lines changed: 4 additions & 0 deletions
Loading
51 KB
Loading
95.5 KB
Loading

docs/demo/public/logo-dark.svg

Lines changed: 4 additions & 0 deletions
Loading

docs/demo/public/logo.svg

Lines changed: 4 additions & 0 deletions
Loading

docs/demo/src/content/config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { chapterSchema, lessonSchema, partSchema, tutorialSchema } from '@tutorialkit/types';
2+
import { defineCollection } from 'astro:content';
3+
4+
const tutorial = defineCollection({
5+
type: 'content',
6+
schema: tutorialSchema.strict().or(partSchema.strict()).or(chapterSchema.strict()).or(lessonSchema.strict()),
7+
});
8+
9+
export const collections = { tutorial };
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<form>
2+
<fieldset>
3+
<legend>Hello</legend>
4+
<div>
5+
<label for="q_1">Let's learn!</label>
6+
<input id="q_1" />
7+
</div>
8+
<div><input type="checkbox" checked /><progress value="75" max="100"></progress></div>
9+
</fieldset>
10+
</form>
11+
12+
<link rel="stylesheet" href="style.css" />
13+
<style>
14+
body {
15+
font-family: sans-serif;
16+
}
17+
label {
18+
display: inline-block;
19+
width: 100px;
20+
text-align: right;
21+
padding: 6px;
22+
}
23+
</style>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
fieldset {
2+
background: #f7fafc;
3+
border-color: #e2e8f0;
4+
border-style: solid;
5+
margin: 1em auto;
6+
padding: 1em;
7+
max-width: 500px;
8+
}
9+
10+
legend {
11+
color: #718096;
12+
font-size: 90%;
13+
padding: 0.2em 0.5em;
14+
border: solid 2px #e2e8f0;
15+
border-radius: 4px;
16+
background: #fff;
17+
}
18+
19+
fieldset > div {
20+
padding: 0.3em 0.5em;
21+
display: grid;
22+
grid-template-columns: 1fr 3fr;
23+
}
24+
25+
progress {
26+
border: none;
27+
margin: 20px 130px 10px;
28+
}
29+
30+
progress::-webkit-progress-bar {
31+
background: #f6cd86;
32+
border-radius: 5px;
33+
}
34+
35+
progress::-webkit-progress-value {
36+
background: tomato;
37+
border-radius: 5px;
38+
}
39+
40+
input {
41+
border: solid 2px #e2e8f0;
42+
padding: 4px;
43+
font-size: 1em;
44+
accent-color: #ff3399;
45+
}
46+
47+
input[type='checkbox'] {
48+
justify-self: end;
49+
margin-right: 14px;
50+
width: 20px;
51+
}
52+
53+
label {
54+
padding: 0.5em;
55+
text-align: right;
56+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
3+
Hello, World!
4+
5+
*/
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
type: lesson
3+
title: Style up your forms!
4+
slug: welcome
5+
focus: /welcome.css
6+
---
7+
:::info{noBorder=true title="Welcome!"}
8+
This is a demo tutorial built with <a href="https://tutorialkit.dev" target="_blank">TutorialKit</a>. Although we use it for demonstration purposes, the lessons include actual CSS techniques, so we hope you'll enjoy them and learn something new!
9+
:::
10+
11+
# Style up your forms!
12+
13+
Forms are an incredibly common set of HTML elements – they are a part of almost every web app – but styling them is often not as straightforward as styling a typical `div` or `section`.
14+
15+
This tutorial will let you learn and experiment with some practical techniques that will help elevate your form's CSS to the next level!
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
type: chapter
3+
title: Introduction
4+
slug: introduction
5+
---

0 commit comments

Comments
 (0)