Comments (5)
Here's instructions to scaffold a very barebones Astro app:
Scaffold
https://docs.astro.build/en/install/auto/
npm create astro@latest
- Name: (ex: "my-astro-skeleton-app")
- Template: empty project
- Install Deps: y
- Init Git: y
- Typescript: Strict (Recommended)
cd my-astro-skeleton-app
Integrate Svelte
https://docs.astro.build/en/guides/integrations-guide/svelte/
npx astro add svelte
Integrate Tailwind
https://docs.astro.build/en/guides/integrations-guide/tailwind/
npx astro add tailwind
Add /src/styles/base.css
and set @tailwind directives:
@tailwind base;
@tailwind components;
@tailwind utilities;
Add /src/styles/theme.css
to house your theme CSS
Standard Skeleton Setup
(follow standard Skeleton instructions to configure Tailwind and Themes)
Create an Astro Layout
Create an astro layout in /src/layouts/BasicLayout.astro
---
import '../styles/theme.css';
import '../styles/base.css';
---
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<title>Astro</title>
</head>
<body>
<slot />
</body>
</html>
Update Homepage and Add Component
Update /src/pages/index.astro
to use your layout and add a basic component
---
import BasicLayout from '../layouts/BasicLayout.astro';
import { Button } from '@brainandbones/skeleton';
---
<BasicLayout>
<h1 class="mb-4">Homepage</h1>
<Button client:load variant="filled-primary">Skeleton</Button>
</BasicLayout>
NOTE: Make sure you Hydrate your components:
https://docs.astro.build/en/core-concepts/framework-components/
Notes:
- Any form of structural components and their props seem to work (ex: Buttons)
- Component slots seem to work as expected.
- Complex features, such as Dialogs, do not work (yet) as I'm not sure how to use Svelte writables with Astro
- Likewise I'm not certain on how to handle component directives and events, such as
on:click
, so we may need someone from the Astro community to provide guidance here.
from skeleton.
I've created a thread on the Astro Discord asking about how to utilize certain features that are required for some Skeleton features to operate:
https://discord.com/channels/830184174198718474/1008810187802562620
from skeleton.
FYI I had a great conversation with folks on the Astro Discord including a couple core team members. See the log in the link above.
Long story short, their recommendation is to wrap anything functional within a parent Svelte component. Here's a quick example in pseudo code:
<AstroComponent>
<SvelteWrapperComp client:load>
(anything Skeleton related can live here)
<SvelteWrapperComp>
</AstroComponent>
Here's an example of the Dialog system working within an Astro app using this structure:
Now, they do make a great point that this pattern is only required if you have logic and functionality, such as click handlers, etc. If whatever you're providing is static (ex: LogoCloud), you could embed this straight into a Astro component. No wrapper or hydration needed, which would lead to better performance.
I'll update the docs with these revisions soon, then begin applying them to the Docs.
from skeleton.
This documentation is now complete and ready for testing on branch:
feat/vite-svelte
(reused this, sorry for the poor naming!)
Note you'll need to manually disable the Menu/LightSwitch/CodeBlock in your node_modules > Skeleton > index.js
if you follow the instructions.
from skeleton.
See: #108
from skeleton.
Related Issues (20)
- Svelte v5 RC: InputChip component produces errors HOT 9
- v3 React AppBar does not follow export conventions HOT 1
- v3 - consistency -D and --save-dev HOT 7
- TreeView - Custom Icons. HOT 1
- Carousel seems broken on doc page HOT 1
- Refactor React components to fall more inline with existing React libraries HOT 4
- RFC: Remove return types from React components
- A little bit of white peeking out on the progress bars (styling issue) HOT 4
- InputChips does not have restProps HOT 2
- Table of Contents: support setting scrollTarget, scrollOffset HOT 1
- AppRailTile on:click not working (v2.10.1) HOT 1
- Revert missing on:click event for App Rail Anchor Tile component
- NEXT: component consistency pass
- Missing import of popup HOT 3
- Carousels example HOT 2
- v3 Component API Revisions
- NEXT: Revisit Tab Component and API
- NEXT: Accordion missing a11y HOT 1
- NEXT: Dependency updates
- NEXT: Introduce the skeleton-a11y package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skeleton.