reepolee / svelte-routify-windi-vite Goto Github PK
View Code? Open in Web Editor NEWSvelte Starter template with Routify file-based router, WindiCSS Tailwind compiler and Vite
Svelte Starter template with Routify file-based router, WindiCSS Tailwind compiler and Vite
Hey! Great starter template.
However, when I am trying to use the variants inside @apply of the svelte components, I get this error:
I know it is probably not related to this repo at all, but you are awesome and might have some knowledge on how to tackle this problem.
I create a shortcut to download this template quickly:
npm init aqua
I'm using this template to make an internal tool and ran into a couple of issues, nothing that you can't circumvent with a little cheating but they do ruin the experience a bit. They are all related to Windi or how the svelte file is parsed for Windi, I'm not sure if this is the right place for it though but I wanted these problems outlined for other who might face these issues.
<span class="{foo?"bg-blue-500":"bg-red-600"}"></span>
Here Windi will not consider bg-blue-500
or bg-red-600
in it's compiled css, whether this is the best or worst way to implement such a feature is a debate for another day but the easiest fix I have is to make a hidden component and shove these classes in it.
@apply hover:bg-red-300
in a svelte files style tag fails to compileThere's a compilation error when there's a :
in an @apply
statement. I moved the definition to the style.css
file and everything compiled and worked as normal.
For Tailwindcss-intellisense to work in VS Code it needs to have the tailwindcss repository as a dev dependency. I mean you can work with out autocomplete but it's a chore. I forked this and added it. Didn't know if you wanted to add it yourself but I thought I'd mention it.
btw thanks for making this starter! It's nice and fast to work with!
import type {filetype} from "../Modules.svelte";
The above code gives an error. Similar code when tested with svelte template, worked fine.
I noticed that the current code uses the <main>
element as a container in the _layout.svelte file and on the index.svelte. According to W3C spec:
There must not be more than one
<main>
element in a document. The<main>
element must NOT be a descendant of an<article>
,<aside>
,<footer>
,<header>
, or<nav>
element.
There are a few solutions to this. The easiest is just to use a generic<div>
on the index.svelte page or on the layout page or both. You could get way more specific with the semantic html but as this is more of an example code starter it's probably best just to use the generic <div>
, rather than restructure everything with perfect semantic html. Leave the latter to the person using it.
Hi. I have a problem with my laptop. If I create new file in src/pages
, my laptop become hang (CPU 100%). So, I think, the sollution is if .routify/urlindex.json
modified, Vite full reload
. But, what is code of this?
Thanks~
Could you add SSG export for routify? I tried it but have issues with the modules not loading correctly (searches for modules in node_modules instead of dist/assets).
The build output from this template is little bit difference compare to the official starter template. Because of this, I am a little confused about how to integrate using tossr for SSR purposes. Are there any instructions so i can do this purposes?
dist/index.html
(formatted)<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Routify Windi Vite</title>
<link rel="icon" type="image/png" href="/assets/favicon.png">
<!-- Is this a replacement for the `app.js` file needed by tossr? -->
<script type="module" crossorigin src="/assets/index.343938c9.js"></script>
<!-- or this? -->
<link rel="modulepreload" href="/assets/vendor.988e13b5.js">
<link rel="stylesheet" href="/assets/index.2b71573f.css">
</head>
<body>
<div id="app"></div>
</body>
</html>
const { tossr } = require('tossr')
const template = 'dist/index.html'
const script = 'dist/app.js'
const url = '/blog/ssr-is-fun'
const html = await tossr(template, script, url)
In this case, is the app.js
script still needed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.