Skip to content

Commit 148e253

Browse files
authored
docs: update docs dependencies (jantimon#17)
1 parent 2e0de51 commit 148e253

File tree

7 files changed

+80
-58
lines changed

7 files changed

+80
-58
lines changed

.github/workflows/docs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- name: RustUp
2626
run: rustup target add wasm32-wasi
2727
- run: npm install
28+
- run: (cd docks && npm install)
2829
- run: npm run prepublishOnly
2930
env:
3031
CI: true

docs/next-env.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/// <reference types="next" />
2-
/// <reference types="next/types/global" />
32
/// <reference types="next/image-types/global" />
43

54
// NOTE: This file should not be edited

docs/package.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@
1111
"dependencies": {
1212
"@babel/core": "7.15.5",
1313
"@babel/preset-env": "^7.15.4",
14-
"@types/react": "^17.0.20",
15-
"@types/react-dom": "^17.0.9",
1614
"classnames": "2.3.1",
1715
"css-variable": "file:../",
1816
"linaria": "2.1.0",
19-
"next": "^11.1.2",
17+
"next": "12.2.3",
2018
"next-linaria": "0.11.0",
21-
"react": "^17.0.2",
22-
"react-dom": "^17.0.2",
19+
"react": "18.2.0",
20+
"react-dom": "18.2.0",
2321
"react-syntax-highlighter": "^15.4.4",
2422
"typescript": "^4.4.3"
23+
},
24+
"devDependencies": {
25+
"@types/react": "^18.0.15",
26+
"@types/react-dom": "^18.0.6"
2527
}
2628
}

docs/pages/CodeExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const MultiCodeButton = styled.button<{active?: boolean}>`
7272
}
7373
`
7474

75-
export const CodeExamples = ({ children }) => {
75+
export const CodeExamples = ({ children }: {children: Record<string, string>}) => {
7676
const keys = Object.keys(children);
7777
const [activeKey, setActiveKeys] = useState(keys[0]);
7878
return <CodeExampleWrapper>

docs/pages/index.page.tsx

+68-49
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const Badges = styled.div`
129129
margin-right: 8px;
130130
margin-bottom: 8px;
131131
line-height: 0;
132-
`
132+
`;
133133

134134
const Index = () => (
135135
<>
@@ -221,14 +221,14 @@ export const globalStyles = css\`:global() {
221221

222222
<CodeExamples>
223223
{{
224-
'js source': `
224+
"js source": `
225225
import { tokens } from './tokens';
226226
227227
export const Headline = styled.h1\`
228228
color: \${tokens.primary};
229229
\`;
230230
`,
231-
'css result': `
231+
"css result": `
232232
.se7gjt0-headline {
233233
color: var(--primary--1isauia0);
234234
}
@@ -241,7 +241,10 @@ export const Headline = styled.h1\`
241241
<Section reverse>
242242
<SectionContent>
243243
<Headline>Create themable CSS Snippets</Headline>
244-
<Text>Define which parts of your reusable css are customizable without overwrites</Text>
244+
<Text>
245+
Define which parts of your reusable css are customizable without
246+
overwrites
247+
</Text>
245248
</SectionContent>
246249
<SectionExample>
247250
<CodeExamples>
@@ -273,7 +276,7 @@ export const gradientHover = css\`
273276
</CodeExamples>
274277
<CodeExamples>
275278
{{
276-
'js source': `
279+
"js source": `
277280
import { startColor, endColor, gradientHover } from './gradient';
278281
279282
export const Button = styled.button\`
@@ -282,13 +285,13 @@ export const Button = styled.button\`
282285
\${gradientHover}
283286
\`;
284287
`,
285-
'css result': `
288+
"css result": `
286289
.se7gjt0-button {
287290
--1isauia0: #f5ab35;
288291
--1isauia1: #8d1d1d;
289292
/* the css from gradientHover */
290293
}
291-
`
294+
`,
292295
}}
293296
</CodeExamples>
294297
</SectionExample>
@@ -301,6 +304,7 @@ export const Button = styled.button\`
301304
The recommended babel plugin generates unique variable names during
302305
build time
303306
</Text>
307+
<br /><br />
304308
<Headline>Automatic DX</Headline>
305309
<Text>
306310
All babel generated variable names will have human readable names
@@ -310,13 +314,21 @@ export const Button = styled.button\`
310314
<SectionExample>
311315
<CodeExamples>
312316
{{
313-
base: `
317+
babel: `
314318
{
315319
"plugins": [
316320
"css-variable/babel"
317321
]
318322
}
319-
`,withOptions: `
323+
`,
324+
swc: `
325+
{
326+
"plugins": [
327+
"css-variable/swc", { "basePath": __dirname },
328+
]
329+
}
330+
`,
331+
withOptions: `
320332
{
321333
"plugins": [
322334
["css-variable/babel", {
@@ -327,7 +339,7 @@ export const Button = styled.button\`
327339
}]
328340
]
329341
}
330-
`
342+
`,
331343
}}
332344
</CodeExamples>
333345
<CodeExamples>
@@ -364,7 +376,13 @@ export const theme = {
364376
<Section reverse>
365377
<SectionContent>
366378
<Headline>Typed Contracts</Headline>
367-
<Text>By default any string is a valid CSSVariable value.<br /><br />But it doesn't end here - the generic interface allows to define explicitly which values are assignable</Text>
379+
<Text>
380+
By default any string is a valid CSSVariable value.
381+
<br />
382+
<br />
383+
But it doesn't end here - the generic interface allows to define
384+
explicitly which values are assignable
385+
</Text>
368386
</SectionContent>
369387
<SectionExample>
370388
<CodeExamples>
@@ -387,50 +405,51 @@ export const tokens = {
387405
</CodeExamples>
388406
</SectionExample>
389407
</Section>
390-
391-
392408
</Main>
393409
<Footer>
394410
<FooterContent>
395411
<Badges>
396-
<a href="https://www.npmjs.com/package/css-variable" target="_blank">
397-
<img
398-
alt="npm"
399-
src="https://img.shields.io/npm/v/css-variable?style=for-the-badge"
400-
/>
401-
</a>
402-
<a href="https://bundle.js.org/?q=css-variable&treeshake=[createVar]" target="_blank">
403-
<img
404-
alt="Minified Gziped Size"
405-
src="https://img.shields.io/badge/minzip-288b-blue?style=for-the-badge"
406-
/>
407-
</a>
408-
<a href="https://github.com/jantimon/css-variable/" target="_blank">
409-
<img
410-
src="https://img.shields.io/badge/github-OSS-brightgreen?style=for-the-badge&logo=GitHub"
411-
alt="Github"
412-
/>
413-
</a>
412+
<a href="https://www.npmjs.com/package/css-variable" target="_blank">
413+
<img
414+
alt="npm"
415+
src="https://img.shields.io/npm/v/css-variable?style=for-the-badge"
416+
/>
417+
</a>
418+
<a
419+
href="https://bundle.js.org/?q=css-variable&treeshake=[createVar]"
420+
target="_blank"
421+
>
422+
<img
423+
alt="Minified Gziped Size"
424+
src="https://img.shields.io/badge/minzip-288b-blue?style=for-the-badge"
425+
/>
426+
</a>
427+
<a href="https://github.com/jantimon/css-variable/" target="_blank">
428+
<img
429+
src="https://img.shields.io/badge/github-OSS-brightgreen?style=for-the-badge&logo=GitHub"
430+
alt="Github"
431+
/>
432+
</a>
414433
</Badges>
415434
<Badges>
416-
<a
417-
href="https://github.com/jantimon/css-variable/actions/workflows/e2e-test.yml"
418-
target="_blank"
419-
>
420-
<img
421-
alt="GitHub Actions Status"
422-
src="https://img.shields.io/github/workflow/status/jantimon/css-variable/e2e%20test/main?style=for-the-badge"
423-
/>
424-
</a>
425-
<a
426-
href="https://github.com/jantimon/css-variable/blob/main/license"
427-
target="_blank"
428-
>
429-
<img
430-
alt="MIT License"
431-
src="https://img.shields.io/npm/l/css-variable?style=for-the-badge"
432-
/>
433-
</a>
435+
<a
436+
href="https://github.com/jantimon/css-variable/actions/workflows/e2e-test.yml"
437+
target="_blank"
438+
>
439+
<img
440+
alt="GitHub Actions Status"
441+
src="https://img.shields.io/github/workflow/status/jantimon/css-variable/e2e%20test/main?style=for-the-badge"
442+
/>
443+
</a>
444+
<a
445+
href="https://github.com/jantimon/css-variable/blob/main/license"
446+
target="_blank"
447+
>
448+
<img
449+
alt="MIT License"
450+
src="https://img.shields.io/npm/l/css-variable?style=for-the-badge"
451+
/>
452+
</a>
434453
</Badges>
435454
</FooterContent>
436455
</Footer>

docs/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"moduleResolution": "node",
1717
"resolveJsonModule": true,
1818
"isolatedModules": true,
19-
"jsx": "preserve"
19+
"jsx": "preserve",
20+
"incremental": true
2021
},
2122
"include": [
2223
"next-env.d.ts",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"@swc/jest": "^0.2.21",
6767
"@types/jest": "^27.0.1",
6868
"jest": "^27.5.1",
69-
"terser": "5.7.2",
69+
"terser": "5.14.2",
7070
"typescript": "^4.4.2"
7171
}
7272
}

0 commit comments

Comments
 (0)