|
43 | 43 | <a href="https://tailwindcss.com/docs/guides/sveltekit" target="_blank">guide</a>. |
44 | 44 | </p> |
45 | 45 |
|
46 | | - You can use LayerChart with your existing project, such as |
| 46 | + You can also use LayerChart within your existing project, such as |
47 | 47 | <a href="https://www.skeleton.dev/" target="_blank">Skeleton</a>, |
48 | 48 | <a href="https://www.shadcn-svelte.com/" target="_blank">shadcn-svelte</a>, or |
49 | 49 | <a href="https://daisyui.com/" target="_blank">Daisy UI</a>. See |
|
90 | 90 | <a |
91 | 91 | href="https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-registering-sources" |
92 | 92 | target="_blank">Tailwind</a |
93 | | - > |
| 93 | + >. |
94 | 94 | </div> |
95 | | - <Code source={`@source '../../node_modules/layerchart/dist';`} language="css" /> |
| 95 | + <Code |
| 96 | + source={`@import 'tailwindcss'; |
| 97 | +@source '../node_modules/layerchart/dist';`} |
| 98 | + language="css" |
| 99 | + /> |
| 100 | + |
| 101 | + <p> |
| 102 | + You will also need to add a few theme colors to your Tailwind config. This can be done |
| 103 | + explicitly (includig <a href="https://github.com/techniq/layerchart/issues/160" target="_blank" |
| 104 | + >mapping</a |
| 105 | + > to existing CSS variables of popular frameworks). |
| 106 | + </p> |
| 107 | + |
| 108 | + <Code |
| 109 | + source={`@theme { |
| 110 | + --color-primary: hsl(...); |
| 111 | + --color-surface-100: hsl(...); |
| 112 | + --color-surface-200: hsl(...); |
| 113 | + --color-surface-300: hsl(...); |
| 114 | + --color-surface-content: hsl(...); |
| 115 | +}`} |
| 116 | + language="css" |
| 117 | + /> |
| 118 | + |
| 119 | + <p>or by leveraging one of LayerStack's themes.</p> |
| 120 | + |
| 121 | + <Code |
| 122 | + source={`/* Set up theme colors */ |
| 123 | +@import '@layerstack/tailwind/core.css'; |
| 124 | +
|
| 125 | +/* Then choose one of the following: */ |
| 126 | +
|
| 127 | +/* 1. Basic light/dark theme */ |
| 128 | +@import '@layerstack/tailwind/themes/basic.css'; |
| 129 | +
|
| 130 | +/* 2. All Daisy UI themes ported to LayerStack */ |
| 131 | +@import '@layerstack/tailwind/themes/daisy.css'; |
| 132 | +
|
| 133 | +/* 3. All Skeleton themes ported to LayerStack */ |
| 134 | +@import '@layerstack/tailwind/themes/skeleton.css'; |
| 135 | +
|
| 136 | +/* 4. All Daisy UI and Skeleton themes ported to LayerStack (used by docs) */ |
| 137 | +@import '@layerstack/tailwind/themes/all.css'; |
| 138 | +`} |
| 139 | + language="css" |
| 140 | + /> |
96 | 141 |
|
97 | 142 | <h2>Usage</h2> |
98 | 143 |
|
|
0 commit comments