Skip to content

Commit

Permalink
Fixes support for tailwindcss
Browse files Browse the repository at this point in the history
  • Loading branch information
Titou325 committed Mar 18, 2024
1 parent cb2c8f2 commit 480a880
Show file tree
Hide file tree
Showing 51 changed files with 29 additions and 37 deletions.
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ node_modules
tsconfig.json
docs
src/ui
docgen
tests
build
tailwind.config.ts
tsup.config.ts
4 changes: 2 additions & 2 deletions docs/components/tailwind.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Support

#### Preview

<Frame type="glass"><img src="../images/previews/tailwind-39f5e262/document.1.jpg" style={{ maxHeight: '400px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>
<Frame type="glass"><img src="../images/previews/tailwind-d34cd362/document.1.jpg" style={{ maxHeight: '400px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>

<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
```jsx template.tsx
Expand Down Expand Up @@ -57,7 +57,7 @@ body {

You can also pass a custom Tailwind config to the Tailwind component.

<Frame type="glass"><img src="../images/previews/tailwind-75273488/document.1.jpg" style={{ maxHeight: '400px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>
<Frame type="glass"><img src="../images/previews/tailwind-841def4d/document.1.jpg" style={{ maxHeight: '400px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>

<div style={{paddingTop: "1rem", paddingBottom: "1rem"}}><CodeGroup>
```jsx template.tsx
Expand Down
Binary file modified docs/images/previews/compile-1badee62/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/css-393a92da/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/css-83e5c15a/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/css-b26814a3/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/floatbottom-9a3986d7/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/footnote-fb378308/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/latex-7a00ed36/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/latex-83ad6403/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/markdown-882cc486/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/markdown-c8d0ecd4/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/pagebottom-206d811e/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/pagenumber-7e3be4c3/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/pagenumber-cc94f6f7/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/pagesnumber-a7d845b5/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/pagetop-9dd97ef3/document.pdf
Binary file not shown.
Binary file modified docs/images/previews/runningh1-b41bbc29/document.pdf
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions docs/ui/templates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ icon: list
<CardGroup>
<Card title="Scientific" href="../../../ui/templates/scientific-report">
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
<img src="../images/previews/ui-templates-scientific-report-556d96d9/document.1.jpg"/>
<img src="../images/previews/ui-templates-scientific-report-01382231/document.1.jpg"/>
</div>
</Card>
<Card title="With charts" href="../../../ui/templates/report-charts">
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
<img src="../images/previews/ui-templates-report-charts-56eaa9e7/document.1.jpg"/>
<img src="../images/previews/ui-templates-report-charts-568a756b/document.1.jpg"/>
</div>
</Card>
</CardGroup>
Expand All @@ -23,7 +23,7 @@ icon: list
<CardGroup>
<Card title="Receipt" href="../../../ui/templates/receipt">
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
<img src="../images/previews/ui-templates-receipt-d84c20b5/document.1.jpg"/>
<img src="../images/previews/ui-templates-receipt-3f97df85/document.1.jpg"/>
</div>
</Card>
</CardGroup>
Expand All @@ -33,7 +33,7 @@ icon: list
<CardGroup>
<Card title="NDA Markdown" href="../../../ui/templates/nda-markdown">
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
<img src="../images/previews/ui-templates-nda-markdown-68b17497/document.1.jpg"/>
<img src="../images/previews/ui-templates-nda-markdown-555147ca/document.1.jpg"/>
</div>
</Card>
</CardGroup>
Expand All @@ -43,12 +43,12 @@ icon: list
<CardGroup>
<Card title="Basic" href="../../../ui/templates/invoice">
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
<img src="../images/previews/ui-templates-invoice-347d83f3/document.1.jpg"/>
<img src="../images/previews/ui-templates-invoice-b87296fc/document.1.jpg"/>
</div>
</Card>
<Card title="Advanced with QR" href="../../../ui/templates/invoice-advanced">
<div style={{ marginTop: "1rem", borderRadius: "0.25rem", overflow: "hidden" }}>
<img src="../images/previews/ui-templates-invoice-advanced-a7bdef10/document.1.jpg"/>
<img src="../images/previews/ui-templates-invoice-advanced-4497fe25/document.1.jpg"/>
</div>
</Card>
</CardGroup>
Expand Down
2 changes: 1 addition & 1 deletion docs/ui/templates/invoice-advanced.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ icon: file-invoice
category: Invoices
---

<Frame type="glass"><img src="../../images/previews/ui-templates-invoice-advanced-a7bdef10/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>
<Frame type="glass"><img src="../../images/previews/ui-templates-invoice-advanced-4497fe25/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>

```jsx
import { Footnote, PageBottom, Tailwind, CSS } from "@onedoc/react-print";
Expand Down
2 changes: 1 addition & 1 deletion docs/ui/templates/invoice.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ icon: file-invoice
category: Invoices
---

<Frame type="glass"><img src="../../images/previews/ui-templates-invoice-347d83f3/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>
<Frame type="glass"><img src="../../images/previews/ui-templates-invoice-b87296fc/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>

```jsx
import { Footnote, PageBottom, Tailwind } from "@onedoc/react-print";
Expand Down
2 changes: 1 addition & 1 deletion docs/ui/templates/nda-markdown.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ icon: file-contract
category: NDA
---

<Frame type="glass"><img src="../../images/previews/ui-templates-nda-markdown-68b17497/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>
<Frame type="glass"><img src="../../images/previews/ui-templates-nda-markdown-555147ca/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>

```jsx
import React from "react";
Expand Down
2 changes: 1 addition & 1 deletion docs/ui/templates/receipt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ icon: receipt
category: Receipts
---

<Frame type="glass"><img src="../../images/previews/ui-templates-receipt-d84c20b5/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>
<Frame type="glass"><img src="../../images/previews/ui-templates-receipt-3f97df85/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>

```jsx
import { Footnote, Tailwind } from "@onedoc/react-print";
Expand Down
2 changes: 1 addition & 1 deletion docs/ui/templates/report-charts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ icon: chart-pie
category: Reports
---

<Frame type="glass"><img src="../../images/previews/ui-templates-report-charts-56eaa9e7/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>
<Frame type="glass"><img src="../../images/previews/ui-templates-report-charts-568a756b/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>

```jsx
import { Footnote, PageBottom, Tailwind, CSS } from "@onedoc/react-print";
Expand Down
2 changes: 1 addition & 1 deletion docs/ui/templates/scientific-report.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ icon: flask
category: Reports
---

<Frame type="glass"><img src="../../images/previews/ui-templates-scientific-report-556d96d9/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>
<Frame type="glass"><img src="../../images/previews/ui-templates-scientific-report-01382231/document.1.jpg" style={{ maxHeight: '600px', borderRadius: "0.25rem", overflow: "hidden" }} /></Frame>

```jsx
import React, { createContext, useEffect, useState } from "react";
Expand Down
26 changes: 7 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@chakra-ui/react": "^2.8.2",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@heroicons/react": "^2.1.1",
"@hyrious/esbuild-plugin-commonjs": "^0.2.4",
"@mdx-js/esbuild": "^3.0.0",
"@onedoc/client": "^0.1.28",
"@swc/core": "^1.3.107",
Expand All @@ -61,6 +60,7 @@
"acorn-typescript": "^1.4.13",
"autoprefixer": "^10.4.17",
"dotenv": "^16.4.1",
"esbuild-plugin-alias": "^0.2.1",
"front-matter": "^4.0.2",
"mintlify": "^4.0.122",
"patch-package": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/tailwind/tailwind.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const Tailwind = ({

const { css } = postcss([
createTailwindcssPlugin({
...tailwindConfig,
tailwindConfig,
content: [{ content: markup, extension: "html" }],
}),
// postcssCssVariables,
Expand Down
3 changes: 1 addition & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineConfig } from "tsup";
import { RawPlugin } from "./build/raw";
import { commonjs } from "@hyrious/esbuild-plugin-commonjs";

export default defineConfig({
entry: ["src/index.ts", "src/mdx.ts", "src/server.ts", "src/client.ts"],
Expand All @@ -9,6 +8,6 @@ export default defineConfig({
clean: false,
format: ["cjs", "esm"],
dts: true,
esbuildPlugins: [RawPlugin(), commonjs()],
esbuildPlugins: [RawPlugin()],
bundle: true,
});

0 comments on commit 480a880

Please sign in to comment.